fix: server unit and monitor data update problem

This commit is contained in:
moonrailgun 2023-11-05 00:55:51 +08:00
parent 4bf54c59b0
commit ecebc6eede
2 changed files with 9 additions and 8 deletions

View File

@ -200,7 +200,7 @@ export const MonitorDataMetrics: React.FC<{
))}
</>
);
}, [monitorType]);
}, [monitorId, monitorType]);
if (isLoading) {
return <Loading />;

View File

@ -192,9 +192,9 @@ export const ServerList: React.FC<{
key: 'hdd',
title: 'hdd',
render: (_, record) => {
return `${filesize(record.payload.hdd_used * 1000)} / ${filesize(
record.payload.hdd_total * 1000
)}`;
return `${filesize(
record.payload.hdd_used * 1000 * 1000
)} / ${filesize(record.payload.hdd_total * 1000 * 1000)}`;
},
},
];
@ -240,6 +240,8 @@ export const AddServerStep: React.FC = React.memo(() => {
}
});
const command = `./tianji-reporter --url ${window.location.origin} --workspace ${workspaceId}`;
return (
<Steps
direction="vertical"
@ -269,10 +271,9 @@ export const AddServerStep: React.FC = React.memo(() => {
title: 'Run',
description: (
<div>
run reporter with{' '}
<Typography.Text code={true} copyable={true}>
./tianji-reporter --url {window.location.origin} --workspace{' '}
{workspaceId}
run reporter with:{' '}
<Typography.Text code={true} copyable={{ text: command }}>
{command}
</Typography.Text>
<Button
type="link"