diff --git a/front/src/api/capabilityCloud.js b/front/src/api/capabilityCloud.js index 011517fe..0cb3eebe 100644 --- a/front/src/api/capabilityCloud.js +++ b/front/src/api/capabilityCloud.js @@ -97,7 +97,7 @@ export function callTheTrendPort(start, end, params) { export function totalCallsSnum(params) { return request({ url: - `/metrics/api/v1/query?time=${params}&query=sum(apigateway_http_status)`, + `/gateway-monitor/getCallCount`, method: 'get', }) } diff --git a/front/src/views/capabilityCloud/components/ComponentServices.vue b/front/src/views/capabilityCloud/components/ComponentServices.vue index f43a0dd9..d64c3bee 100644 --- a/front/src/views/capabilityCloud/components/ComponentServices.vue +++ b/front/src/views/capabilityCloud/components/ComponentServices.vue @@ -409,13 +409,16 @@ const TotalCallsAPI = () => { const end = Date.parse(new Date()) / 1000 totalCallsSnum(end).then((res) => { - debugger - snum.value[1].num = res.data.data.result[0].value[1] + snum.value[1].num = Number(res.data.data) totalCallsSnum2(end).then((resSon) => { - snum.value[2].num = - parseInt( - (resSon.data.data.result[0].value[1] / snum.value[1].num) * 100 - ) + '%' + if (snum.value[1].num === 0) { + num.value[2].num = '100%' + } else { + snum.value[2].num = + parseInt( + (resSon.data.data.result[0].value[1] / snum.value[1].num) * 100 + ) + '%' + } }) }) }