fix: overview trend指标更正、alert-rule显示用户

This commit is contained in:
chenjinsong
2020-05-06 15:23:00 +08:00
parent 2c59fef579
commit b460b3b6ea
4 changed files with 18 additions and 30 deletions

View File

@@ -785,9 +785,12 @@ li{
position: absolute; position: absolute;
left: -3px; left: -3px;
} }
.alert-message-tag { .alert-message-tag, .alert-rule-tag {
margin: 3px; margin: 3px;
} }
.alert-rule-tag {
cursor: default;
}
/* end--内容*/ /* end--内容*/
/* begin--右弹框滑入滑出动画*/ /* begin--右弹框滑入滑出动画*/

View File

@@ -521,7 +521,7 @@ const en = {
//列表表头 //列表表头
account: 'Account',//"用户" account: 'Account',//"用户"
language: 'Language',//"语言" language: 'Language',//"语言"
receiver: 'Account group',//"用户组" receiver: 'Receiver',//"用户组"
createTime: 'Create time',//"创建时间" createTime: 'Create time',//"创建时间"
enable: 'Available',//"可用" enable: 'Available',//"可用"
option: 'Operation',//"操作" option: 'Operation',//"操作"
@@ -723,7 +723,7 @@ const en = {
}, },
config: { config: {
name: 'Name',//"名称" name: 'Name',//"名称"
receiver: 'User group',//"用户组" receiver: 'Receiver',//"用户组"
expr: 'Expression',//"表达式" expr: 'Expression',//"表达式"
for: "For (s)",//For (s) for: "For (s)",//For (s)
link: 'Link',//'关联' link: 'Link',//'关联'

View File

@@ -63,19 +63,12 @@
<span style="padding-left: 18px;" v-if="scope.row[item.prop] == 'medium'">{{severityData[0].value}}</span> <span style="padding-left: 18px;" v-if="scope.row[item.prop] == 'medium'">{{severityData[0].value}}</span>
<span v-if="scope.row[item.prop] == 'low'"><i class="el-icon-arrow-down"></i>&nbsp;{{severityData[2].value}}</span> <span v-if="scope.row[item.prop] == 'low'"><i class="el-icon-arrow-down"></i>&nbsp;{{severityData[2].value}}</span>
</span> </span>
<!--<span v-else-if="item.prop == 'type'">
<template v-for="type in typeData" v-if="type.key == scope.row[item.prop]">{{type.value}}</template>
</span>
<template v-else-if="item.prop == 'linkObject'">
<span v-if="(scope.row['type'] == 1 || scope.row['type'] == 2) && scope.row[item.prop]" class="link too-long-split"
@click="viewAlertType(scope.row['type'],scope.row[item.prop])" style="max-width: 125px;">{{scope.row[item.prop].name}}</span>
<span v-else-if="scope.row['type'] == 3 && scope.row[item.prop]" class="link"
@click="viewAlertType(scope.row['type'],scope.row[item.prop].id)">{{scope.row[item.prop].host}}</span>
<span v-else>-</span>
</template>-->
<template v-else-if="item.prop == 'alertNum'"> <template v-else-if="item.prop == 'alertNum'">
<span class="link" @click="queryMessage(scope.row)">{{scope.row.alertNum + ' ' + $t('overall.active')}}</span> <span class="link" @click="queryMessage(scope.row)">{{scope.row.alertNum + ' ' + $t('overall.active')}}</span>
</template> </template>
<template v-else-if="item.prop == 'receivers'">
<el-tag effect="dark" v-if="user.userName" :key="index" size="mini" v-for="(user, index) in scope.row[item.prop]" class="alert-rule-tag">{{user.userName}}</el-tag>
</template>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span> <span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
<template v-else>-</template> <template v-else>-</template>
</template> </template>
@@ -185,7 +178,7 @@
severity: '', severity: '',
summary: '', summary: '',
description: '', description: '',
receiver: '', receivers: '',
}, },
tablelable: [], tablelable: [],
dropCol: [], dropCol: [],
@@ -263,11 +256,11 @@
prop: 'alertNum', prop: 'alertNum',
show: true, show: true,
width: 90 width: 90
}, /*{ }, {
label: this.$t('alert.config.receiver'), label: this.$t('alert.config.receiver'),
prop: 'receiver', prop: 'receivers',
show: true, show: true,
}, */{ }, {
label: this.$t('alert.config.option'), label: this.$t('alert.config.option'),
prop: 'option', prop: 'option',
show: true, show: true,
@@ -379,14 +372,6 @@
} }
}) })
}, },
updateReceiverName: function (item) {
//TODO 请求接口改名
var code = 200;
//this.$set(item, 'errorMessage', 'err');
item.errorMessage = '';
item.oldName = item.name;
return code;
},
cleanAlertRule: function () { cleanAlertRule: function () {
this.alertRule = { this.alertRule = {
id: '', id: '',
@@ -397,7 +382,7 @@
severity: '', severity: '',
summary: '', summary: '',
description: '', description: '',
receiver: '', receivers: '',
} }
}, },
jumpTo(data, id) { jumpTo(data, id) {

View File

@@ -456,7 +456,7 @@
if(response.status == 'success'){ if(response.status == 'success'){
if(response.data.result){ if(response.data.result){
let series={ let series={
name: 'ifHCInOctets', name: 'ifInOctets',
symbol:'none', //去掉点 symbol:'none', //去掉点
smooth:true, //曲线变平滑 smooth:true, //曲线变平滑
data: [], data: [],
@@ -479,7 +479,7 @@
if(response.status == 'success'){ if(response.status == 'success'){
if(response.data.result){ if(response.data.result){
let series={ let series={
name: 'ifHCOutOctets', name: 'ifOutOctets',
symbol:'none', //去掉点 symbol:'none', //去掉点
smooth:true, //曲线变平滑 smooth:true, //曲线变平滑
data: [], data: [],
@@ -519,10 +519,10 @@
let rule; let rule;
if (t == 'rx') { if (t == 'rx') {
metric = {rx: '"1"'}; metric = {rx: '"1"'};
rule = "ifHCInOctets"; rule = "ifInOctets";
} else if (t == 'tx') { } else if (t == 'tx') {
metric = {tx: '"1"'}; metric = {tx: '"1"'};
rule = "ifHCOutOctets"; rule = "ifOutOctets";
} }
if (this.trendSearchParam.select.length > 0) { if (this.trendSearchParam.select.length > 0) {
//console.info("select", this.trendSearchParam.select); //console.info("select", this.trendSearchParam.select);