diff --git a/packages/web/projects/vgpu/components/TabTop.vue b/packages/web/projects/vgpu/components/TabTop.vue index 2f8317f..fa9cef7 100644 --- a/packages/web/projects/vgpu/components/TabTop.vue +++ b/packages/web/projects/vgpu/components/TabTop.vue @@ -26,6 +26,7 @@ const props = defineProps({ key: String, config: Array, onClick: Function, + xName: String, }); const currentConfig = ref(props.config); const tabActive = ref(''); @@ -45,6 +46,7 @@ const getTopOptions = () => { (item) => item.key === tabActive.value, ); const data = cloneDeep(config?.data) || []; + const xName = props?.xName || (props?.title?.slice(4, 7) || '') + '(%)'; return { tooltip: { trigger: 'axis', @@ -69,16 +71,24 @@ const getTopOptions = () => { grid: { left: '3%', right: '4%', - bottom: '3%', - top: '0', + // bottom: '3%', + // top: '0', containLabel: true, }, xAxis: { type: 'value', boundaryGap: [0, 0.01], + name: xName, // 添加x轴名称 + nameLocation: 'end', // 把名字放在轴的末端 + nameTextStyle: { + verticalAlign: 'top', // 垂直方向靠上 + align: 'right', // 水平方向靠右 + padding: [30, 0, 0, 0] // 调整和轴的间距,30可根据需要调整 + } }, yAxis: { type: 'category', + name: '节点', data: data .reverse() .map((item) => diff --git a/packages/web/projects/vgpu/components/previewBar.vue b/packages/web/projects/vgpu/components/previewBar.vue index cb5bf41..0cee149 100644 --- a/packages/web/projects/vgpu/components/previewBar.vue +++ b/packages/web/projects/vgpu/components/previewBar.vue @@ -78,13 +78,13 @@ const totalTop = { data: [], query: `topk(5, sum(hami_container_vgpu_allocated{}) by (${props.type}) / sum(hami_vgpu_count{}) by (${props.type}) * 100)`, }, - { - tab: '算力', - key: 'core', - nameKey: props.type, - data: [], - query: `topk(5, sum(hami_container_vcore_allocated{}) by (${props.type}) / sum(hami_core_size{}) by (${props.type}) * 100)`, - }, + // { + // tab: '算力', + // key: 'core', + // nameKey: props.type, + // data: [], + // query: `topk(5, sum(hami_container_vcore_allocated{}) by (${props.type}) / sum(hami_core_size{}) by (${props.type}) * 100)`, + // }, { tab: '显存', key: 'memory', @@ -112,13 +112,13 @@ const usedTop = { data: [], query: `topk(5, ((sum(node_memory_MemTotal_bytes) by (instance)) - sum(node_memory_MemAvailable_bytes) by (instance)) / sum(node_memory_MemTotal_bytes) by (instance) * 100)`, }, - { - tab: '算力', - key: 'core', - nameKey: props.type, - data: [], - query: `topk(5, avg(hami_core_util_avg) by (${props.type}))`, - }, + // { + // tab: '算力', + // key: 'core', + // nameKey: props.type, + // data: [], + // query: `topk(5, avg(hami_core_util_avg) by (${props.type}))`, + // }, { tab: '显存', key: 'memory', diff --git a/packages/web/projects/vgpu/views/card/admin/Detail.vue b/packages/web/projects/vgpu/views/card/admin/Detail.vue index 3bb9877..6058126 100644 --- a/packages/web/projects/vgpu/views/card/admin/Detail.vue +++ b/packages/web/projects/vgpu/views/card/admin/Detail.vue @@ -18,7 +18,7 @@