From ea2844ea7fb94ca2d7c7cd50c05bd3db31019808 Mon Sep 17 00:00:00 2001 From: jialin Date: Mon, 9 Sep 2024 18:57:50 +0800 Subject: [PATCH] chore: dashboard update field name --- src/pages/dashboard/components/active-table.tsx | 6 +++--- src/pages/dashboard/components/resource-utilization.tsx | 6 +++--- src/pages/dashboard/components/system-load.tsx | 8 ++++---- src/pages/dashboard/config/types.ts | 8 ++++---- src/pages/usage/components/active-table.tsx | 6 +++--- src/pages/usage/components/resource-utilization.tsx | 6 +++--- src/pages/usage/components/system-load.tsx | 8 ++++---- src/pages/usage/config/types.ts | 8 ++++---- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/pages/dashboard/components/active-table.tsx b/src/pages/dashboard/components/active-table.tsx index e422a24e..0569cdb1 100644 --- a/src/pages/dashboard/components/active-table.tsx +++ b/src/pages/dashboard/components/active-table.tsx @@ -87,12 +87,12 @@ const ActiveTable = () => { { title: intl.formatMessage({ id: 'dashboard.allocatevram' }), dataIndex: 'resource_claim.memory', - key: 'gpu_memory', + key: 'vram', render: (text: any, record: any) => { return ( - {convertFileSize(record.resource_claim?.gpu_memory || 0)} /{' '} - {convertFileSize(record.resource_claim?.memory || 0)} + {convertFileSize(record.resource_claim?.vram || 0)} /{' '} + {convertFileSize(record.resource_claim?.ram || 0)} ); } diff --git a/src/pages/dashboard/components/resource-utilization.tsx b/src/pages/dashboard/components/resource-utilization.tsx index 0e0af920..e250c979 100644 --- a/src/pages/dashboard/components/resource-utilization.tsx +++ b/src/pages/dashboard/components/resource-utilization.tsx @@ -17,7 +17,7 @@ const TypeKeyMap = { intl: false, color: 'rgba(250, 173, 20,.8)' }, - memory: { + ram: { label: 'dashboard.memory', type: 'Memory', intl: true, @@ -29,7 +29,7 @@ const TypeKeyMap = { intl: false, color: 'rgba(84, 204, 152,.8)' }, - gpu_memory: { + vram: { label: 'dashboard.vram', type: 'VRAM', intl: true, @@ -114,7 +114,7 @@ const UtilizationOvertime: React.FC = () => { const intl = useIntl(); const data = useContext(DashboardContext)?.system_load?.history || {}; - const typeList = ['gpu', 'cpu', 'memory', 'gpu_memory']; + const typeList = ['gpu', 'cpu', 'ram', 'vram']; const tooltipValueFormatter = (value: any) => { return !value ? value : `${value}%`; diff --git a/src/pages/dashboard/components/system-load.tsx b/src/pages/dashboard/components/system-load.tsx index cd9e55d7..0c7e1e20 100644 --- a/src/pages/dashboard/components/system-load.tsx +++ b/src/pages/dashboard/components/system-load.tsx @@ -83,8 +83,8 @@ const SystemLoad = () => { id: 'dashboard.vramutilization' })} height={smallChartHeight} - color={strokeColorFunc(data.gpu_memory)} - value={_.round(data.gpu_memory || 0, 1)} + color={strokeColorFunc(data.vram)} + value={_.round(data.vram || 0, 1)} > @@ -103,8 +103,8 @@ const SystemLoad = () => { id: 'dashboard.memoryutilization' })} height={smallChartHeight} - color={strokeColorFunc(data.memory)} - value={_.round(data.memory || 0, 1)} + color={strokeColorFunc(data.ram)} + value={_.round(data.ram || 0, 1)} > diff --git a/src/pages/dashboard/config/types.ts b/src/pages/dashboard/config/types.ts index fc83bc84..bfe5030e 100644 --- a/src/pages/dashboard/config/types.ts +++ b/src/pages/dashboard/config/types.ts @@ -8,16 +8,16 @@ export interface DashboardProps { system_load: { current: { cpu: number; - memory: number; + ram: number; gpu: number; - gpu_memory: number; + vram: number; }; history: { cpu: { timestamp: number; value: number; }[]; - memory: { + ram: { timestamp: number; value: number; }[]; @@ -25,7 +25,7 @@ export interface DashboardProps { timestamp: number; value: number; }[]; - gpu_memory: { + vram: { timestamp: number; value: number; }[]; diff --git a/src/pages/usage/components/active-table.tsx b/src/pages/usage/components/active-table.tsx index e422a24e..0569cdb1 100644 --- a/src/pages/usage/components/active-table.tsx +++ b/src/pages/usage/components/active-table.tsx @@ -87,12 +87,12 @@ const ActiveTable = () => { { title: intl.formatMessage({ id: 'dashboard.allocatevram' }), dataIndex: 'resource_claim.memory', - key: 'gpu_memory', + key: 'vram', render: (text: any, record: any) => { return ( - {convertFileSize(record.resource_claim?.gpu_memory || 0)} /{' '} - {convertFileSize(record.resource_claim?.memory || 0)} + {convertFileSize(record.resource_claim?.vram || 0)} /{' '} + {convertFileSize(record.resource_claim?.ram || 0)} ); } diff --git a/src/pages/usage/components/resource-utilization.tsx b/src/pages/usage/components/resource-utilization.tsx index 0e0af920..e250c979 100644 --- a/src/pages/usage/components/resource-utilization.tsx +++ b/src/pages/usage/components/resource-utilization.tsx @@ -17,7 +17,7 @@ const TypeKeyMap = { intl: false, color: 'rgba(250, 173, 20,.8)' }, - memory: { + ram: { label: 'dashboard.memory', type: 'Memory', intl: true, @@ -29,7 +29,7 @@ const TypeKeyMap = { intl: false, color: 'rgba(84, 204, 152,.8)' }, - gpu_memory: { + vram: { label: 'dashboard.vram', type: 'VRAM', intl: true, @@ -114,7 +114,7 @@ const UtilizationOvertime: React.FC = () => { const intl = useIntl(); const data = useContext(DashboardContext)?.system_load?.history || {}; - const typeList = ['gpu', 'cpu', 'memory', 'gpu_memory']; + const typeList = ['gpu', 'cpu', 'ram', 'vram']; const tooltipValueFormatter = (value: any) => { return !value ? value : `${value}%`; diff --git a/src/pages/usage/components/system-load.tsx b/src/pages/usage/components/system-load.tsx index cd9e55d7..0c7e1e20 100644 --- a/src/pages/usage/components/system-load.tsx +++ b/src/pages/usage/components/system-load.tsx @@ -83,8 +83,8 @@ const SystemLoad = () => { id: 'dashboard.vramutilization' })} height={smallChartHeight} - color={strokeColorFunc(data.gpu_memory)} - value={_.round(data.gpu_memory || 0, 1)} + color={strokeColorFunc(data.vram)} + value={_.round(data.vram || 0, 1)} > @@ -103,8 +103,8 @@ const SystemLoad = () => { id: 'dashboard.memoryutilization' })} height={smallChartHeight} - color={strokeColorFunc(data.memory)} - value={_.round(data.memory || 0, 1)} + color={strokeColorFunc(data.ram)} + value={_.round(data.ram || 0, 1)} > diff --git a/src/pages/usage/config/types.ts b/src/pages/usage/config/types.ts index fc83bc84..bfe5030e 100644 --- a/src/pages/usage/config/types.ts +++ b/src/pages/usage/config/types.ts @@ -8,16 +8,16 @@ export interface DashboardProps { system_load: { current: { cpu: number; - memory: number; + ram: number; gpu: number; - gpu_memory: number; + vram: number; }; history: { cpu: { timestamp: number; value: number; }[]; - memory: { + ram: { timestamp: number; value: number; }[]; @@ -25,7 +25,7 @@ export interface DashboardProps { timestamp: number; value: number; }[]; - gpu_memory: { + vram: { timestamp: number; value: number; }[];