Skip to content

Commit

Permalink
chore: dashboard update field name
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Sep 9, 2024
1 parent dff8a0f commit ea2844e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions src/pages/dashboard/components/active-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<span>
{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)}
</span>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/dashboard/components/resource-utilization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TypeKeyMap = {
intl: false,
color: 'rgba(250, 173, 20,.8)'
},
memory: {
ram: {
label: 'dashboard.memory',
type: 'Memory',
intl: true,
Expand All @@ -29,7 +29,7 @@ const TypeKeyMap = {
intl: false,
color: 'rgba(84, 204, 152,.8)'
},
gpu_memory: {
vram: {
label: 'dashboard.vram',
type: 'VRAM',
intl: true,
Expand Down Expand Up @@ -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}%`;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/dashboard/components/system-load.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
></GaugeChart>
</Col>
<Col span={12} style={{ height: smallChartHeight }}>
Expand All @@ -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)}
></GaugeChart>
</Col>
</Row>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/dashboard/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ 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;
}[];
gpu: {
timestamp: number;
value: number;
}[];
gpu_memory: {
vram: {
timestamp: number;
value: number;
}[];
Expand Down
6 changes: 3 additions & 3 deletions src/pages/usage/components/active-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<span>
{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)}
</span>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/usage/components/resource-utilization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TypeKeyMap = {
intl: false,
color: 'rgba(250, 173, 20,.8)'
},
memory: {
ram: {
label: 'dashboard.memory',
type: 'Memory',
intl: true,
Expand All @@ -29,7 +29,7 @@ const TypeKeyMap = {
intl: false,
color: 'rgba(84, 204, 152,.8)'
},
gpu_memory: {
vram: {
label: 'dashboard.vram',
type: 'VRAM',
intl: true,
Expand Down Expand Up @@ -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}%`;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/usage/components/system-load.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
></GaugeChart>
</Col>
<Col span={12} style={{ height: smallChartHeight }}>
Expand All @@ -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)}
></GaugeChart>
</Col>
</Row>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/usage/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ 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;
}[];
gpu: {
timestamp: number;
value: number;
}[];
gpu_memory: {
vram: {
timestamp: number;
value: number;
}[];
Expand Down

0 comments on commit ea2844e

Please sign in to comment.