From c5104b3697303d94787412e890d3e915ee84fa08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Fri, 2 Jun 2023 14:26:22 +0800 Subject: [PATCH] =?UTF-8?q?CN-1060:=20=E5=AE=9E=E4=BD=93=E8=AF=A6=E6=83=85?= =?UTF-8?q?--=E5=AE=89=E5=85=A8=E4=BA=8B=E4=BB=B6=E5=92=8C=E6=80=A7?= =?UTF-8?q?=E8=83=BD=E4=BA=8B=E4=BB=B6tab=E6=8E=A5=E5=8F=A3=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mock/entity.js | 8 ++--- src/utils/api.js | 4 +-- .../charts/entityDetail/EntityDetailTabs.vue | 13 ++++++--- .../entityDetail/tabs/PerformanceEvent.vue | 27 +++-------------- .../entityDetail/tabs/SecurityEvent.vue | 29 ++++--------------- 5 files changed, 24 insertions(+), 57 deletions(-) diff --git a/src/mock/entity.js b/src/mock/entity.js index f4c87fcd..9f85147a 100644 --- a/src/mock/entity.js +++ b/src/mock/entity.js @@ -1,8 +1,8 @@ import Mock from 'mockjs' - +const urlAndVersion = BASE_CONFIG.baseUrl + BASE_CONFIG.apiVersion const openMock = true if (openMock) { - Mock.mock(new RegExp(BASE_CONFIG.baseUrl + BASE_CONFIG.apiVersion + '/entity/detail/traffic/throughput.*'), 'get', function (requestObj) { + Mock.mock(new RegExp(urlAndVersion + '/entity/detail/traffic/throughput.*'), 'get', function (requestObj) { const titleList = ['totalBitsRate', 'inboundBitsRate', 'outboundBitsRate', 'internalBitsRate', 'throughBitsRate', 'other'] const arr = [{ type: 'Bits/s' }, { type: 'Packets/s' }, { type: 'Sessions/s' }] @@ -66,7 +66,7 @@ if (openMock) { } } }) - Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/entityDetail/securityEvent.*'), 'get', function (requestObj) { + Mock.mock(new RegExp(urlAndVersion + '/entity/detail/event/security.*'), 'get', function (requestObj) { const result = [ { eventId: '1298414830886991872', @@ -183,7 +183,7 @@ if (openMock) { } } }) - Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/entityDetail/performanceEvent.*'), 'get', function (requestObj) { + Mock.mock(new RegExp(urlAndVersion + '/entity/detail/event/performance.*'), 'get', function (requestObj) { const result = [ { eventId: '1308078720390412288', diff --git a/src/utils/api.js b/src/utils/api.js index d312e391..8b776987 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -232,8 +232,8 @@ export const api = { }, entity: { throughput: BASE_CONFIG.apiVersion + '/entity/detail/traffic/throughput', - securityEvent: 'interface/entityDetail/securityEvent', - performanceEvent: 'interface/entityDetail/performanceEvent', + security: BASE_CONFIG.apiVersion + '/entity/detail/event/security', + performance: BASE_CONFIG.apiVersion + '/entity/detail/event/performance', domainNameResolutionRelatedApp: 'interface/entity/detail/overview/ip/relatedApp', domainNameResolutionRelatedIP: 'interface/entity/detail/overview/ip/relatedIp', domainNameResolutionRelatedDomain: 'interface/entity/detail/overview/ip/relatedDomain', diff --git a/src/views/charts2/charts/entityDetail/EntityDetailTabs.vue b/src/views/charts2/charts/entityDetail/EntityDetailTabs.vue index 88fec9e3..d278d13d 100644 --- a/src/views/charts2/charts/entityDetail/EntityDetailTabs.vue +++ b/src/views/charts2/charts/entityDetail/EntityDetailTabs.vue @@ -13,9 +13,9 @@ - - - + + + @@ -49,7 +49,12 @@ export default { }, data () { return { - timer: null + timer: null, + // 最近一天的时间 + oneDayTimeFilter: { + startTime: window.$dayJs.tz().valueOf() - 1440 * 60 * 1000, + endTime: window.$dayJs.tz().valueOf() + } } }, watch: { diff --git a/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue b/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue index 906e0cc3..ba278a1c 100644 --- a/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue +++ b/src/views/charts2/charts/entityDetail/tabs/PerformanceEvent.vue @@ -49,12 +49,11 @@