diff --git a/src/assets/css/components/views/charts2/linkTrafficSankey.scss b/src/assets/css/components/views/charts2/linkTrafficSankey.scss index 0417d3b8..b897fc32 100644 --- a/src/assets/css/components/views/charts2/linkTrafficSankey.scss +++ b/src/assets/css/components/views/charts2/linkTrafficSankey.scss @@ -6,9 +6,17 @@ height: 100%; width: 100%; border-radius: 4px; + position: relative; + .sankey__label { + position: absolute; + color: #333; + bottom: 50px; + font-weight: bold; + transform: translateX(-50%); + } .el-tabs { - margin-left: 20px; + height: 100%; .el-tabs__nav-wrap { padding-top: 5px; @@ -20,6 +28,7 @@ } .el-tabs__nav.is-top { height: 33px; + margin-left: 20px; .el-tabs__active-bar { background-color: $blue; @@ -38,5 +47,49 @@ } } } + .el-tabs__content { + height: calc(100% - 52px); + width: 100%; + .el-tab-pane { + height: 100%; + width: 100%; + .chart-drawing { + height: 100%; + width: 100%; + .traffic-sankey { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + flex-direction: column; + .traffic-sankey-row-header { + .traffic-sankey__row-value { + font-size: 12px; + color: $blue; + font-weight: 500; + } + } + .traffic-sankey-row-body { + display: flex; + .traffic-sankey__tooltip-right { + .traffic-sankey__row-value { + font-size: 12px; + color: #353636; + font-weight: 600; + } + } + .traffic-sankey__tooltip-left { + .traffic-sankey__row-label { + margin-right: 5px; + font-size: 12px; + color: #575757; + font-weight: 400; + } + } + } + } + } + } + } } } diff --git a/src/mock/linkMonitor.js b/src/mock/linkMonitor.js index b2bdddad..5b8bb922 100644 --- a/src/mock/linkMonitor.js +++ b/src/mock/linkMonitor.js @@ -21,7 +21,7 @@ if (openMock) { const egressLinkIds = ['257', '513', '769', '1025', '1281', '1537', '1793', '2049', '2305', '2817'] ingressLinkIds.forEach(ingress => { egressLinkIds.forEach(egress => { - data.push({ egressLinkId: egress, ingressLinkId: ingress, egressBytes: 128000, ingressBytes: 12800, totalBytes: 130800, establishLatencyMs: 50, httpResponseLatency: 50, sslConLatency: 50, tcpLostlenPercent: 0.2, pktRetransPercent: 0.1 }) + 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 { @@ -32,4 +32,82 @@ if (openMock) { } } }) + Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/link/overview/quadrupleIngressAnalysis.*'), 'get', function (requestObj) { + const data = [ + { + clientCity: 'beijing', + commonEgressLinkId: 257, + ingressLinkDirection: 'xian', + serverCity: 'taiyuan', + ingressBytes: 10000000000 + }, + { + clientCity: 'xingjiang', + commonEgressLinkId: 513, + ingressLinkDirection: 'xian', + serverCity: 'liaoning', + ingressBytes: 20000000000 + }, + { + clientCity: 'shanghai', + commonEgressLinkId: 769, + ingressLinkDirection: 'xian', + serverCity: 'anhui', + ingressBytes: 30000000000 + }, + { + clientCity: 'tianjing', + commonEgressLinkId: 1025, + ingressLinkDirection: 'xian', + serverCity: 'taiyuan', + ingressBytes: 30000000000 + } + ] + return { + msg: 'success', + code: 200, + data: { + result: data + } + } + }) + Mock.mock(new RegExp(BASE_CONFIG.baseUrl + 'interface/link/overview/quadrupleEgressAnalysis.*'), 'get', function (requestObj) { + const data = [ + { + clientCity: 'beijing', + commonEgressLinkId: 256, + egressLinkDirection: 'xian', + serverCity: 'taiyuan', + egressBytes: 10000000000 + }, + { + clientCity: 'xingjiang', + commonEgressLinkId: 512, + egressLinkDirection: 'xian', + serverCity: 'liaoning', + egressBytes: 20000000000 + }, + { + clientCity: 'shanghai', + commonEgressLinkId: 768, + egressLinkDirection: 'xian', + serverCity: 'anhui', + egressBytes: 30000000000 + }, + { + clientCity: 'tianjing', + commonEgressLinkId: 1024, + egressLinkDirection: 'xian', + serverCity: 'taiyuan', + egressBytes: 30000000000 + } + ] + return { + msg: 'success', + code: 200, + data: { + result: data + } + } + }) } diff --git a/src/utils/api.js b/src/utils/api.js index 4111415e..d40943ea 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -199,7 +199,9 @@ export const api = { }, linkMonitor: { links: '/interface/linkMonitor/links', - linkTrafficDirection: '/interface/linkMonitor/linkTrafficDirection' + linkTrafficDirection: '/interface/linkMonitor/linkTrafficDirection', + quadrupleIngressAnalysis: '/interface/link/overview/quadrupleIngressAnalysis', // 入口 + quadrupleEgressAnalysis: '/interface/link/overview/quadrupleEgressAnalysis' // 出口 }, dnsInsight: { recentEvents: '/interface/dnsInsight/recentEvents', diff --git a/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue b/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue index 9dede4a0..5a18c7db 100644 --- a/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue +++ b/src/views/charts2/charts/linkMonitor/LinkTrafficSankey.vue @@ -1,15 +1,43 @@ diff --git a/src/views/charts2/charts/options/echartOption.js b/src/views/charts2/charts/options/echartOption.js index 07e09c7e..e660fb0f 100644 --- a/src/views/charts2/charts/options/echartOption.js +++ b/src/views/charts2/charts/options/echartOption.js @@ -449,36 +449,13 @@ export const linksTrafficSankeyOption = { type: 'sankey', data: [], links: [], - right: '5%', - top: 50, - bottom: 100, - levels: [ - { - depth: 0, - itemStyle: { - color: '#47D49C' - }, - lineStyle: { - color: '#999' - } - }, { - depth: 1, - itemStyle: { - color: '#A69BF5' - }, - lineStyle: { - color: '#999' - } - }, { - depth: 2, - itemStyle: { - color: '#73A0FA' - }, - lineStyle: { - color: '#999' - } - } - ] + right: '7%', + left: '3%', + top: '0%', + bottom: '23%' + // emphasis: { + // focus: 'adjacency' + // } } ] }