diff --git a/src/locales/en-US/clusters.ts b/src/locales/en-US/clusters.ts index 88d10221..60d1ff04 100644 --- a/src/locales/en-US/clusters.ts +++ b/src/locales/en-US/clusters.ts @@ -79,5 +79,6 @@ Same applies to the /opt/dtk directory.`, 'clusters.addworker.notSpecified': 'Not Specified', 'clusters.addworker.autoDetect': 'Auto-detect', 'clusters.addworker.extraVolume.holder': - 'e.g. /data/models (path must start with /)' + 'e.g. /data/models (path must start with /)', + 'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device' }; diff --git a/src/locales/ja-JP/clusters.ts b/src/locales/ja-JP/clusters.ts index 09835138..1941bae8 100644 --- a/src/locales/ja-JP/clusters.ts +++ b/src/locales/ja-JP/clusters.ts @@ -79,7 +79,8 @@ Same applies to the /opt/dtk directory.`, 'clusters.addworker.notSpecified': 'Not Specified', 'clusters.addworker.autoDetect': 'Auto-detect', 'clusters.addworker.extraVolume.holder': - 'e.g. /data/models (path must start with /)' + 'e.g. /data/models (path must start with /)', + 'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device' }; // ========== To-Do: Translate Keys (Remove After Translation) ========== @@ -150,4 +151,5 @@ Same applies to the /opt/dtk directory.`, // 65. 'clusters.addworker.notSpecified': 'Not Specified', // 66. 'clusters.addworker.autoDetect': 'Auto-detect', // 67. 'clusters.addworker.extraVolume.holder': 'e.g. /data/models (path must start with /)' +// 68. 'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device' // ========== End of To-Do List ========== diff --git a/src/locales/ru-RU/clusters.ts b/src/locales/ru-RU/clusters.ts index cc1a8f3b..e65f2f32 100644 --- a/src/locales/ru-RU/clusters.ts +++ b/src/locales/ru-RU/clusters.ts @@ -79,7 +79,8 @@ export default { 'clusters.addworker.notSpecified': 'Not Specified', 'clusters.addworker.autoDetect': 'Auto-detect', 'clusters.addworker.extraVolume.holder': - 'e.g. /data/models (path must start with /)' + 'e.g. /data/models (path must start with /)', + 'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device' }; // ========== To-Do: Translate Keys (Remove After Translation) ========== @@ -102,5 +103,6 @@ export default { // 17. 'clusters.addworker.nvidiaNotes-01': 'If multiple outbound IPs exist, specify the one you want the worker to use. Please double-check with hostname -I | xargs -n1.', // 18. 'clusters.addworker.nvidiaNotes-02': 'If a model directory already exists on the worker, you can specify the path to mount it.', // 19. 'clusters.addworker.autoDetect': 'Auto-detect', -// 20. 'clusters.addworker.extraVolume.holder': 'e.g. /data/models (path must start with /)' +// 20. 'clusters.addworker.extraVolume.holder': 'e.g. /data/models (path must start with /)', +// 21. 'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device' // ========== End of To-Do List ========== diff --git a/src/locales/zh-CN/clusters.ts b/src/locales/zh-CN/clusters.ts index 06294fc0..65d8603b 100644 --- a/src/locales/zh-CN/clusters.ts +++ b/src/locales/zh-CN/clusters.ts @@ -77,5 +77,6 @@ export default { 'clusters.addworker.notSpecified': '未指定', 'clusters.addworker.autoDetect': '自动检测', 'clusters.addworker.extraVolume.holder': - '例如:/data/models(路径需以 / 开头)' + '例如:/data/models(路径需以 / 开头)', + 'clusters.addworker.vendorNotes.title': '{vendor}设备注意事项' }; diff --git a/src/pages/cluster-management/components/add-worker/vendor-notes.tsx b/src/pages/cluster-management/components/add-worker/vendor-notes.tsx index 743c19d9..b37e21b1 100644 --- a/src/pages/cluster-management/components/add-worker/vendor-notes.tsx +++ b/src/pages/cluster-management/components/add-worker/vendor-notes.tsx @@ -10,14 +10,17 @@ const VendorNotes = () => { const workerCommand = summary.get('workerCommand') || ({ - label: 'N/A', + label: '', notes: [] } as { label: string; notes: string[] }); return ( void; } const AccessControlForm = forwardRef((props: AccessControlFormProps, ref) => { - const { currentData, onFinish } = props; + const { action, currentData, onFinish } = props; const intl = useIntl(); const [form] = Form.useForm(); const accessPolicy = Form.useWatch('access_policy', form); @@ -133,6 +136,9 @@ const AccessControlForm = forwardRef((props: AccessControlFormProps, ref) => { const userMap = new Map(allusers.map((u) => [u.key, u])); if (currentData?.id) { + form.setFieldsValue({ + access_policy: currentData?.access_policy + }); queryModelAccessUserList(currentData.id).then((res) => { const keys = res.items.map((item) => item.id); setTargetKeys(keys); @@ -220,7 +226,7 @@ const AccessControlForm = forwardRef((props: AccessControlFormProps, ref) => { clearOnDestroy={true} scrollToFirstError={true} initialValues={{ - access_policy: 'authed' + access_policy: action === PageAction.CREATE ? 'authed' : undefined }} > diff --git a/src/pages/llmodels/components/access-control-modal/index.tsx b/src/pages/llmodels/components/access-control-modal/index.tsx index 4fa5bf5f..4e2054a9 100644 --- a/src/pages/llmodels/components/access-control-modal/index.tsx +++ b/src/pages/llmodels/components/access-control-modal/index.tsx @@ -53,6 +53,7 @@ const AccessControlModal: React.FC< diff --git a/src/pages/resources/hooks/use-worker-maintenance.tsx b/src/pages/resources/hooks/use-worker-maintenance.tsx index ffbea2b5..3257e786 100644 --- a/src/pages/resources/hooks/use-worker-maintenance.tsx +++ b/src/pages/resources/hooks/use-worker-maintenance.tsx @@ -99,7 +99,7 @@ const useWorkerMaintenance = ({ fetchData }: { fetchData: () => void }) => { name="remark" rules={[ { - required: true, + required: false, message: intl.formatMessage({ id: 'resources.worker.maintenance.remark.rules' }) @@ -107,8 +107,6 @@ const useWorkerMaintenance = ({ fetchData }: { fetchData: () => void }) => { ]} >