提交 29ac51a1 编写于 作者: P ph

fix hardware issue: 1. Hard to distinguish between specific states for health...

fix hardware issue: 1. Hard to distinguish between specific states for health and available;2.Cannot uncheck after selecting a single cpu at U;3.its better not display ascend usage in hardware resource for gpu env
上级 46099e82
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
"chipNameTip": "芯片名称", "chipNameTip": "芯片名称",
"deviceIdTip": "芯片号", "deviceIdTip": "芯片号",
"availableTip": "芯片是否空闲(仅供参考)", "availableTip": "芯片是否空闲(仅供参考)",
"healthTip": "芯片健康指数(正常、一般警告、重要警告、紧急警告)", "healthTip": "芯片健康指数",
"ipTip": "芯片IP地址", "ipTip": "芯片IP地址",
"aicoreTip": "芯片利用率", "aicoreTip": "芯片利用率",
"hbmTip": "芯片已用HBM内存", "hbmTip": "芯片已用HBM内存",
...@@ -414,7 +414,16 @@ ...@@ -414,7 +414,16 @@
"cpuGuestniceTip": "运行低优先级虚拟机的时间百分比", "cpuGuestniceTip": "运行低优先级虚拟机的时间百分比",
"cpuInterruptTip": "处理硬中断的时间百分比", "cpuInterruptTip": "处理硬中断的时间百分比",
"cpuDpcTip": "远程调用的时间百分比", "cpuDpcTip": "远程调用的时间百分比",
"noNpuInfo":"暂无昇腾AI处理器信息" "noNpuInfo": "暂无昇腾AI处理器信息",
"normal": "正常",
"generalWarn": "一般警告",
"importantWarn": "重要警告",
"emergencyWarn": "紧急警告",
"noChip": "芯片不存在或未启动",
"availableFree": "芯片空闲",
"availableBusy": "芯片已被占用或不可用(仅供参考)",
"failQueryChip": "芯片信息查询有误",
"faliQuery": "查询有误"
}, },
"components": { "components": {
"summaryTitle": "训练选择", "summaryTitle": "训练选择",
...@@ -452,6 +461,7 @@ ...@@ -452,6 +461,7 @@
"50542218": "筛选参数错误", "50542218": "筛选参数错误",
"50545012": "张量数据不存在,请刷新。", "50545012": "张量数据不存在,请刷新。",
"50545013": "请求的数据过大,请使用其他维度重试。", "50545013": "请求的数据过大,请使用其他维度重试。",
"50545014": "查询的张量数据已被新数据替换,请刷新。" "50545014": "查询的张量数据已被新数据替换,请刷新。",
"50548001": "昇腾AI处理器信息查询超时"
} }
} }
...@@ -292,9 +292,6 @@ export default { ...@@ -292,9 +292,6 @@ export default {
return axios({ return axios({
method: 'get', method: 'get',
url: 'v1/mindinsight/sysmetric/current', url: 'v1/mindinsight/sysmetric/current',
headers: {
ignoreError: true,
},
}); });
}, },
}; };
...@@ -18,7 +18,8 @@ limitations under the License. ...@@ -18,7 +18,8 @@ limitations under the License.
<div class="cl-hardware-visual"> <div class="cl-hardware-visual">
<div class="cl-hardware-content" <div class="cl-hardware-content"
v-if="!(chipTableData.length === 0 && cpuList.length===0)"> v-if="!(chipTableData.length === 0 && cpuList.length===0)">
<div class="cl-hardware-top"> <div class="cl-hardware-top"
v-if="chipTableData.length">
<div class="cl-hardware-left"> <div class="cl-hardware-left">
<div class="cl-sub-title" <div class="cl-sub-title"
v-if="chipTableData.length"> v-if="chipTableData.length">
...@@ -28,7 +29,8 @@ limitations under the License. ...@@ -28,7 +29,8 @@ limitations under the License.
<el-table v-if="chipTableData.length" <el-table v-if="chipTableData.length"
:data="chipTableData" :data="chipTableData"
width="100%" width="100%"
height="100%"> height="100%"
:row-class-name="tableRowClassName">
<el-table-column width="120"> <el-table-column width="120">
<template slot="header"> <template slot="header">
<span class="cl-text-center"> <span class="cl-text-center">
...@@ -76,8 +78,10 @@ limitations under the License. ...@@ -76,8 +78,10 @@ limitations under the License.
<template slot-scope="scope"> <template slot-scope="scope">
<span class="cl-text-center"> <span class="cl-text-center">
<i class="el-icon-success" <i class="el-icon-success"
v-if="scope.row.available"></i> v-if="scope.row.available"
:title="$t('hardwareVisual.availableFree')"></i>
<i class="el-icon-question" <i class="el-icon-question"
:title="$t('hardwareVisual.availableBusy')"
v-else></i> v-else></i>
</span> </span>
</template> </template>
...@@ -97,15 +101,20 @@ limitations under the License. ...@@ -97,15 +101,20 @@ limitations under the License.
<template slot-scope="scope"> <template slot-scope="scope">
<span class="cl-text-center"> <span class="cl-text-center">
<i class="el-icon-success" <i class="el-icon-success"
v-if="scope.row.health===0"></i> v-if="scope.row.health===0"
:title="$t('hardwareVisual.normal')"></i>
<i class="el-icon-warning normal" <i class="el-icon-warning normal"
v-if="scope.row.health===1"></i> v-if="scope.row.health===1"
:title="$t('hardwareVisual.generalWarn')"></i>
<i class="el-icon-warning important" <i class="el-icon-warning important"
v-if="scope.row.health===2"></i> v-if="scope.row.health===2"
:title="$t('hardwareVisual.importantWarn')"></i>
<i class="el-icon-warning emergency" <i class="el-icon-warning emergency"
v-if="scope.row.health===3"></i> v-if="scope.row.health===3"
:title="$t('hardwareVisual.emergencyWarn')"></i>
<i class="el-icon-remove" <i class="el-icon-remove"
v-if="scope.row.health=== 0xffffffff"></i> v-if="scope.row.health=== 0xffffffff"
:title="$t('hardwareVisual.noChip')"></i>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -136,8 +145,10 @@ limitations under the License. ...@@ -136,8 +145,10 @@ limitations under the License.
</el-tooltip> </el-tooltip>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-progress :percentage="scope.row.aicore_rate" <div class="core-wrap">
:format="format"></el-progress> <el-progress :percentage="scope.row.aicore_rate===-1?0:scope.row.aicore_rate"
:format="format(scope.row.aicore_rate)"></el-progress>
</div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -154,8 +165,8 @@ limitations under the License. ...@@ -154,8 +165,8 @@ limitations under the License.
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<div class="hbs-wrap"> <div class="hbs-wrap">
<el-progress :percentage=" <el-progress :percentage="scope.row.hbm_info.memory_size?
parseInt(scope.row.hbm_info.memory_usage/scope.row.hbm_info.memory_size*100)" parseInt(scope.row.hbm_info.memory_usage/scope.row.hbm_info.memory_size*100):0"
:format="formatHbm(scope.row.hbm_info)"></el-progress> :format="formatHbm(scope.row.hbm_info)"></el-progress>
</div> </div>
</template> </template>
...@@ -195,7 +206,7 @@ limitations under the License. ...@@ -195,7 +206,7 @@ limitations under the License.
:class="{zero:!scope.row.temperature}"></div> :class="{zero:!scope.row.temperature}"></div>
<div class="process-wrap"> <div class="process-wrap">
<div class="process-cover" <div class="process-cover"
:style="{width:scope.row.temperature/temperatureMax*100+'%'}"></div> :style="{width:temperatureMax?scope.row.temperature/temperatureMax*100+'%':0}"></div>
</div> </div>
<span>{{scope.row.temperature}}</span> <span>{{scope.row.temperature}}</span>
</div> </div>
...@@ -213,7 +224,8 @@ limitations under the License. ...@@ -213,7 +224,8 @@ limitations under the License.
</div> </div>
</div> </div>
</div> </div>
<div class="cl-hardware-bottom"> <div class="cl-hardware-bottom"
:class="{noNpu:!chipTableData.length}">
<div class="cl-hardware-left"> <div class="cl-hardware-left">
<div class="cl-sub-title"> <div class="cl-sub-title">
CPU CPU
...@@ -314,7 +326,7 @@ export default { ...@@ -314,7 +326,7 @@ export default {
overallCpuInfo: [], overallCpuInfo: [],
selectedCpuInfo: [], selectedCpuInfo: [],
selectedCpuIndex: null, selectedCpuIndex: null,
pieColorArr: ['#5e7ce0', '#a6dd82'], pieColorArr: ['#5e7ce0', '#ccc', '#a6dd82'],
autoUpdateTimer: null, // Automatic refresh timer autoUpdateTimer: null, // Automatic refresh timer
isReloading: false, // Manually refresh isReloading: false, // Manually refresh
}; };
...@@ -410,10 +422,14 @@ export default { ...@@ -410,10 +422,14 @@ export default {
} }
if (res && res.data) { if (res && res.data) {
this.chipTableData = res.data.npu || []; this.chipTableData = res.data.npu || [];
if (this.chipTableData.length === 0) {
this.defaultCpuNum = 192;
}
this.powerMax = this.powerMax =
Math.max(...this.chipTableData.map((val) => val.power)) * 1.2; Math.max(...this.chipTableData.map((val) => val.power)) * 1.2;
this.temperatureMax = this.temperatureMax =
Math.max(...this.chipTableData.map((val) => val.temperature)) * 1.2; Math.max(...this.chipTableData.map((val) => val.temperature)) *
1.2;
// 1.2 In order to Demonstrated effect // 1.2 In order to Demonstrated effect
if (res.data.memory && res.data.memory.virtual) { if (res.data.memory && res.data.memory.virtual) {
this.dealChartData(this.virtualChart, res.data.memory.virtual); this.dealChartData(this.virtualChart, res.data.memory.virtual);
...@@ -439,6 +455,17 @@ export default { ...@@ -439,6 +455,17 @@ export default {
} else { } else {
this.selectedCpuInfo = []; this.selectedCpuInfo = [];
} }
this.$nextTick(() => {
const doms = document.querySelectorAll('.fail-row');
if (doms) {
for (let i = 0; i < doms.length; i++) {
doms[i].setAttribute(
'title',
this.$t('hardwareVisual.failQueryChip'),
);
}
}
});
} }
} }
}, },
...@@ -452,6 +479,12 @@ export default { ...@@ -452,6 +479,12 @@ export default {
}, },
); );
}, },
tableRowClassName({row, rowIndex}) {
if (!row.success) {
return 'fail-row';
}
return '';
},
/** /**
* add tips * add tips
* @param {Array} arr cpu Info * @param {Array} arr cpu Info
...@@ -507,14 +540,21 @@ export default { ...@@ -507,14 +540,21 @@ export default {
if (val.idle !== undefined) { if (val.idle !== undefined) {
if (index === key) { if (index === key) {
this.selectedCpuIndex = key; this.selectedCpuIndex = key;
val.selected = true; val.selected = !val.selected;
this.selectedCpuInfo = Object.keys(this.cpuList[index]).map((val) => { if (val.selected) {
return { this.selectedCpuInfo = Object.keys(this.cpuList[index]).map(
label: val, (val) => {
value: this.cpuList[index][val], return {
}; label: val,
}); value: this.cpuList[index][val],
this.selectedCpuInfo.pop(); };
},
);
this.selectedCpuInfo.pop();
} else {
this.selectedCpuIndex = null;
this.selectedCpuInfo = [];
}
} else { } else {
if (this.cpuList[index].idle !== undefined) { if (this.cpuList[index].idle !== undefined) {
val.selected = false; val.selected = false;
...@@ -530,9 +570,12 @@ export default { ...@@ -530,9 +570,12 @@ export default {
* @param {Object} data chart data * @param {Object} data chart data
*/ */
dealChartData(chart, data) { dealChartData(chart, data) {
const virtual = Object.keys(data); if (data.others === 0) {
chart.legend = virtual.reverse(); chart.legend = ['used', 'available'];
chart.data = virtual.map((val) => { } else {
chart.legend = ['used', 'others', 'available'];
}
chart.data = chart.legend.map((val) => {
return { return {
value: data[val], value: data[val],
name: val, name: val,
...@@ -565,7 +608,11 @@ export default { ...@@ -565,7 +608,11 @@ export default {
return `${n}`; return `${n}`;
}, },
format(percentage, item) { format(percentage, item) {
return `${percentage}`; return () => {
return percentage === -1
? this.$t('hardwareVisual.faliQuery')
: `${percentage}`;
};
}, },
formatHbm(hbmInfo) { formatHbm(hbmInfo) {
return function() { return function() {
...@@ -639,7 +686,7 @@ export default { ...@@ -639,7 +686,7 @@ export default {
name: '', name: '',
center: ['25%', '50%'], center: ['25%', '50%'],
type: 'pie', type: 'pie',
radius: ['40%', '60%'], radius: this.chipTableData.length ? ['40%', '60%'] : ['30%', '40%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: true, show: true,
...@@ -739,7 +786,7 @@ export default { ...@@ -739,7 +786,7 @@ export default {
height: calc(100% - 36px); height: calc(100% - 36px);
overflow: auto; overflow: auto;
.el-icon-question::before { .el-icon-question::before {
color: red; color: #f06281;
} }
.el-icon-success:before { .el-icon-success:before {
color: #57d7ac; color: #57d7ac;
...@@ -797,6 +844,12 @@ export default { ...@@ -797,6 +844,12 @@ export default {
margin-right: -145px; margin-right: -145px;
} }
} }
.core-wrap {
.el-progress-bar {
padding-right: 80px;
margin-right: -85px;
}
}
.power { .power {
background: #e5f6f6; background: #e5f6f6;
padding-left: 10px; padding-left: 10px;
...@@ -873,6 +926,13 @@ export default { ...@@ -873,6 +926,13 @@ export default {
} }
} }
} }
.cl-hardware-bottom.noNpu {
padding-top: 16px;
height: 570px;
.cl-cpu-wrap {
height: 399px;
}
}
.el-table thead tr { .el-table thead tr {
background: #f0f3fa; background: #f0f3fa;
} }
...@@ -905,5 +965,9 @@ export default { ...@@ -905,5 +965,9 @@ export default {
.el-icon-info:before { .el-icon-info:before {
color: #6c7280; color: #6c7280;
} }
.el-table .fail-row {
opacity: 0.24;
filter: grayscale(1);
}
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册