feat:添加自动刷新按钮 以及 aler rule的根据告警数量排序的功能

This commit is contained in:
zhangyu
2020-11-30 14:34:26 +08:00
parent c2d82393e6
commit 25276590b6
7 changed files with 38 additions and 12 deletions

View File

@@ -676,6 +676,10 @@ li{
right: calc(100% - 440px) !important;
/*transform: translateX(100%);*/
}
.config .top-tool-main-right-to-left {
right: calc(100% - 492px) !important;
/*transform: translateX(100%);*/
}
.top-tool-main-right-to-left {
right: calc(100% - 390px) !important;
/*transform: translateX(100%);*/

View File

@@ -532,6 +532,7 @@ export const tableSet = {
case 'alertName':
case 'threshold':
case 'idc':
case 'alertNum':
return'custom';
case 'state':
if( from === 'operationlog'){

View File

@@ -441,6 +441,9 @@
},
modelTopUpdate(){//model上的图标 实时更新
this.modelTop=[];
if(!this.network){
return
}
this.nodesArray.forEach((item)=>{
let position=this.network.canvasToDOM({x:item.x,y:item.y});
let obj={
@@ -693,6 +696,14 @@
setTimeout(()=>{
let this_=this;
this.init('modal');
this.network.on("resize", function (params) {//检测resize
setTimeout(()=>{
this_.modelTopUpdate();
this_.selNodeArrUpdate();
this_.networkPopShow=false;
});
return false
});
})
},
beforeDestroy(){

View File

@@ -33,13 +33,13 @@
<div class="top-tool-search float-right">
<search-input :searchMsg="searchMsg" @search="search" :inTransform="bottomBox.inTransform"></search-input>
</div>
<pick-time :showTimePicker="false" class="float-right pickTime margin-l-20" :refresh-data-func="getTableData" v-model="searchTime" :use-chart-unit="false" ref="pickTime"></pick-time>
<export-excel
export-file-name="AlertRule"
export-url="/alert/rule/export"
import-url="/alert/rule/import"
:params="searchLabel"
@afterImport="getTableData"
class="margin-l-20"
>
<template slot="optionZone">
<button id="alert-add" @click="add" :title="$t('overall.createAlertRule')"
@@ -288,6 +288,7 @@
viewProjectData: {},
viewModuleData: {},
viewAsset: false,
searchTime: bus.getTimezontDateRange(),
}
},
methods: {

View File

@@ -25,8 +25,9 @@
<div class="top-tool-search">
<search-input :searchMsg="searchMsg" @search="search" :bottomBox.inTransform="bottomBox.inTransform"></search-input>
</div>
<pick-time :showTimePicker="false" class="float-right pickTime margin-l-20" :refresh-data-func="getAlertList" v-model="searchTimeSelect" :use-chart-unit="false" ref="pickTime"></pick-time>
<button type="button" @click="showExportDialog" :title="$t('overall.exportExcelLower')"
class="nz-btn nz-btn-size-normal nz-btn-style-light margin-l-20" id="alert-list-export">
class="nz-btn nz-btn-size-normal nz-btn-style-light" id="alert-list-export">
<i class="nz-icon nz-icon-download1"></i>
</button>
<delete-button :delete-objs="batchDeleteObjs" api="alert/message" @after="getAlertList" :clickFunction="openDelMessageBox"></delete-button>
@@ -152,6 +153,7 @@
sameLabels: ['instance','module','project','asset','endpoint','datacenter'],
legend: [],
searchTime: [],
searchTimeSelect: bus.getTimezontDateRange(),
currentMsg: {},
chartUnit: 5,

View File

@@ -6,7 +6,7 @@
padding: 8px 0 2px 0;
}
.overview-content-header .header-title{
flex:13;
flex:12;
height: 35px;
line-height: 35px;
font-size: 1.5rem !important;

View File

@@ -13,6 +13,7 @@
<div class="week">{{sysWeek}}</div>
<div class="sys-date">{{sysDate}}</div>
</div>
<pick-time :showTimePicker="false" class="float-right pickTime margin-l-20" :refresh-data-func="setFreshDataTimer" v-model="searchTime" :use-chart-unit="false" ref="pickTime"></pick-time>
<div class="operation" @click="switchFullScreen" ><span ><i class="nz-icon screen-icon" :class="{'nz-icon-maxview':!isFullScreen,'nz-icon-exit-full-screen':isFullScreen}"></i></span></div>
</div>
</div>
@@ -292,6 +293,7 @@
x: 0,
y: 0
},
searchTime:bus.getTimezontDateRange(),
}
},
filters: {
@@ -351,16 +353,21 @@
]
},
setFreshDataTimer:function(){
this.freshDataTimer=setInterval(()=>{
if(this.$refs.overviewLoading){
this.$refs.overviewLoading.startLoading();
}
// this.freshDataTimer=setInterval(()=>{
// if(this.$refs.overviewLoading){
// this.$refs.overviewLoading.startLoading();
// }
// Promise.all(this.initData()).then(()=>{
// if(this.$refs.overviewLoading){
// this.$refs.overviewLoading.endLoading();
// }
// })
// },5*60*1000)
Promise.all(this.initData()).then(()=>{
if(this.$refs.overviewLoading){
this.$refs.overviewLoading.endLoading();
}
})
},5*60*1000)
},
querySystemState:function(){
return new Promise(resolve => {
@@ -1584,7 +1591,7 @@
this.initData();
this.querySystemState().then(()=>{
this.initDate();
this.setFreshDataTimer();
// this.setFreshDataTimer();
})
// window.onresize = () => {