fix(性能测试): 查看测试报告报错修改

This commit is contained in:
CaptainB 2021-11-12 18:26:39 +08:00 committed by 刘瑞斌
parent 39a8803d17
commit 8c393684e8
2 changed files with 35 additions and 35 deletions

View File

@ -93,11 +93,11 @@ export default {
if (this.planReportTemplate) {
// this.handleGetLogResourceDetail(this.planReportTemplate.logResourceDetail, resourceId);
} else if (this.isShare) {
getSharePerformanceReportLogResourceDetail(this.shareId, this.id, resourceId, this.page[resourceId], data => {
getSharePerformanceReportLogResourceDetail(this.shareId, this.id, resourceId, this.page[resourceId] || 1, data => {
this.handleGetLogResourceDetail(data, resourceId);
});
} else {
getPerformanceReportLogResourceDetail(this.id, resourceId, this.page[resourceId], data => {
getPerformanceReportLogResourceDetail(this.id, resourceId, this.page[resourceId] || 1, data => {
this.handleGetLogResourceDetail(data, resourceId);
});
}

View File

@ -6,9 +6,9 @@
<el-select v-model="currentInstance" placeholder="" size="small" style="width: 100%"
@change="getResource(currentInstance)">
<el-option
v-for="item in instances"
:key="item.ip+item.port"
:value="item.ip+':'+item.port">
v-for="item in instances"
:key="item.ip+item.port"
:value="item.ip+':'+item.port">
{{ item.ip }} {{ item.name }}
</el-option>
</el-select>
@ -36,47 +36,47 @@
<el-row>
<el-col :offset="2" :span="20">
<el-table
:data="tableData"
stripe
border
style="width: 100%">
:data="tableData"
stripe
border
style="width: 100%">
<el-table-column label="Label" align="center">
<el-table-column
prop="label"
label="Label"
sortable>
prop="label"
label="Label"
sortable>
</el-table-column>
</el-table-column>
<el-table-column label="Aggregate" align="center">
<el-table-column
prop="avg"
label="Avg."
width="100"
sortable
prop="avg"
label="Avg."
width="100"
sortable
/>
<el-table-column
prop="min"
label="Min."
width="100"
sortable
prop="min"
label="Min."
width="100"
sortable
/>
<el-table-column
prop="max"
label="Max."
width="100"
sortable
prop="max"
label="Max."
width="100"
sortable
/>
</el-table-column>
<el-table-column label="Range" align="center">
<el-table-column
prop="startTime"
label="Start"
width="160"
prop="startTime"
label="Start"
width="160"
/>
<el-table-column
prop="endTime"
label="End"
width="160"
prop="endTime"
label="End"
width="160"
/>
</el-table-column>
</el-table>
@ -226,13 +226,13 @@ export default {
},
handleChecked(id) {
let curr = this.instances.filter(instance => id === instance.ip + ":" + instance.port)[0];
if (curr.monitorConfig) {
if (curr && curr.monitorConfig) {
this.checkList = [];
this.checkOptions = curr.monitorConfig.filter(mc => mc.value && mc.name)
.map(mc => {
this.checkList.push(mc.name);
return {key: mc.name, label: mc.name,};
});
.map(mc => {
this.checkList.push(mc.name);
return {key: mc.name, label: mc.name,};
});
if (this.checkList.length === 0) {
this.checkList = checkList;
this.checkOptions = checkOptions;