fix: catalog hidden fields

This commit is contained in:
jialin
2026-05-28 15:51:51 +08:00
committed by jialin
parent e47a9304f4
commit f99621ec92
4 changed files with 10 additions and 2 deletions
@@ -103,6 +103,7 @@ export const templateActions = [
label: 'common.button.delete', label: 'common.button.delete',
key: 'delete', key: 'delete',
locale: true, locale: true,
access: 'canSeeAdmin',
icon: icons.DeleteOutlined, icon: icons.DeleteOutlined,
danger: true danger: true
} }
@@ -59,6 +59,7 @@ const GPUServiceTemplateForm: React.FC<TemplateFormProps> = forwardRef(
form={form} form={form}
onFinish={handleFinish} onFinish={handleFinish}
preserve={false} preserve={false}
scrollToFirstError
initialValues={{ initialValues={{
spec: { spec: {
imagePullPolicy: DefaultImagePullPolicy, imagePullPolicy: DefaultImagePullPolicy,
@@ -17,6 +17,8 @@ const ModelLoraList = () => {
const base = huggingfaceRepoId || modelScopeModelId || localPath || ''; const base = huggingfaceRepoId || modelScopeModelId || localPath || '';
console.log('fetching lora list with base', base, form.getFieldsValue());
const { dataList: defaultDataList, fetchData } = useQueryModelLoraList(); const { dataList: defaultDataList, fetchData } = useQueryModelLoraList();
const [itemList, setItemList] = useState<ItemValue[]>([]); const [itemList, setItemList] = useState<ItemValue[]>([]);
@@ -49,6 +51,7 @@ const ModelLoraList = () => {
prevBaseRef.current = ''; prevBaseRef.current = '';
return; return;
} }
fetchData({ base }); fetchData({ base });
if (prevBaseRef.current && prevBaseRef.current !== base) { if (prevBaseRef.current && prevBaseRef.current !== base) {
form.setFieldValue('lora_list', []); form.setFieldValue('lora_list', []);
+5 -2
View File
@@ -19,8 +19,7 @@ const HuggingFaceForm: React.FC = () => {
![ ![
modelSourceMap.huggingface_value, modelSourceMap.huggingface_value,
modelSourceMap.modelscope_value modelSourceMap.modelscope_value
].includes(source) || ].includes(source)
formKey === DeployFormKeyMap.CATALOG
) { ) {
return null; return null;
} }
@@ -36,6 +35,7 @@ const HuggingFaceForm: React.FC = () => {
<Form.Item<FormData> <Form.Item<FormData>
name="huggingface_repo_id" name="huggingface_repo_id"
key="huggingface_repo_id" key="huggingface_repo_id"
hidden={formKey === DeployFormKeyMap.CATALOG}
rules={[ rules={[
{ {
required: true, required: true,
@@ -52,6 +52,7 @@ const HuggingFaceForm: React.FC = () => {
</Form.Item> </Form.Item>
{isGGUF && ( {isGGUF && (
<Form.Item<FormData> <Form.Item<FormData>
hidden={formKey === DeployFormKeyMap.CATALOG}
name="huggingface_filename" name="huggingface_filename"
key="huggingface_filename" key="huggingface_filename"
> >
@@ -67,6 +68,7 @@ const HuggingFaceForm: React.FC = () => {
<Form.Item<FormData> <Form.Item<FormData>
name="model_scope_model_id" name="model_scope_model_id"
key="model_scope_model_id" key="model_scope_model_id"
hidden={formKey === DeployFormKeyMap.CATALOG}
rules={[ rules={[
{ {
required: true, required: true,
@@ -85,6 +87,7 @@ const HuggingFaceForm: React.FC = () => {
<Form.Item<FormData> <Form.Item<FormData>
name="model_scope_file_path" name="model_scope_file_path"
key="model_scope_file_path" key="model_scope_file_path"
hidden={formKey === DeployFormKeyMap.CATALOG}
> >
<CInput.Input <CInput.Input
label={intl.formatMessage({ id: 'models.form.filename' })} label={intl.formatMessage({ id: 'models.form.filename' })}