From ecebc6eede8bd81c84514ad6670bd6e4b289d3d8 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 5 Nov 2023 00:55:51 +0800 Subject: [PATCH] fix: server unit and monitor data update problem --- src/client/components/monitor/MonitorInfo.tsx | 2 +- src/client/pages/Servers.tsx | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/client/components/monitor/MonitorInfo.tsx b/src/client/components/monitor/MonitorInfo.tsx index f45034e..bff9f1c 100644 --- a/src/client/components/monitor/MonitorInfo.tsx +++ b/src/client/components/monitor/MonitorInfo.tsx @@ -200,7 +200,7 @@ export const MonitorDataMetrics: React.FC<{ ))} ); - }, [monitorType]); + }, [monitorId, monitorType]); if (isLoading) { return ; diff --git a/src/client/pages/Servers.tsx b/src/client/pages/Servers.tsx index 1aad21d..7769d70 100644 --- a/src/client/pages/Servers.tsx +++ b/src/client/pages/Servers.tsx @@ -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 ( { title: 'Run', description: (
- run reporter with{' '} - - ./tianji-reporter --url {window.location.origin} --workspace{' '} - {workspaceId} + run reporter with:{' '} + + {command}