NEZ-887:当用户未创建 dashboard panel 时,chart 查询错误数据的问题
This commit is contained in:
@@ -656,6 +656,7 @@ export default {
|
||||
if (!param.query) delete param.query
|
||||
// 根据panelId获得panel下的所有图表
|
||||
// const groupId = true ? '&groupId=0' : ''
|
||||
if (!params.panelId) { return } // 没有panelId不调用接口
|
||||
this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0' + '&pageSize=-1').then(response => {
|
||||
if (response.code === 200) {
|
||||
response.data.list.forEach((item, index) => {
|
||||
|
||||
@@ -37,20 +37,20 @@
|
||||
<operation-log-tab v-if="from === fromRoute.user && targetTab === 'operationLogTab'" :from="from" :obj="obj" :tabs="tabs.user.operationLog" @changeTab="changeTab"></operation-log-tab>
|
||||
<terminal-log-tab v-if="from === fromRoute.user && targetTab === 'terminalLogTab'" :from="from" :obj="obj" :tabs="tabs.user.terminalLog" @changeTab="changeTab"></terminal-log-tab>
|
||||
<!-- asset列表的3个 -->
|
||||
<panel-tab-new :paramsType="'asset'" v-if="from === fromRoute.asset && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.panel" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<panel-tab-new @getTableData="getTableData" :paramsType="'asset'" v-if="from === fromRoute.asset && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.panel" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<alertMessageTabNew v-if="from === fromRoute.asset && targetTab === 'alertMessageTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.alertMessage" :targetTab="targetTab" @changeTab="changeTab"></alertMessageTabNew>
|
||||
<endpointTabNew v-if="from === fromRoute.asset && targetTab === 'endpointTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.endpoint" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew>
|
||||
<assetSubTab v-if="from === fromRoute.asset && targetTab === 'assetSubTab' && obj.childrenNum" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.asset.alertMessageSub" :targetTab="targetTab" @changeTab="changeTab"></assetSubTab>
|
||||
<!--module列表的tab-->
|
||||
<endpointTabNew v-if="from === fromRoute.module && targetTab === 'endpoint'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" :targetTab="targetTab" @changeTab="changeTab"></endpointTabNew>
|
||||
<alertMessageTabNew v-if="from === fromRoute.module && targetTab === 'moduleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
|
||||
<panel-tab-new :paramsType="'module'" v-if="from === fromRoute.module && targetTab === 'panel'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<panel-tab-new @getTableData="getTableData" :paramsType="'module'" v-if="from === fromRoute.module && targetTab === 'panel'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.module.moduleTabTitle" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<!--endpoint列表的tab-->
|
||||
<panel-tab-new :paramsType="'endpoint'" v-if="from === fromRoute.endpoint && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.endpoint.endpointTabTitle" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<panel-tab-new @getTableData="getTableData" :paramsType="'endpoint'" v-if="from === fromRoute.endpoint && targetTab === 'panelTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.endpoint.endpointTabTitle" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<endpointQuery v-if="from === fromRoute.endpoint && targetTab === 'endpointQuery'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.endpoint.endpointTabTitle" @changeTab="changeTab" :targetTab="targetTab"></endpointQuery>
|
||||
<alertMessageTabNew v-if="from === fromRoute.endpoint && targetTab === 'endpointAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.endpoint.endpointTabTitle" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
|
||||
<!--chartTemp的Tab-->
|
||||
<panel-tab-new :paramsType="'template'" v-if="from === fromRoute.chartTemp && targetTab === 'panel'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.chartTemp.chartTempTabTitle" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<panel-tab-new @getTableData="getTableData" :paramsType="'template'" v-if="from === fromRoute.chartTemp && targetTab === 'panel'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.chartTemp.chartTempTabTitle" :targetTab.sync="targetTab" @changeTab="changeTab"></panel-tab-new>
|
||||
<!--alertRule Tab-->
|
||||
<alertMessageTabNew v-if="from === fromRoute.alertRule && targetTab === 'alertRuleAlertMessage'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.alertRule.alertRule" @changeTab="changeTab" :targetTab="targetTab"></alertMessageTabNew>
|
||||
<!--model 下滑-->
|
||||
@@ -250,6 +250,9 @@ export default {
|
||||
this.$refs.reminalLogRecordTab.consoleResize()
|
||||
}, 600)
|
||||
}
|
||||
},
|
||||
getTableData () {
|
||||
this.$emit('getTableData')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,6 +272,7 @@ export default {
|
||||
this.getData(this.filter)
|
||||
}
|
||||
})
|
||||
this.$emit('getTableData')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -17,6 +17,11 @@ export const agent = {
|
||||
label: 'Per-datacenter',
|
||||
value: 2,
|
||||
text: 'Per-datacenter'
|
||||
},
|
||||
{
|
||||
label: 'Loki',
|
||||
value: 11,
|
||||
text: 'Loki'
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -65,6 +70,38 @@ export const agent2 = {
|
||||
label: 'Per-datacenter',
|
||||
value: 2,
|
||||
text: 'Per-datacenter'
|
||||
},
|
||||
{
|
||||
label: 'Loki',
|
||||
value: 11,
|
||||
text: 'Loki'
|
||||
}
|
||||
],
|
||||
theDataGroup: [
|
||||
{
|
||||
label: 'Metrics',
|
||||
option: [
|
||||
{
|
||||
label: 'Global',
|
||||
value: 1,
|
||||
text: 'Global'
|
||||
},
|
||||
{
|
||||
label: 'Per-datacenter',
|
||||
value: 2,
|
||||
text: 'Per-datacenter'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Logs',
|
||||
option: [
|
||||
{
|
||||
label: 'Loki',
|
||||
value: 11,
|
||||
text: 'Loki'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -556,6 +556,8 @@ export default {
|
||||
if (this.endpointTableData.length === 0) {
|
||||
this.endpointTouch = true
|
||||
this.$refs.addEndpoint.validate()
|
||||
this.prevent_opt.save = false
|
||||
this.showError = true
|
||||
return false
|
||||
}
|
||||
// 对endpointList进行处理,避免携带过多无用数据
|
||||
|
||||
@@ -43,9 +43,14 @@
|
||||
<!-- :props="{ multiple: false, checkStrictly: false ,emitPath:false}"-->
|
||||
<!-- clearable></el-cascader>-->
|
||||
<el-select v-model="editPromServer.type" :disabled="editPromServer.id != null&& editPromServer.id != ''" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="value">
|
||||
<el-option v-for="item in agent2.theData" :key="item.value" :label="item.label" :value="item.value" :disabled="federationEnabled && item.value == 2">
|
||||
<el-option-group
|
||||
v-for="group in agent2.theDataGroup"
|
||||
:key="group.label"
|
||||
:label="group.label">
|
||||
<el-option v-for="item in group.option" :key="item.value" :label="item.label" :value="item.value" :disabled="federationEnabled && item.value == 2">
|
||||
<span class="panel-dropdown-label-txt" >{{item.label}}</span>
|
||||
</el-option>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="Token" prop="token">
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
</div>
|
||||
<transition name="el-zoom-in-bottom">
|
||||
<bottom-box v-if="bottomBox.showSubList"
|
||||
@getTableData = 'getTableData'
|
||||
ref="bottomBox"
|
||||
:from="from"
|
||||
:is-full-screen="bottomBox.isFullScreen"
|
||||
@@ -137,6 +138,9 @@ export default {
|
||||
},
|
||||
search (searchObj) {
|
||||
this.$emit('search', searchObj)
|
||||
},
|
||||
getTableData () {
|
||||
this.$emit('getTableData')
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
:layout="dataListLayout"
|
||||
:search-msg="searchMsg"
|
||||
@search="search"
|
||||
@getTableData="getTableData"
|
||||
>
|
||||
<template v-slot:top-tool-right>
|
||||
<button id="asset-filter" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
:from="fromRoute.chartTemp"
|
||||
:search-msg="searchMsg"
|
||||
@search="search"
|
||||
@getTableData="getTableData"
|
||||
>
|
||||
<template v-slot:top-tool-left>
|
||||
<div id="module-type-1" class="nz-tab-item-box" @click="clickTab([],'exprTemp')"><!--v-has="'snmp_browser_view'"-->
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
:layout="dataListLayout"
|
||||
:search-msg="searchMsg"
|
||||
@search="search"
|
||||
@getTableData="getTableData"
|
||||
>
|
||||
<template v-slot:top-tool-right>
|
||||
<button id="asset-filter" :class="{ 'is-focus': dataListLayout.indexOf('clickSearch') > -1 }" class="top-tool-btn margin-r-10" @click.stop="showClickSearch">
|
||||
|
||||
Reference in New Issue
Block a user