refactor(接口监控):http状态码监控可跳转到相应报告
This commit is contained in:
parent
063726b5cc
commit
a590e93b89
|
@ -2,7 +2,7 @@
|
||||||
<common-monitor-chart>
|
<common-monitor-chart>
|
||||||
<template>
|
<template>
|
||||||
<div id="response-time-chart" :style="{ width:'100%',height:'100%' }">
|
<div id="response-time-chart" :style="{ width:'100%',height:'100%' }">
|
||||||
<chart :options="getOptions()" :style="{ width:'100%' }"></chart>
|
<chart :options="getOptions()" :style="{ width:'100%' }" v-on:click="click"></chart>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</common-monitor-chart>
|
</common-monitor-chart>
|
||||||
|
@ -27,20 +27,15 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
click(params) {
|
click(params) {
|
||||||
//如果状态不是以2开头
|
let startTime = params.name;
|
||||||
if (params.value.substr(0, 1) !== '2') {
|
this.result = this.$$get('/api/monitor/getReportId', {'startTime': startTime}, {
|
||||||
let startTime = params.name;
|
'apiUrl': this.apiUrl
|
||||||
this.result = this.$$get('/api/monitor/getReportId', {'startTime': startTime}, {
|
}, response => {
|
||||||
'apiUrl': this.apiUrl
|
this.reportId = response.data;
|
||||||
}, response => {
|
let reportId = this.reportId
|
||||||
this.reportId = response.data;
|
let url = '#/api/report/view/' + reportId;
|
||||||
let reportId = this.reportId
|
window.open(url, '_blank');
|
||||||
let url = '#/api/report/view/' + reportId;
|
});
|
||||||
let target = '_blank';
|
|
||||||
window.open(url, target);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
getOptions() {
|
getOptions() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue