fix(style): cluster detail locale
This commit is contained in:
@@ -143,17 +143,23 @@ const ClusterBasic: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
|||||||
<span className="value">
|
<span className="value">
|
||||||
{clusterDetail.ready_workers}/{clusterDetail.workers}
|
{clusterDetail.ready_workers}/{clusterDetail.workers}
|
||||||
</span>
|
</span>
|
||||||
<span className="label">Workers</span>
|
<span className="label">
|
||||||
|
{intl.formatMessage({ id: 'resources.nodes' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="item">
|
<div className="item">
|
||||||
<IconFont type="icon-rocket-launch-fill"></IconFont>
|
<IconFont type="icon-rocket-launch-fill"></IconFont>
|
||||||
<span className="value">{clusterDetail.models}</span>
|
<span className="value">{clusterDetail.models}</span>
|
||||||
<span className="label">Deployments</span>
|
<span className="label">
|
||||||
|
{intl.formatMessage({ id: 'clusters.table.deployments' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="item">
|
<div className="item">
|
||||||
<IconFont type="icon-gpu"></IconFont>
|
<IconFont type="icon-gpu"></IconFont>
|
||||||
<span className="value">{clusterDetail.gpus}</span>
|
<span className="value">{clusterDetail.gpus}</span>
|
||||||
<span className="label">GPUs</span>
|
<span className="label">
|
||||||
|
{intl.formatMessage({ id: 'menu.resources.gpus' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Resources>
|
</Resources>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { CardWrapper } from '@gpustack/core-ui';
|
import { CardWrapper } from '@gpustack/core-ui';
|
||||||
|
import { useIntl } from '@umijs/max';
|
||||||
import { Col, Progress, Row, Tag } from 'antd';
|
import { Col, Progress, Row, Tag } from 'antd';
|
||||||
import { round } from 'lodash';
|
import { round } from 'lodash';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
@@ -38,6 +39,7 @@ const Container = styled.div`
|
|||||||
|
|
||||||
const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
||||||
const { systemLoad, fetchClusterSystemLoad } = useClusterSystemLoad();
|
const { systemLoad, fetchClusterSystemLoad } = useClusterSystemLoad();
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (clusterId) {
|
if (clusterId) {
|
||||||
@@ -74,14 +76,15 @@ const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
console.log('systemLoad', systemLoad);
|
console.log('systemLoad', systemLoad);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={16} style={{ marginTop: 24 }}>
|
<Row gutter={16} style={{ marginTop: 24 }}>
|
||||||
<Col span={6}>
|
<Col span={6}>
|
||||||
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
||||||
<Container>
|
<Container>
|
||||||
<div className="title">
|
<div className="title">
|
||||||
<span>GPU Utilization</span>
|
<span>
|
||||||
|
{intl.formatMessage({ id: 'dashboard.gpuutilization' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="value-wrapper">
|
<div className="value-wrapper">
|
||||||
<div className="value">
|
<div className="value">
|
||||||
@@ -101,14 +104,16 @@ const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
|||||||
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
||||||
<Container>
|
<Container>
|
||||||
<div className="title">
|
<div className="title">
|
||||||
<span>VRAM Utilization</span>
|
<span>
|
||||||
|
{intl.formatMessage({ id: 'dashboard.vramutilization' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="value-wrapper">
|
<div className="value-wrapper">
|
||||||
<div className="value">{`${round(systemLoad.current.vram, 1)}%`}</div>
|
<div className="value">{`${round(systemLoad.current.vram, 1)}%`}</div>
|
||||||
<div className="chart">
|
<div className="chart">
|
||||||
{renderStepsProgress(round(systemLoad.current.vram, 1), {
|
{renderStepsProgress(round(systemLoad.current.vram, 1), {
|
||||||
color: 'purple',
|
color: 'purple',
|
||||||
text: 'VRAM'
|
text: intl.formatMessage({ id: 'dashboard.vram' })
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,7 +124,9 @@ const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
|||||||
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
||||||
<Container>
|
<Container>
|
||||||
<div className="title">
|
<div className="title">
|
||||||
<span>CPU Utilization</span>
|
<span>
|
||||||
|
{intl.formatMessage({ id: 'dashboard.cpuutilization' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="value-wrapper">
|
<div className="value-wrapper">
|
||||||
<div className="value">
|
<div className="value">
|
||||||
@@ -139,7 +146,9 @@ const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
|||||||
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
<CardWrapper style={{ padding: '16px', height: 120 }}>
|
||||||
<Container>
|
<Container>
|
||||||
<div className="title">
|
<div className="title">
|
||||||
<span>Memo Utilization</span>
|
<span>
|
||||||
|
{intl.formatMessage({ id: 'dashboard.memoryutilization' })}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="value-wrapper">
|
<div className="value-wrapper">
|
||||||
<div className="value">
|
<div className="value">
|
||||||
@@ -148,7 +157,7 @@ const ClusterSystemLoad: React.FC<{ clusterId: number }> = ({ clusterId }) => {
|
|||||||
<div className="chart">
|
<div className="chart">
|
||||||
{renderStepsProgress(round(systemLoad.current.ram, 1), {
|
{renderStepsProgress(round(systemLoad.current.ram, 1), {
|
||||||
color: 'green',
|
color: 'green',
|
||||||
text: 'RAM'
|
text: intl.formatMessage({ id: 'dashboard.memory' })
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user