chore: update worker locale
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import jdenticon from 'jdenticon';
|
||||
import { update } from 'jdenticon';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
|
||||
interface IdenticonProps {
|
||||
@@ -13,7 +13,7 @@ const Identicon: React.FC<IdenticonProps> = ({
|
||||
const icon = useRef<any>(null);
|
||||
|
||||
useEffect(() => {
|
||||
jdenticon?.update(icon.current, 'value');
|
||||
update(icon.current, value);
|
||||
}, [value]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -107,7 +107,19 @@ export const getGpuColor = (gpuType: string) => {
|
||||
return 'default';
|
||||
};
|
||||
|
||||
export const customIcons = ['∑', '∏', '∫', '∂', '∞', 'θ', '∆', '∇'];
|
||||
export const customIcons = [
|
||||
'∑',
|
||||
'∏',
|
||||
'∫',
|
||||
'∂',
|
||||
'∞',
|
||||
'π',
|
||||
'θ',
|
||||
'∆',
|
||||
'∇',
|
||||
'≤',
|
||||
'≥'
|
||||
];
|
||||
|
||||
export const backendFields = [
|
||||
'description',
|
||||
|
||||
@@ -35,6 +35,16 @@ export default [
|
||||
}),
|
||||
group: 'clusters.create.provider.cloud'
|
||||
},
|
||||
{
|
||||
label: 'AWS',
|
||||
locale: false,
|
||||
disabled: true,
|
||||
value: ProviderValueMap.AWS,
|
||||
key: ProviderValueMap.AWS,
|
||||
icon: icons.AWS,
|
||||
description: 'cluster.provider.comingsoon',
|
||||
group: 'clusters.create.provider.cloud'
|
||||
},
|
||||
{
|
||||
label: 'Alibaba Cloud',
|
||||
locale: false,
|
||||
@@ -54,15 +64,5 @@ export default [
|
||||
icon: icons.TencentCloud,
|
||||
description: 'cluster.provider.comingsoon',
|
||||
group: 'clusters.create.provider.cloud'
|
||||
},
|
||||
{
|
||||
label: 'AWS',
|
||||
locale: false,
|
||||
disabled: true,
|
||||
value: ProviderValueMap.AWS,
|
||||
key: ProviderValueMap.AWS,
|
||||
icon: icons.AWS,
|
||||
description: 'cluster.provider.comingsoon',
|
||||
group: 'clusters.create.provider.cloud'
|
||||
}
|
||||
];
|
||||
|
||||
@@ -67,7 +67,7 @@ const useClusterColumns = (
|
||||
render: (value: number) => <span>{value}</span>
|
||||
},
|
||||
{
|
||||
title: 'Workers',
|
||||
title: intl.formatMessage({ id: 'resources.nodes' }),
|
||||
dataIndex: 'workers',
|
||||
span: 3,
|
||||
render: (value: number, record: ClusterListItem) => (
|
||||
|
||||
@@ -122,7 +122,7 @@ const usePoolsColumns = (
|
||||
)
|
||||
},
|
||||
{
|
||||
title: 'Workers',
|
||||
title: intl.formatMessage({ id: 'resources.nodes' }),
|
||||
dataIndex: 'replicas',
|
||||
span: 6,
|
||||
key: 'replicas',
|
||||
|
||||
@@ -118,7 +118,7 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: getRuleMessage('select', 'worker', false)
|
||||
message: getRuleMessage('select', 'resources.worker')
|
||||
}
|
||||
]}
|
||||
>
|
||||
@@ -133,7 +133,7 @@ const TargetForm: React.FC<TargetFormProps> = forwardRef((props, ref) => {
|
||||
}
|
||||
}}
|
||||
maxTagCount={1}
|
||||
label="Worker"
|
||||
label={intl.formatMessage({ id: 'resources.worker' })}
|
||||
options={workerOptions}
|
||||
showCheckedStrategy="SHOW_CHILD"
|
||||
getPopupContainer={(triggerNode) => triggerNode.parentNode}
|
||||
|
||||
@@ -40,7 +40,7 @@ const Workers: React.FC = () => {
|
||||
} = useTableFetch<ListItem>({
|
||||
fetchAPI: queryWorkersList,
|
||||
deleteAPI: deleteWorker,
|
||||
contentForDelete: 'worker',
|
||||
contentForDelete: 'resources.worker',
|
||||
watch: true,
|
||||
API: WORKERS_API
|
||||
});
|
||||
@@ -240,7 +240,7 @@ const Workers: React.FC = () => {
|
||||
/>
|
||||
]}
|
||||
header={{
|
||||
title: 'Workers',
|
||||
title: intl.formatMessage({ id: 'resources.nodes' }),
|
||||
style: {
|
||||
paddingInline: 'var(--layout-content-header-inlinepadding)'
|
||||
},
|
||||
|
||||
@@ -286,7 +286,7 @@ const useFilesColumns = (props: {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Worker',
|
||||
title: intl.formatMessage({ id: 'resources.worker' }),
|
||||
dataIndex: 'worker_name',
|
||||
ellipsis: {
|
||||
showTitle: false
|
||||
|
||||
@@ -73,7 +73,7 @@ const useGPUColumns = (props: {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: 'Worker',
|
||||
title: intl.formatMessage({ id: 'resources.worker' }),
|
||||
dataIndex: 'worker_name',
|
||||
ellipsis: {
|
||||
showTitle: false
|
||||
|
||||
@@ -60,7 +60,8 @@ const renderGpuIndexs = (gpuIndexes: number[]) => {
|
||||
|
||||
const distributeCols: ColumnProps[] = [
|
||||
{
|
||||
title: 'Worker',
|
||||
title: 'resources.worker',
|
||||
locale: true,
|
||||
key: 'worker_name',
|
||||
style: {
|
||||
wordBreak: 'break-word'
|
||||
@@ -310,7 +311,7 @@ const useInstanceColumns = (props: {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: 'Worker',
|
||||
title: intl.formatMessage({ id: 'resources.worker' }),
|
||||
dataIndex: 'worker_name',
|
||||
render: (text: string, record: ListItem) => (
|
||||
<AutoTooltip ghost>{text}</AutoTooltip>
|
||||
|
||||
@@ -29,7 +29,7 @@ const Resources = () => {
|
||||
const items: TabsProps['items'] = [
|
||||
{
|
||||
key: 'workers',
|
||||
label: 'Workers',
|
||||
label: 'resources.nodes',
|
||||
children: <Workers />
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user