diff --git a/src/locales/en-US/resources.ts b/src/locales/en-US/resources.ts index b52c2195..8c0dbecd 100644 --- a/src/locales/en-US/resources.ts +++ b/src/locales/en-US/resources.ts @@ -30,6 +30,7 @@ export default { 'resources.table.vender': 'Vender', 'resources.table.temperature': 'Temperature', 'resources.table.core': 'Core', + 'resources.table.utilization': 'Utilization', 'resources.table.gpuutilization': 'GPU Utilization', 'resources.table.vramutilization': 'VRAM Utilization', 'resources.table.total': 'Total', diff --git a/src/locales/zh-CN/resources.ts b/src/locales/zh-CN/resources.ts index bee053c8..0ad82286 100644 --- a/src/locales/zh-CN/resources.ts +++ b/src/locales/zh-CN/resources.ts @@ -32,6 +32,7 @@ export default { 'resources.table.core': '核数', 'resources.table.gpuutilization': 'GPU 利用率', 'resources.table.vramutilization': '显存利用率', + 'resources.table.utilization': '利用率', 'resources.table.total': '总量', 'resources.table.used': '已用', 'resources.table.wokers': 'workers', diff --git a/src/pages/llmodels/components/gpu-card.tsx b/src/pages/llmodels/components/gpu-card.tsx index 9f96cff7..a6cbcc4a 100644 --- a/src/pages/llmodels/components/gpu-card.tsx +++ b/src/pages/llmodels/components/gpu-card.tsx @@ -1,4 +1,5 @@ import { convertFileSize } from '@/utils'; +import { useIntl } from '@umijs/max'; import _ from 'lodash'; import React from 'react'; import '../style/gpu-card.less'; @@ -6,17 +7,26 @@ import '../style/gpu-card.less'; const GPUCard: React.FC<{ data: any; }> = ({ data }) => { + const intl = useIntl(); return (
- {data.label}({data.worker_name})[Index:{data.index}] + {data.label}({data.worker_name})[ + {intl.formatMessage({ id: 'resources.table.index' })}:{data.index}]
- VRAM: - Total {convertFileSize(data?.memory?.total || 0)} - Used {convertFileSize(data?.memory?.used || 0)} + {intl.formatMessage({ id: 'resources.table.vram' })}: - Utilization {_.round(data?.memory?.utilization_rate || 0, 2)}% + {intl.formatMessage({ id: 'resources.table.total' })}{' '} + {convertFileSize(data?.memory?.total || 0)} + + + {intl.formatMessage({ id: 'resources.table.used' })}{' '} + {convertFileSize(data?.memory?.used || 0)} + + + {intl.formatMessage({ id: 'resources.table.utilization' })}{' '} + {_.round(data?.memory?.utilization_rate || 0, 2)}%
diff --git a/src/pages/llmodels/components/update-modal.tsx b/src/pages/llmodels/components/update-modal.tsx index c655bd59..b568dea6 100644 --- a/src/pages/llmodels/components/update-modal.tsx +++ b/src/pages/llmodels/components/update-modal.tsx @@ -72,8 +72,13 @@ const UpdateModal: React.FC = (props) => { if (action === PageAction.EDIT && open) { form.setFieldsValue({ ...props.data, - scheduleType: props.data?.gpu_selector ? 'manual' : 'auto' + scheduleType: props.data?.gpu_selector ? 'manual' : 'auto', + gpu_selector: props.data?.gpu_selector + ? props.data?.gpu_selector.gpu_name + : null }); + + console.log('form.setFieldsValue', props.data, form.getFieldsValue()); } }; @@ -258,7 +263,8 @@ const UpdateModal: React.FC = (props) => { }); } else { onOk({ - ..._.omit(formdata, ['scheduleType']) + ..._.omit(formdata, ['scheduleType']), + gpu_selector: null }); } };