chore: advance translations
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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 (
|
||||
<div className="gpu-card">
|
||||
<div className="header">
|
||||
{data.label}({data.worker_name})[Index:{data.index}]
|
||||
{data.label}({data.worker_name})[
|
||||
{intl.formatMessage({ id: 'resources.table.index' })}:{data.index}]
|
||||
</div>
|
||||
<div className="info">
|
||||
<span>VRAM:</span>
|
||||
<span>Total {convertFileSize(data?.memory?.total || 0)}</span>
|
||||
<span>Used {convertFileSize(data?.memory?.used || 0)}</span>
|
||||
<span>{intl.formatMessage({ id: 'resources.table.vram' })}:</span>
|
||||
<span>
|
||||
Utilization {_.round(data?.memory?.utilization_rate || 0, 2)}%
|
||||
{intl.formatMessage({ id: 'resources.table.total' })}{' '}
|
||||
{convertFileSize(data?.memory?.total || 0)}
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage({ id: 'resources.table.used' })}{' '}
|
||||
{convertFileSize(data?.memory?.used || 0)}
|
||||
</span>
|
||||
<span>
|
||||
{intl.formatMessage({ id: 'resources.table.utilization' })}{' '}
|
||||
{_.round(data?.memory?.utilization_rate || 0, 2)}%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -72,8 +72,13 @@ const UpdateModal: React.FC<AddModalProps> = (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<AddModalProps> = (props) => {
|
||||
});
|
||||
} else {
|
||||
onOk({
|
||||
..._.omit(formdata, ['scheduleType'])
|
||||
..._.omit(formdata, ['scheduleType']),
|
||||
gpu_selector: null
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user