chore: display available clusters

This commit is contained in:
jialin
2025-09-16 20:32:26 +08:00
parent c9c9401b0b
commit d063dfd652
14 changed files with 121 additions and 39 deletions
+1 -2
View File
@@ -169,7 +169,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
getGPUOptionList(params);
}
};
}, []);
});
return (
<FormInnerContext.Provider
@@ -242,7 +242,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
<HuggingFaceForm></HuggingFaceForm>
<LocalPathForm></LocalPathForm>
<Form.Item<FormData>
name="cluster_id"
rules={[
@@ -486,6 +486,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
if (open) {
setTimeout(() => {
fetchSpecData();
form.current?.getGPUOptionList?.({
clusterId: initClusterId()
});
}, 100);
}
return () => {
@@ -477,6 +477,10 @@ const AddModal: FC<AddModalProps> = (props) => {
onSelectModelAfterEvaluate={
handleOnSelectModelAfterEvaluate
}
clusterId={
form.current?.getFieldValue?.('cluster_id') ||
initClusterId()
}
displayEvaluateStatus={displayEvaluateStatus}
gpuOptions={[]}
></SearchModel>
@@ -40,19 +40,12 @@ const PaginationMain = styled(Pagination)`
}
`;
const IconFontWrapper = styled.div`
.ant-pagination-item-link {
display: flex !important;
align-items: center;
justify-content: center;
}
`;
interface SearchInputProps {
hasLinuxWorker?: boolean;
modelSource: string;
isDownload?: boolean;
gpuOptions?: any[];
clusterId: number;
setLoadingModel?: (flag: boolean) => void;
onSourceChange?: (source: string) => void;
onSelectModel: (model: any, manul?: boolean) => void;
@@ -70,6 +63,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
isDownload,
hasLinuxWorker,
gpuOptions,
clusterId,
setLoadingModel,
onSelectModel,
onSelectModelAfterEvaluate,
@@ -295,6 +289,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
return {
...backendObj,
cluster_id: clusterId,
source: modelSource,
...(modelSource === modelSourceMap.huggingface_value
? {
@@ -256,6 +256,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
useEffect(() => {
if (open && formData) {
setOriginalFormData();
getGPUOptionList({ clusterId: formData.cluster_id });
}
if (!open) {
checkTokenRef.current?.cancel?.();