chore: advance translations
This commit is contained in:
@@ -30,6 +30,7 @@ export default {
|
|||||||
'resources.table.vender': 'Vender',
|
'resources.table.vender': 'Vender',
|
||||||
'resources.table.temperature': 'Temperature',
|
'resources.table.temperature': 'Temperature',
|
||||||
'resources.table.core': 'Core',
|
'resources.table.core': 'Core',
|
||||||
|
'resources.table.utilization': 'Utilization',
|
||||||
'resources.table.gpuutilization': 'GPU Utilization',
|
'resources.table.gpuutilization': 'GPU Utilization',
|
||||||
'resources.table.vramutilization': 'VRAM Utilization',
|
'resources.table.vramutilization': 'VRAM Utilization',
|
||||||
'resources.table.total': 'Total',
|
'resources.table.total': 'Total',
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default {
|
|||||||
'resources.table.core': '核数',
|
'resources.table.core': '核数',
|
||||||
'resources.table.gpuutilization': 'GPU 利用率',
|
'resources.table.gpuutilization': 'GPU 利用率',
|
||||||
'resources.table.vramutilization': '显存利用率',
|
'resources.table.vramutilization': '显存利用率',
|
||||||
|
'resources.table.utilization': '利用率',
|
||||||
'resources.table.total': '总量',
|
'resources.table.total': '总量',
|
||||||
'resources.table.used': '已用',
|
'resources.table.used': '已用',
|
||||||
'resources.table.wokers': 'workers',
|
'resources.table.wokers': 'workers',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { convertFileSize } from '@/utils';
|
import { convertFileSize } from '@/utils';
|
||||||
|
import { useIntl } from '@umijs/max';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import '../style/gpu-card.less';
|
import '../style/gpu-card.less';
|
||||||
@@ -6,17 +7,26 @@ import '../style/gpu-card.less';
|
|||||||
const GPUCard: React.FC<{
|
const GPUCard: React.FC<{
|
||||||
data: any;
|
data: any;
|
||||||
}> = ({ data }) => {
|
}> = ({ data }) => {
|
||||||
|
const intl = useIntl();
|
||||||
return (
|
return (
|
||||||
<div className="gpu-card">
|
<div className="gpu-card">
|
||||||
<div className="header">
|
<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>
|
||||||
<div className="info">
|
<div className="info">
|
||||||
<span>VRAM:</span>
|
<span>{intl.formatMessage({ id: 'resources.table.vram' })}:</span>
|
||||||
<span>Total {convertFileSize(data?.memory?.total || 0)}</span>
|
|
||||||
<span>Used {convertFileSize(data?.memory?.used || 0)}</span>
|
|
||||||
<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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -72,8 +72,13 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
if (action === PageAction.EDIT && open) {
|
if (action === PageAction.EDIT && open) {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
...props.data,
|
...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 {
|
} else {
|
||||||
onOk({
|
onOk({
|
||||||
..._.omit(formdata, ['scheduleType'])
|
..._.omit(formdata, ['scheduleType']),
|
||||||
|
gpu_selector: null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user