From 526b2c05792402563bda1ee5360e9d88327a96a2 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Wed, 16 Apr 2025 14:57:51 +0800 Subject: [PATCH] feat: enhance Vite configuration and update metrics display - Added support for JSX in Vite configuration by including the vueJsx plugin. - Simplified the metrics display in CurrentMetrics.vue to show only the percentage of used memory and disk. - Adjusted CSS in CurrentMetrics.vue to prevent wrapping and added a gap between items for better layout. - Refactored TableCell.vue to remove unused imports, optimizing the component. - Updated useNodeList.tsx to replace NodeType with ClNodeType and made minor formatting adjustments for consistency. --- .../components/core/metric/CurrentMetrics.vue | 7 +++--- .../src/components/ui/table/TableCell.vue | 2 +- .../src/views/node/list/useNodeList.tsx | 23 ++++++++----------- frontend/crawlab-ui/vite.config.ts | 4 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/frontend/crawlab-ui/src/components/core/metric/CurrentMetrics.vue b/frontend/crawlab-ui/src/components/core/metric/CurrentMetrics.vue index f7937f15..8de7b4cb 100644 --- a/frontend/crawlab-ui/src/components/core/metric/CurrentMetrics.vue +++ b/frontend/crawlab-ui/src/components/core/metric/CurrentMetrics.vue @@ -73,7 +73,7 @@ defineOptions({ name: 'ClCurrentMetrics' }); :clickable="clickable" :icon="['fa', 'memory']" :type="getTagType(metric?.used_memory_percent)" - :label="`${formatBytes(metric?.used_memory)} / ${formatBytes(metric?.total_memory)} (${Math.round(metric?.used_memory_percent || 0)}%)`" + :label="`${Math.round(metric?.used_memory_percent || 0)}%`" @click="(event: MouseEvent) => emit('click', event)" >