修改缺陷

main
陈博文 5 days ago
parent f35270865c
commit 1df1771e97

@ -1,12 +1,12 @@
<template> <template>
<div class="home"> <div class="home">
<div class="home-left"> <div class="home-left">
<Block title="显卡资源"> <Block title="资源使用率">
<template #extra> <!-- <template #extra>
<div class="all-btn" @click="sendRouteChange('/admin/vgpu/card/admin')"> <div class="all-btn" @click="sendRouteChange('/admin/vgpu/card/admin')">
全部<svg-icon icon="more" style="margin-left: 4px" /> 全部<svg-icon icon="more" style="margin-left: 4px" />
</div> </div>
</template> </template> -->
<div class="card-overview"> <div class="card-overview">
<div v-for="item in cardGaugeConfig.slice(0, 5)" :key="item.title"> <div v-for="item in cardGaugeConfig.slice(0, 5)" :key="item.title">
<Gauge v-bind="item" /> <Gauge v-bind="item" />
@ -19,11 +19,11 @@
</div> </div>
</Block> </Block>
<Block title="资源总览"> <Block title="资源总览">
<template #extra> <!-- <template #extra>
<div class="all-btn" @click="sendRouteChange('/admin/vgpu/card/admin')"> <div class="all-btn" @click="sendRouteChange('/admin/vgpu/card/admin')">
全部<svg-icon icon="more" style="margin-left: 4px" /> 全部<svg-icon icon="more" style="margin-left: 4px" />
</div> </div>
</template> </template> -->
<ul class="resourceOverview"> <ul class="resourceOverview">
<li v-for="{ title, count, icon, to, unit } in resourceOverview" :key="title" <li v-for="{ title, count, icon, to, unit } in resourceOverview" :key="title"
:style="{ cursor: to ? 'pointer' : 'default' }" @click="sendRouteChange(to)"> :style="{ cursor: to ? 'pointer' : 'default' }" @click="sendRouteChange(to)">
@ -156,7 +156,7 @@ const cardGaugeConfig = useInstantVector([
title: '磁盘 使用率', title: '磁盘 使用率',
percent: 0, percent: 0,
query: `(sum(node_filesystem_size_bytes{fstype!~"tmpfs|overlay"})-sum(node_filesystem_free_bytes{fstype!~"tmpfs|overlay"})) / 1024 / 1024 / 1024`, query: `(sum(node_filesystem_size_bytes{fstype!~"tmpfs|overlay"})-sum(node_filesystem_free_bytes{fstype!~"tmpfs|overlay"})) / 1024 / 1024 / 1024`,
totalQuery: `avg(node_filesystem_size_bytes{fstype!~"tmpfs|overlay"}) / 1024 / 1024 / 1024`, totalQuery: `sum(node_filesystem_size_bytes{fstype!~"tmpfs|overlay"}) / 1024 / 1024 / 1024`,
percentQuery: ``, percentQuery: ``,
total: 0, total: 0,
used: 0, used: 0,

@ -46,7 +46,7 @@
:title="editId ? '编辑资源池' : '创建资源池'" width="1180" :before-close="handleClose"> :title="editId ? '编辑资源池' : '创建资源池'" width="1180" :before-close="handleClose">
<el-row :wrap="false" style="align-items: center;"> <el-row :wrap="false" style="align-items: center;">
<span style="flex-shrink: 0; margin-right: 14px;">资源池名称</span> <span style="flex-shrink: 0; margin-right: 14px;">资源池名称</span>
<el-input style="flex: 1;" v-model="input" size="large" /> <el-input style="flex: 1;" v-model="input" size="large" maxlength="20" />
</el-row> </el-row>
<div style="margin-top: 20px; margin-bottom: 10px;"> <div style="margin-top: 20px; margin-bottom: 10px;">
<span>选择节点</span> <span>选择节点</span>

@ -13,7 +13,7 @@
<script setup lang="jsx"> <script setup lang="jsx">
import taskApi from '~/vgpu/api/task'; import taskApi from '~/vgpu/api/task';
import { calculateDuration, roundToDecimal, timeParse } from '@/utils'; import { calculateDuration, roundToDecimal, timeParse, bytesToGB } from '@/utils';
import { QuestionFilled } from '@element-plus/icons-vue'; import { QuestionFilled } from '@element-plus/icons-vue';
import api from '~/vgpu/api/task'; import api from '~/vgpu/api/task';
import { ElMessage, ElMessageBox, ElPopover } from 'element-plus'; import { ElMessage, ElMessageBox, ElPopover } from 'element-plus';
@ -126,6 +126,16 @@ const columns = [
title: '所属节点', title: '所属节点',
dataIndex: 'nodeName', dataIndex: 'nodeName',
}, },
{
title: 'CPU',
dataIndex: 'requestedCpuCores',
render: ({ requestedCpuCores }) => `${requestedCpuCores}`,
},
{
title: '内存',
dataIndex: 'requestedMemory',
render: ({ requestedMemory }) => `${bytesToGB(requestedMemory)}GiB`,
},
{ {
title: '分配 vGPU', title: '分配 vGPU',
dataIndex: 'deviceIds', dataIndex: 'deviceIds',

Loading…
Cancel
Save