chore: workers list api
This commit is contained in:
@@ -206,7 +206,8 @@ export default (props: any) => {
|
|||||||
runtimeConfig,
|
runtimeConfig,
|
||||||
loading,
|
loading,
|
||||||
initialState,
|
initialState,
|
||||||
setInitialState
|
setInitialState,
|
||||||
|
intl
|
||||||
});
|
});
|
||||||
if (runtimeConfig.rightContentRender) {
|
if (runtimeConfig.rightContentRender) {
|
||||||
return runtimeConfig.rightContentRender(layoutProps, dom, {
|
return runtimeConfig.rightContentRender(layoutProps, dom, {
|
||||||
@@ -215,7 +216,8 @@ export default (props: any) => {
|
|||||||
runtimeConfig,
|
runtimeConfig,
|
||||||
loading,
|
loading,
|
||||||
initialState,
|
initialState,
|
||||||
setInitialState
|
setInitialState,
|
||||||
|
intl
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return dom;
|
return dom;
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export function getRightRenderContent(opts: {
|
|||||||
loading: boolean;
|
loading: boolean;
|
||||||
initialState: any;
|
initialState: any;
|
||||||
setInitialState: any;
|
setInitialState: any;
|
||||||
|
intl: any;
|
||||||
}) {
|
}) {
|
||||||
console.log('runtimeConfig==', opts.runtimeConfig, opts);
|
const { intl } = opts;
|
||||||
// const intl = useIntl();
|
|
||||||
if (opts.runtimeConfig.rightRender) {
|
if (opts.runtimeConfig.rightRender) {
|
||||||
return opts.runtimeConfig.rightRender(
|
return opts.runtimeConfig.rightRender(
|
||||||
opts.initialState,
|
opts.initialState,
|
||||||
@@ -66,8 +66,7 @@ export function getRightRenderContent(opts: {
|
|||||||
<span style={{ fontSize: '12px' }}>
|
<span style={{ fontSize: '12px' }}>
|
||||||
<GlobalOutlined />
|
<GlobalOutlined />
|
||||||
<span className="m-l-8">
|
<span className="m-l-8">
|
||||||
{/* {FormattedMessage({ id: 'common.settings.language' })} */}
|
{intl?.formatMessage?.({ id: 'common.settings.language' })}
|
||||||
Language
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@@ -87,8 +86,7 @@ export function getRightRenderContent(opts: {
|
|||||||
label: (
|
label: (
|
||||||
<>
|
<>
|
||||||
<SettingOutlined />
|
<SettingOutlined />
|
||||||
{/* {intl.formatMessage({ id: 'common.button.settings' })} */}
|
{intl?.formatMessage?.({ id: 'common.button.settings' })}
|
||||||
Settings
|
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -112,8 +110,7 @@ export function getRightRenderContent(opts: {
|
|||||||
label: (
|
label: (
|
||||||
<>
|
<>
|
||||||
<LogoutOutlined />
|
<LogoutOutlined />
|
||||||
{/* {intl.formatMessage({ id: 'common.button.logout' })} */}
|
{intl?.formatMessage?.({ id: 'common.button.logout' })}
|
||||||
Logout
|
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
|
|||||||
+48
-9
@@ -174,14 +174,30 @@ const Models: React.FC = () => {
|
|||||||
key="GPU"
|
key="GPU"
|
||||||
render={(text, record: ListItem) => {
|
render={(text, record: ListItem) => {
|
||||||
return (
|
return (
|
||||||
<ProgressBar
|
<Space>
|
||||||
percent={_.get(record, [
|
{record?.status?.gpu.map((item) => {
|
||||||
'status',
|
return (
|
||||||
'gpu',
|
<span key={item.index} className="flex-center">
|
||||||
'0',
|
<span
|
||||||
'core_utilization_rate'
|
style={{
|
||||||
])}
|
display: 'flex',
|
||||||
></ProgressBar>
|
width: '6px',
|
||||||
|
height: '6px',
|
||||||
|
borderRadius: '50%',
|
||||||
|
backgroundColor: 'var(--ant-color-primary)'
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
|
<span className="m-l-5">
|
||||||
|
{' '}
|
||||||
|
{`${item.core.total}C`} /{' '}
|
||||||
|
{item.core.utilization_rate
|
||||||
|
? `${item.core.utilization_rate}%`
|
||||||
|
: 0}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Space>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -198,7 +214,30 @@ const Models: React.FC = () => {
|
|||||||
dataIndex="VRAM"
|
dataIndex="VRAM"
|
||||||
key="VRAM"
|
key="VRAM"
|
||||||
render={(text, record: ListItem) => {
|
render={(text, record: ListItem) => {
|
||||||
return <ProgressBar percent={0}></ProgressBar>;
|
return (
|
||||||
|
<Space>
|
||||||
|
{record?.status?.gpu.map((item) => {
|
||||||
|
return (
|
||||||
|
<span key={item.index} className="flex-center">
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
width: '6px',
|
||||||
|
height: '6px',
|
||||||
|
borderRadius: '50%',
|
||||||
|
backgroundColor: 'var(--ant-color-primary)'
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
|
<span className="m-l-5">
|
||||||
|
{item.memory.allocated
|
||||||
|
? `${formateUtilazation(item.memory.allocated, item.memory.total)}%`
|
||||||
|
: 0}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Table>
|
</Table>
|
||||||
@@ -3,12 +3,17 @@ export interface Gpu {
|
|||||||
name: string;
|
name: string;
|
||||||
vendor: string;
|
vendor: string;
|
||||||
index: number;
|
index: number;
|
||||||
core_total: number;
|
core: {
|
||||||
core_allocated: number;
|
total: number;
|
||||||
core_utilization_rate: number;
|
allocated: number;
|
||||||
memory_total: number;
|
utilization_rate: number;
|
||||||
memory_allocated: number;
|
};
|
||||||
memory_used: number;
|
memory: {
|
||||||
|
total: number;
|
||||||
|
allocated: number;
|
||||||
|
used: number;
|
||||||
|
utilization_rate: number;
|
||||||
|
};
|
||||||
temperature: number;
|
temperature: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ import type { TabsProps } from 'antd';
|
|||||||
import { Tabs } from 'antd';
|
import { Tabs } from 'antd';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import GPUs from './components/gpus';
|
import GPUs from './components/gpus';
|
||||||
import Nodes from './components/nodes';
|
import Workers from './components/workers';
|
||||||
|
|
||||||
const items: TabsProps['items'] = [
|
const items: TabsProps['items'] = [
|
||||||
{
|
{
|
||||||
key: 'workers',
|
key: 'workers',
|
||||||
label: 'Workers',
|
label: 'Workers',
|
||||||
children: <Nodes />
|
children: <Workers />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'gpus',
|
key: 'gpus',
|
||||||
|
|||||||
Reference in New Issue
Block a user