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) { if (isLoading) {
return <Loading />; return <Loading />;

View File

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