CN-108 IP详情页 clientIP和serverIP切换功能

This commit is contained in:
hyx
2021-08-26 15:35:20 +08:00
parent 51db57d3a5
commit 48550a47a2
2 changed files with 16 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ export const panelTypeAndRouteMapping = {
trafficSummary: 1, trafficSummary: 1,
networkAppPerformance: 2, networkAppPerformance: 2,
dnsServiceInsights: 3, dnsServiceInsights: 3,
clientIpEntityDetail: 4, ipEntityDetail: 4,//此为clientIP
domainEntityDetail: 5, domainEntityDetail: 5,
appEntityDetail: 6, appEntityDetail: 6,
serverIpEntityDetail: 7 serverIpEntityDetail: 7

View File

@@ -6,7 +6,7 @@
<span style="padding-left: 15px; color: #333;">{{tabTitle}}</span> <span style="padding-left: 15px; color: #333;">{{tabTitle}}</span>
</div> </div>
<el-radio-group v-model="tab" size="mini" @change="changeTab"> <el-radio-group v-model="tab" size="mini" @change="changeTab">
<el-radio-button v-for="tab in tabs" :key="tab.key" :label="tab.label"></el-radio-button> <el-radio-button v-for="tabTmp in tabs" :label="tabTmp.key" >{{tabTmp.label}}</el-radio-button>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="cn-panel" id="cn-panel" :style="{height: typeName ? 'calc(100% - 80px)' : ''}"> <div class="cn-panel" id="cn-panel" :style="{height: typeName ? 'calc(100% - 80px)' : ''}">
@@ -69,7 +69,10 @@ export default {
tabTitle () { tabTitle () {
let title let title
switch (this.typeName) { switch (this.typeName) {
case 'clientIpEntityDetail': case 'ipEntityDetail':{//client IP
title = this.$t('entities.ipDetail')
break
}
case 'serverIpEntityDetail': { case 'serverIpEntityDetail': {
title = this.$t('entities.ipDetail') title = this.$t('entities.ipDetail')
break break
@@ -93,7 +96,7 @@ export default {
setup (props, ctx) { setup (props, ctx) {
let tab = '' let tab = ''
if (!_.isEmpty(props.tabs)) { if (!_.isEmpty(props.tabs)) {
tab = ref(props.tabs[0].label) tab = ref(props.tabs[0].key)
} }
// data // data
const dateRangeValue = 60 const dateRangeValue = 60
@@ -115,7 +118,15 @@ export default {
goBack () { goBack () {
this.$emit('goBack') this.$emit('goBack')
}, },
changeTab (label) { async changeTab (label) {
let routePath;
if(label=='clientIP'){
routePath = 'ipEntityDetail';
}else if(label=='serverIP'){
routePath = 'serverIpEntityDetail';
}
this.panelType = panelTypeAndRouteMapping[routePath];
await this.init();
}, },
async init () { async init () {
const panels = await getPanelList({ type: this.panelType }) const panels = await getPanelList({ type: this.panelType })