diff --git a/src/assets/css/components/views/charts2/linkDirectionGrid.scss b/src/assets/css/components/views/charts2/linkDirectionGrid.scss index a292a045..3efc579d 100644 --- a/src/assets/css/components/views/charts2/linkDirectionGrid.scss +++ b/src/assets/css/components/views/charts2/linkDirectionGrid.scss @@ -1,3 +1,72 @@ .link-direction-grid { + display: flex; + border: 1px solid #E2E5EC; + height: 100%; + width: 100%; + border-radius: 4px; + .link-statistical-dimension { + width: 50%; + padding: 20px; + + .dimension-title { + font-size: 14px; + color: #046ECA; + } + .data-grid { + height: 100px; + .egress-row { + padding-left: 190px; + height: 100%; + display: flex; + + .egress-id { + display: flex; + align-items: flex-end; + width: 50px; + height: 100%; + margin-right: 8px; + transform: rotate(-45deg) translate(-5px,-15px); + color: #353636; + font-size: 12px; + } + } + .data-row { + display: flex; + + .ingress-id { + display: flex; + align-items: center; + justify-content: flex-end; + width: 190px; + height: 50px; + margin-bottom: 10px; + padding-right: 12px; + color: #353636; + font-size: 12px; + } + .data-item { + display: flex; + align-items: center; + justify-content: center; + height: 50px; + width: 50px; + margin: 0 8px 8px 0; + border: 1px solid #DEDEDE; + border-radius: 4px; + + .data-item__point { + height: 8px; + width: 8px; + border-radius: 50%; + background-color: #749F4D; + + &:first-of-type { + margin-right: 6px; + } + } + } + } + } + } } diff --git a/src/mock/linkMonitor.js b/src/mock/linkMonitor.js index 86bc859f..adb4a3b7 100644 --- a/src/mock/linkMonitor.js +++ b/src/mock/linkMonitor.js @@ -2,7 +2,7 @@ import Mock from 'mockjs' const openMock = true if (openMock) { - Mock.mock(BASE_CONFIG.baseUrl + 'interface/linkMonitor/links', 'get', function (requestObj) { + Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/linkMonitor/links.*'), 'get', function (requestObj) { const linkData = [] for (let i = 0; i < 94; i++) { linkData.push({ linkId: 20 * (i + 300), totalBitsRate: Math.floor(Math.pow(1.1, i) * 10000) }) @@ -15,4 +15,21 @@ if (openMock) { } } }) + Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/linkMonitor/linkTrafficDirection.*'), 'get', function (requestObj) { + const data = [] + const ingressLinkIds = ['256', '512', '768', '1024', '1280', '1536', '1792', '2048', '2304', '2816'] + const egressLinkIds = ['257', '513', '769', '1025', '1281', '1537', '1793', '2049', '2305', '2817'] + ingressLinkIds.forEach(ingress => { + egressLinkIds.forEach(egress => { + data.push({ egressLinkId: egress, ingressLinkId: ingress, egressUsage: 128000, ingressUsage: 12800, totalBitsRate: 985412, score: 6, tcpConnectionEstablishLatency: 50, httpResponseLatency: 50, sslResponseLatency: 50, packetsLoss: 0.2, packetRetrans: 0.1 }) + }) + }) + return { + msg: 'success', + code: 200, + data: { + result: data + } + } + }) } diff --git a/src/mock/npm.js b/src/mock/npm.js index 8bd87669..bb533e97 100644 --- a/src/mock/npm.js +++ b/src/mock/npm.js @@ -2,7 +2,7 @@ import Mock from 'mockjs' const openMock = false if (openMock) { - Mock.mock(RegExp(BASE_CONFIG.baseUrl + 'visual/panel*'), 'get', function (requestObj) { + Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'visual/panel.*'), 'get', function (requestObj) { return { "msg": "success", "code": 200, diff --git a/src/utils/api.js b/src/utils/api.js index fb29e8fc..18a63b20 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -20,6 +20,8 @@ export const api = { login: '/sys/login', // user user: '/sys/user', + // 获取配置 + config: '/sys/config', // role role: '/sys/role', menu: '/sys/role/menu/', @@ -196,7 +198,8 @@ export const api = { } }, linkMonitor: { - links: '/interface/linkMonitor/links' + links: '/interface/linkMonitor/links', + linkTrafficDirection: '/interface/linkMonitor/linkTrafficDirection' } } diff --git a/src/views/charts2/Chart.vue b/src/views/charts2/Chart.vue index 3cfb145f..6fb6bb1f 100644 --- a/src/views/charts2/Chart.vue +++ b/src/views/charts2/Chart.vue @@ -128,6 +128,12 @@ :chart="chart" @toggleLoading="toggleLoading" > + - + + + {{$t('linkMonitor.egressLink')}} & {{$t('linkMonitor.ingressLink')}} + + + {{item.linkId}} + + + {{row.linkId}} + + + + + + + +