NEZ-598 alert message 页面修改

This commit is contained in:
songjingcheng
2021-05-08 09:40:53 +08:00
parent d8f727e542
commit a8ced7e52b
86 changed files with 2099 additions and 1450 deletions

View File

@@ -5,7 +5,7 @@
"author": "", "author": "",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "node --max-old-space-size=6000 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js", "dev": "node --max-old-space-size=10240 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev", "start": "npm run dev",
"build": "node build/build.js", "build": "node build/build.js",
"lint": "eslint --fix --ext .js,.vue src" "lint": "eslint --fix --ext .js,.vue src"

View File

@@ -100,6 +100,10 @@
line-height: 20px; line-height: 20px;
font-weight: 400; font-weight: 400;
margin-top: 3px; margin-top: 3px;
max-width: 30%;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
} }
.timezone-offset{ .timezone-offset{
display: inline-block; display: inline-block;

View File

@@ -1,7 +1,8 @@
/*列表table通用样式*/ /*列表table通用样式*/
.list-page { .list-page {
background-color: #f6f6f6;
height: 100%; height: 100%;
width: 100%;
background-color: #f6f6f6;
.main-list { .main-list {
background-color: white; background-color: white;
@@ -9,6 +10,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
width: 100%;
z-index: 0; z-index: 0;
} }
.main-container { .main-container {
@@ -53,7 +55,10 @@
} }
.top-tool-btn-group { .top-tool-btn-group {
display: flex; display: flex;
.top-tool-btn:not(:last-of-type):not(:first-of-type) {
border-left: none;
border-radius: 0;
}
.top-tool-btn:first-of-type:not(:last-of-type) { .top-tool-btn:first-of-type:not(:last-of-type) {
border-radius: $--button-border-radius 0 0 $--button-border-radius; border-radius: $--button-border-radius 0 0 $--button-border-radius;
} }
@@ -190,7 +195,7 @@
.el-table { .el-table {
position: absolute; position: absolute;
width: calc(100% - 40px); width: calc(100% - 40px);
border: 1px solid #E7EAED; border: 1px solid $--right-box-border-color;
border-bottom: none; border-bottom: none;
.caret-wrapper { .caret-wrapper {
@@ -209,10 +214,10 @@
td { td {
padding: 9px 0; padding: 9px 0;
border-bottom: 1px solid #E7EAED; border-bottom: 1px solid $--right-box-border-color;
} }
th { th {
border-color: #E7EAED; border-color: $--right-box-border-color;
} }
.el-table__header th:first-of-type { .el-table__header th:first-of-type {
border-left: none; border-left: none;
@@ -221,7 +226,7 @@
position: fixed; position: fixed;
right: 31px; right: 31px;
height: 49px; height: 49px;
border-bottom: 1px solid #E7EAED; border-bottom: 1px solid $--right-box-border-color;
background-color: white; background-color: white;
} }
thead { thead {
@@ -284,7 +289,7 @@
} }
/* start--覆盖el-table边框、gutter等样式 */ /* start--覆盖el-table边框、gutter等样式 */
.el-table__body-wrapper, .el-table__fixed-body-wrapper { .el-table__body-wrapper, .el-table__fixed-body-wrapper {
box-shadow: 1px 0 #E7EAED; box-shadow: 1px 0 $--right-box-border-color;
.cell { .cell {
color: #333; color: #333;
@@ -298,20 +303,20 @@
} }
/* 最后一列用box-shadow模拟边框 */ /* 最后一列用box-shadow模拟边框 */
.el-table:not(.no-operation).el-table--border .el-table__body-wrapper td:nth-last-child(2) { .el-table:not(.no-operation).el-table--border .el-table__body-wrapper td:nth-last-child(2) {
box-shadow: 1px 0 #E7EAED; box-shadow: 1px 0 $--right-box-border-color;
} }
.el-table:not(.no-operation).el-table--border .el-table__header-wrapper th:nth-last-child(3) { .el-table:not(.no-operation).el-table--border .el-table__header-wrapper th:nth-last-child(3) {
border-right: none !important; border-right: none !important;
box-shadow: 1px 0 #E7EAED; box-shadow: 1px 0 $--right-box-border-color;
} }
.el-table__fixed-body-wrapper { .el-table__fixed-body-wrapper {
td:not(.is-hidden) { td:not(.is-hidden) {
border-left: 1px solid #E7EAED; border-left: 1px solid $--right-box-border-color;
} }
} }
.el-table__fixed-header-wrapper { .el-table__fixed-header-wrapper {
th:not(.is-hidden) { th:not(.is-hidden) {
border-left: 1px solid #E7EAED; border-left: 1px solid $--right-box-border-color;
} }
th:last-of-type { th:last-of-type {
border-right: none !important; border-right: none !important;

File diff suppressed because one or more lines are too long

View File

@@ -50,6 +50,8 @@ $--monitor-color: #98AEC5; //全局停用色灰色
warningColor: var(--theme-color); warningColor: var(--theme-color);
suspendedColor: $--suspended-color; suspendedColor: $--suspended-color;
monitorColor: $--monitor-color; monitorColor: $--monitor-color;
primaryBorderColor: $--primary-border-color;
rightBoxBorderColor: $--right-box-border-color;
} }
/* element-ui变量覆盖 */ /* element-ui变量覆盖 */
/*$--color-primary: red; // 覆盖element-ui的主题色 /*$--color-primary: red; // 覆盖element-ui的主题色

View File

@@ -1883,13 +1883,6 @@ li{
.nz-table .el-table__fixed-body-wrapper { .nz-table .el-table__fixed-body-wrapper {
height: calc(100% - 33px) !important; height: calc(100% - 33px) !important;
} }
.ant-table-scroll {
max-height: unset !important;
height: 100%;
}
.ant-table-scroll .el-table {
//height: 100% !important;
}
/*model侧滑中下拉框*/ /*model侧滑中下拉框*/
.autocomplete-dropdown { .autocomplete-dropdown {
display: flex; display: flex;
@@ -2073,27 +2066,6 @@ li{
line-height: 20px; line-height: 20px;
} }
.right-bottom-zoom{
position: absolute;
top: calc(100% - 100px);
left: calc(100% - 45px);
height: 90px;
width: 35px;
border: 1px solid #E7EAED;
box-shadow: -1px 1px 9px -1px rgba(205,205,205,0.77);
.zoom-option{
width: 100%;
height: 50%;
opacity: 0.42;
background: #FFF;
align-items: center;
display: flex;
justify-content: center;
}
.zoom-option:hover{
cursor: pointer;
}
}
.nz-icon-arrow-down{ .nz-icon-arrow-down{
font-size: 14px; font-size: 14px;
} }

View File

@@ -182,6 +182,7 @@ import chartDataFormat from './chartDataFormat'
import { randomcolor } from '../common/js/radomcolor/randomcolor.js' import { randomcolor } from '../common/js/radomcolor/randomcolor.js'
import chartAlertList from './chart-alert-list' import chartAlertList from './chart-alert-list'
import chartConfig from '../page/dashboard/overview/chartConfig' import chartConfig from '../page/dashboard/overview/chartConfig'
import moment from "moment-timezone";
export default { export default {
name: 'chartPreview', name: 'chartPreview',
components: { components: {
@@ -878,7 +879,8 @@ export default {
const tip = legend[item.seriesIndex] const tip = legend[item.seriesIndex]
const color = self.bgColorList[item.seriesIndex] const color = self.bgColorList[item.seriesIndex]
if (i === 0) { if (i === 0) {
const tData = new Date(item.data[0]) const value = bus.computeTimezone(item.data[0])
const tData = new Date(value)
str += [tData.getFullYear(), tData.getMonth() + 1, tData.getDate()].join('-') + ' ' + str += [tData.getFullYear(), tData.getMonth() + 1, tData.getDate()].join('-') + ' ' +
[tData.getHours(), tData.getMinutes(), tData.getSeconds()].join(':') [tData.getHours(), tData.getMinutes(), tData.getSeconds()].join(':')
str += '<br/>' str += '<br/>'

View File

@@ -199,6 +199,7 @@ import { randomcolor } from '../common/js/radomcolor/randomcolor.js'
import chartConfig from '../page/dashboard/overview/chartConfig' import chartConfig from '../page/dashboard/overview/chartConfig'
import { getChart, setChart, lineChartMove, getMousePoint } from '../common/js/common' import { getChart, setChart, lineChartMove, getMousePoint } from '../common/js/common'
import { getMetricTypeValue } from '../common/js/tools' import { getMetricTypeValue } from '../common/js/tools'
import moment from 'moment-timezone'
export default { export default {
name: 'lineChartBlock', name: 'lineChartBlock',
@@ -742,7 +743,7 @@ export default {
const tip = legend[item.seriesIndex] const tip = legend[item.seriesIndex]
const color = self.bgColorList[item.seriesIndex] const color = self.bgColorList[item.seriesIndex]
if (i === 0 && tip.alias.indexOf('Previous ') === -1) { if (i === 0 && tip.alias.indexOf('Previous ') === -1) {
const value = item.data[0] const value = bus.computeTimezone(item.data[0])
const tData = new Date(value) const tData = new Date(value)
str += '<div style="margin-bottom: 5px">' str += '<div style="margin-bottom: 5px">'
str += bus.timeFormate(tData) str += bus.timeFormate(tData)
@@ -752,7 +753,7 @@ export default {
if (i !== 0) { if (i !== 0) {
str += '<div style="border:1px dashed #333;width:100%;margin-top: 5px"></div>' str += '<div style="border:1px dashed #333;width:100%;margin-top: 5px"></div>'
} }
const value = item.data[0] - self.minusTime const value = bus.computeTimezone(item.data[0])
const tData = new Date(value) const tData = new Date(value)
str += '<div style="margin-bottom: 5px;margin-top: 5px">' str += '<div style="margin-bottom: 5px;margin-top: 5px">'
str += bus.timeFormate(tData) str += bus.timeFormate(tData)
@@ -834,7 +835,11 @@ export default {
show: true, show: true,
fontSize: 10, fontSize: 10,
formatter: function (value) { formatter: function (value) {
const tData = new Date(value) let offset = localStorage.getItem('nz-sys-timezone')
offset = moment.tz(offset).format('Z')
offset = Number.parseInt(offset)
const localOffset = new Date().getTimezoneOffset() * 60 * 1000 * -1 // 默认 一分钟显示时区偏移的结果
const tData = new Date(value - localOffset + offset * 60 * 60 * 1000)
let hour = tData.getHours() let hour = tData.getHours()
hour = hour > 9 ? hour : '0' + hour // 加0补充为两位数字 hour = hour > 9 ? hour : '0' + hour // 加0补充为两位数字
let minute = tData.getMinutes() let minute = tData.getMinutes()
@@ -1011,7 +1016,7 @@ export default {
const tip = self.legendMagicType[item.seriesIndex] const tip = self.legendMagicType[item.seriesIndex]
const color = self.bgColorList[item.seriesIndex] const color = self.bgColorList[item.seriesIndex]
if (i === 0) { if (i === 0) {
const value = item.data[0] const value = bus.computeTimezone(item.data[0])
const tData = new Date(value) const tData = new Date(value)
str += '<div style="margin-bottom: 5px">' str += '<div style="margin-bottom: 5px">'
str += bus.timeFormate(tData) str += bus.timeFormate(tData)
@@ -1179,7 +1184,7 @@ export default {
const tip = self.legendMagicType[item.seriesIndex] const tip = self.legendMagicType[item.seriesIndex]
const color = self.bgColorList[item.seriesIndex] const color = self.bgColorList[item.seriesIndex]
if (i === 0 && tip.alias.indexOf('Previous ') === -1) { if (i === 0 && tip.alias.indexOf('Previous ') === -1) {
const value = item.data[0] const value = bus.computeTimezone(item.data[0])
const tData = new Date(value) const tData = new Date(value)
str += '<div style="margin-bottom: 5px">' str += '<div style="margin-bottom: 5px">'
str += bus.timeFormate(tData) str += bus.timeFormate(tData)
@@ -1189,7 +1194,7 @@ export default {
if (i !== 0) { if (i !== 0) {
str += '<div style="border:1px dashed #333;width:100%;margin-top: 5px"></div>' str += '<div style="border:1px dashed #333;width:100%;margin-top: 5px"></div>'
} }
const value = item.data[0] - self.minusTime const value = bus.computeTimezone(item.data[0])
const tData = new Date(value) const tData = new Date(value)
str += '<div style="margin-bottom: 5px;margin-top: 5px">' str += '<div style="margin-bottom: 5px;margin-top: 5px">'
str += bus.timeFormate(tData) str += bus.timeFormate(tData)

View File

@@ -201,7 +201,7 @@
<el-form-item :label='$t("overall.asset")' prop="assetId" class="flex"> <el-form-item :label='$t("overall.asset")' prop="assetId" class="flex">
<v-selectpage <v-selectpage
style="flex: 1" style="flex: 1"
:data="assetData" data="asset/asset"
:tb-columns="columns" :tb-columns="columns"
key-field="id" key-field="id"
show-field="manageIp" show-field="manageIp"
@@ -835,11 +835,16 @@ export default {
}) })
}, },
resultFormat (resp) { resultFormat (resp) {
if (resp && resp.data) return resp.data.values.gridResult if (resp && resp.data) {
const assetData = {}
assetData.list = resp.data.list
assetData.totalRow = resp.data.total
return assetData
}
}, },
assetShowChange () { assetShowChange () {
this.assetShow = true this.assetShow = true
this.getAssetData() // this.getAssetData()
}, },
getAssetData () { getAssetData () {
this.assetLoading = true this.assetLoading = true

View File

@@ -20,6 +20,7 @@
<div class="sub-list__tabs"> <div class="sub-list__tabs">
<!--机柜--> <!--机柜-->
<cabinet-tab v-if="from === fromRoute.dc && targetTab === 'cabinet'" :tabs="tabs.dc.cabinet" v-show="subResizeShow" :obj="obj" @changeTab="changeTab"></cabinet-tab> <cabinet-tab v-if="from === fromRoute.dc && targetTab === 'cabinet'" :tabs="tabs.dc.cabinet" v-show="subResizeShow" :obj="obj" @changeTab="changeTab"></cabinet-tab>
<alertMessageTabNew v-if="from === fromRoute.dc && targetTab === 'alertMessageTab'" v-show="subResizeShow" :from="from" :obj="obj" :tabs="tabs.dc.alertMessage" :targetTab="targetTab" @changeTab="changeTab"></alertMessageTabNew>
<!--告警信息--> <!--告警信息-->
<alert-message-tab v-if="((from === fromRoute.alertRule || from === fromRoute.asset || from === fromRoute.endpoint || from === fromRoute.project ) && targetTab === 'alertMessage')" v-show="subResizeShow" :from="from" :obj="obj" @changeTab="changeTab"></alert-message-tab> <alert-message-tab v-if="((from === fromRoute.alertRule || from === fromRoute.asset || from === fromRoute.endpoint || from === fromRoute.project ) && targetTab === 'alertMessage')" v-show="subResizeShow" :from="from" :obj="obj" @changeTab="changeTab"></alert-message-tab>
<!--asset页的endpoint列表--> <!--asset页的endpoint列表-->
@@ -172,11 +173,18 @@ export default {
dc: { dc: {
cabinet: [ cabinet: [
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true }, { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: true },
{ prop: 'asset', name: this.$t('asset.assets'), active: false } { prop: 'asset', name: this.$t('asset.assets'), active: false },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }
], ],
asset: [ asset: [
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false }, { prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false },
{ prop: 'asset', name: this.$t('asset.assets'), active: true } { prop: 'asset', name: this.$t('asset.assets'), active: true },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false }
],
alertMessage: [
{ prop: 'cabinet', name: this.$t('config.dc.cabinets'), active: false },
{ prop: 'asset', name: this.$t('asset.assets'), active: false },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true }
] ]
} }

View File

@@ -56,7 +56,7 @@ export default {
}, },
data () { data () {
return { return {
url: '/cabinet', url: 'dc/cabinet',
tableId: 'cabinetTable', tableId: 'cabinetTable',
blankObject: { blankObject: {
id: '', id: '',
@@ -92,6 +92,9 @@ export default {
} }
} }
}, },
created() {
console.log(this.$route);
},
methods: { methods: {
// 切换tab // 切换tab
changeTab (tab) { changeTab (tab) {

View File

@@ -89,7 +89,7 @@ export const asset = {
non: 0, non: 0,
ssh: 1, ssh: 1,
telnet: 2 telnet: 2
}, }
}, },
authProtocolOptions: [ authProtocolOptions: [
{ value: 1, label: 'SSH' }, { value: 1, label: 'SSH' },

View File

@@ -2,6 +2,7 @@ import { getChart } from './common'
import MessageBox from 'element-ui/packages/message-box/src/main' import MessageBox from 'element-ui/packages/message-box/src/main'
import i18n from '../i18n' import i18n from '../i18n'
import bus from '@/libs/bus' import bus from '@/libs/bus'
import moment from 'moment-timezone'
/* 弹窗点击外部后关闭 */ /* 弹窗点击外部后关闭 */
const exceptClassName = ['prevent-clickoutside', 'config-dropdown', 'nz-pop', 'el-picker', 'chart-box-dropdown', 'metric-dropdown', 'el-cascader__dropdown', 'no-style-class', 'el-message-box', 'nz-dashboard-dropdown', 'el-autocomplete-suggestion', 'nz-temp-box', 'el-time-panel'] // clickoutside排除的class(白名单) no-style-class没有任何样式的class const exceptClassName = ['prevent-clickoutside', 'config-dropdown', 'nz-pop', 'el-picker', 'chart-box-dropdown', 'metric-dropdown', 'el-cascader__dropdown', 'no-style-class', 'el-message-box', 'nz-dashboard-dropdown', 'el-autocomplete-suggestion', 'nz-temp-box', 'el-time-panel'] // clickoutside排除的class(白名单) no-style-class没有任何样式的class
export const clickoutside = { export const clickoutside = {
@@ -281,7 +282,13 @@ export const bottomBoxWindow = {
} }
} }
export function stringTimeParseToUnix (stringTime) { export function stringTimeParseToUnix (stringTime) {
const time = new Date(stringTime).getTime() let time = new Date(stringTime).getTime()
let offset = localStorage.getItem('nz-sys-timezone')
offset = moment.tz(offset).format('Z')
offset = Number.parseInt(offset)
const localOffset = new Date().getTimezoneOffset() * 60 * 1000 * -1 // 默认 一分钟显示时区偏移的结果
console.log(offset,localOffset, time)
time = time + localOffset - offset * 60 * 60 * 1000
return time / 1000 return time / 1000
} }
export function getTime (size, unit) { // 计算时间 export function getTime (size, unit) { // 计算时间

View File

@@ -212,7 +212,7 @@ export default {
justify-content: space-between; justify-content: space-between;
padding: 15px 0 15px 17px; padding: 15px 0 15px 17px;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #E7EAED; border: 1px solid $--right-box-border-color;
background-color: #FFFFFF; background-color: #FFFFFF;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;

View File

@@ -2,6 +2,7 @@ import zhLocale from 'element-ui/lib/locale/lang/zh-CN' // 引入element语言
const cn = { const cn = {
overall: { overall: {
dashboard: '仪表盘', dashboard: '仪表盘',
dc: '数据中心',
project: '系统', project: '系统',
monitor: '监控', monitor: '监控',
alert: '告警', alert: '告警',
@@ -289,7 +290,7 @@ const cn = {
tooltip: 'Tooltip', tooltip: 'Tooltip',
displayChart: '图表', displayChart: '图表',
aggregation: 'Aggregation', aggregation: 'Aggregation',
varType: 'Vartype', varType: 'Variable type',
pid: 'Chart 模板', pid: 'Chart 模板',
selectAsset: '请选择Asset', selectAsset: '请选择Asset',
selectEndpoint: '请选择Endpoint' selectEndpoint: '请选择Endpoint'
@@ -515,6 +516,7 @@ const cn = {
}, },
asset: { asset: {
asset: '资产', asset: '资产',
alertNum: '资产编号',
assetType: '资产类型', // '资产类型' assetType: '资产类型', // '资产类型'
batchEditAsset: '批量修改资产', batchEditAsset: '批量修改资产',
selectAsset: '已选择的资产', selectAsset: '已选择的资产',
@@ -677,6 +679,14 @@ const cn = {
type: 'Agent类型' type: 'Agent类型'
} }
}, },
agent:{
name: '名称',
type: '类型',
createProm: '创建代理服务',
agent: {
agent: '代理'
}
},
terminallog: { terminallog: {
terminallog: '终端日志', terminallog: '终端日志',
status: '状态', status: '状态',
@@ -745,6 +755,7 @@ const cn = {
assets: '资产', assets: '资产',
remark: '备注', remark: '备注',
cabinets: '机柜', cabinets: '机柜',
alert: '警报',
traffic: { traffic: {
title: '流量配置', title: '流量配置',
add: '添加', add: '添加',
@@ -769,7 +780,7 @@ const cn = {
model: { model: {
model: '资产型号', model: '资产型号',
name: '资产型号', name: '资产型号',
barnd: '品牌', brand: '品牌',
ChartTemplate: '图表模板', ChartTemplate: '图表模板',
assetNum: '资产编号', assetNum: '资产编号',
editModel: '编辑型号', editModel: '编辑型号',
@@ -827,7 +838,8 @@ const cn = {
auth: '认证', auth: '认证',
method: '方式', method: '方式',
encryption: '加密', encryption: '加密',
pin: '密码' pin: '密码',
create: '创建SNMP'
} }
}, },
system: { system: {
@@ -969,6 +981,7 @@ const cn = {
assetLabel: { assetLabel: {
example: '示例', example: '示例',
assetLabel: '资产标签', assetLabel: '资产标签',
addMeta: '创建标签',
all: '全部', all: '全部',
addGroup: '创建分组', addGroup: '创建分组',
editGroup: '编辑分组', editGroup: '编辑分组',
@@ -1027,18 +1040,20 @@ const cn = {
create: '创建表达式模板', create: '创建表达式模板',
expressionError: '请填写表达式', expressionError: '请填写表达式',
type: 'Type', type: 'Type',
varType: 'varType' varType: 'Variable type'
}, },
chartTemp: { chartTemp: {
chartTemp: 'Chart 模板', chartTemp: 'Chart 模板',
type: 'Type', type: 'Type',
varType: 'varType' varType: 'Variable type'
} }
}, },
alert: { alert: {
alert: '告警', alert: '告警',
message: '告警信息', message: '告警信息',
alertMessage: '告警信息',
rule: '告警规则', rule: '告警规则',
alertRule: '告警规则',
alertList: '告警信息', alertList: '告警信息',
alertConfig: '告警规则', alertConfig: '告警规则',
alertName: '告警名称', alertName: '告警名称',
@@ -1092,11 +1107,12 @@ const cn = {
} }
}, },
silence: { silence: {
name:'名称',
silence: '告警静默', silence: '告警静默',
create: '创建告警静默', create: '创建告警静默',
edit: '修改告警静默', edit: '修改告警静默',
time: '时间', time: '时间',
matcher: 'Matcher', matchers: 'matchers',
reason: '描述', reason: '描述',
selectTime: '请选择时间', selectTime: '请选择时间',
selectMather: '必填项', selectMather: '必填项',

View File

@@ -52,23 +52,23 @@ const en = {
unavailable: 'Unavailable', unavailable: 'Unavailable',
available: 'Available', available: 'Available',
changePin: 'Change password', // 修改密码 changePin: 'Change password', // 修改密码
createChart: 'Create chart', createChart: 'New chart',
createProject: 'Create project', createProject: 'New project',
createEndpoint: 'Create endpoint', createEndpoint: 'New endpoint',
batchEndpoint: 'Batch modify endpoint', batchEndpoint: 'Batch modify endpoint',
createAsset: 'Create asset', createAsset: 'New asset',
createAlertRule: 'Create alert rule', createAlertRule: 'New alert rule',
createUser: 'Create user', createUser: 'New user',
createRole: 'Create role', createRole: 'New role',
createPrometheusServer: 'Create prometheus server', createPrometheusServer: 'New prometheus server',
createDatacenter: 'Create Data center', createDatacenter: 'New Data center',
createCabinet: 'Create cabinet', createCabinet: 'New cabinet',
createModel: 'Create model', createModel: 'New model',
createModule: 'Create module', createModule: 'New module',
createMib: 'Create MIB', createMib: 'New MIB',
createAssetType: 'Create asset type', createAssetType: 'New asset type',
createAssetState: 'Create asset state', createAssetState: 'New asset state',
createTemplate: 'Create template', createTemplate: 'New template',
exportExcel: 'Export', exportExcel: 'Export',
importExcel: 'Import', importExcel: 'Import',
importExcelLower: 'import', importExcelLower: 'import',
@@ -210,7 +210,7 @@ const en = {
panelId: 'ID' // ID panelId: 'ID' // ID
}, },
// 图表-侧滑框 // 图表-侧滑框
createChartTitle: 'New chart', // "新增图表" createChartTitle: 'New chart template', // "新增图表"
editChartTitle: 'Edit', // "编辑图表" editChartTitle: 'Edit', // "编辑图表"
chartForm: { chartForm: {
chartId: 'ID', chartId: 'ID',
@@ -299,7 +299,7 @@ const en = {
tooltip: 'Tooltip', tooltip: 'Tooltip',
displayChart: 'Display chart', displayChart: 'Display chart',
aggregation: 'Aggregation', aggregation: 'Aggregation',
varType: 'Vartype', varType: 'Variable type',
pid: 'Chart template', pid: 'Chart template',
selectAsset: 'Please select the Asset', selectAsset: 'Please select the Asset',
selectEndpoint: 'Please select the Endpoint' selectEndpoint: 'Please select the Endpoint'
@@ -614,7 +614,7 @@ const en = {
roles: 'Role', roles: 'Role',
language: 'Language', // "语言" language: 'Language', // "语言"
receiver: 'Receiver', // "用户组" receiver: 'Receiver', // "用户组"
createTime: 'Create time', // "创建时间" createTime: 'New time', // "创建时间"
enable: 'Enable', // "可用" enable: 'Enable', // "可用"
option: 'Operation', // "操作" option: 'Operation', // "操作"
lastLoginTime: 'Last login time', // 最后登录时间 lastLoginTime: 'Last login time', // 最后登录时间
@@ -645,7 +645,7 @@ const en = {
option: 'Operation', // "操作" option: 'Operation', // "操作"
permission: 'Permission', permission: 'Permission',
menu: 'Menu', menu: 'Menu',
createRole: 'Create role', createRole: 'New role',
editRole: 'Edit role', editRole: 'Edit role',
remark: 'Remark' remark: 'Remark'
}, },
@@ -664,7 +664,7 @@ const en = {
tab: 'Tab', tab: 'Tab',
parent: 'Previous menu', parent: 'Previous menu',
mainMenu: 'Primary menu', mainMenu: 'Primary menu',
createMenu: 'Create menu', createMenu: 'New menu',
editMenu: 'Edit menu', editMenu: 'Edit menu',
orderNum: 'Order', orderNum: 'Order',
icon: 'Icon' icon: 'Icon'
@@ -677,6 +677,7 @@ const en = {
type: 'Type', // "类别" type: 'Type', // "类别"
checkTime: 'Check time', checkTime: 'Check time',
dataCenter: 'Data center', dataCenter: 'Data center',
name : 'Name',
agent: { agent: {
agent: 'Agent', agent: 'Agent',
title: 'Download agent', title: 'Download agent',
@@ -695,9 +696,10 @@ const en = {
assets: 'Assets', assets: 'Assets',
remark: 'Remark', remark: 'Remark',
cabinets: 'Cabinets', cabinets: 'Cabinets',
createDc: 'Create data center', createDc: 'Nre data center',
editDc: 'Edit data center', editDc: 'Edit data center',
editCabinet: 'Edit cabinet', editCabinet: 'Edit cabinet',
alert: 'Alert',
traffic: { traffic: {
title: 'Traffic Setting', title: 'Traffic Setting',
add: 'Add', add: 'Add',
@@ -714,16 +716,16 @@ const en = {
}, },
cabinet: { cabinet: {
editCabinet: 'Edit Cabinet', editCabinet: 'Edit Cabinet',
createCabinet: 'Create Cabinet' createCabinet: 'New Cabinet'
}, },
model: { model: {
model: 'Asset model', model: 'Asset model',
brand: 'Brand', brand: 'Brand',
name: 'Name', name: 'Name',
ChartTemplate: 'ChartTemplate', ChartTemplate: 'Chart template',
assetNum: 'AssetNum', assetNum: 'Asset',
editModel: 'Edit model', editModel: 'Edit model',
createModel: 'Add model', createModel: 'New model',
remark: 'Description', remark: 'Description',
type: 'Type' type: 'Type'
}, },
@@ -826,7 +828,7 @@ const en = {
editMib: 'Edit MIB', editMib: 'Edit MIB',
models: 'Models', models: 'Models',
modelTip: 'Please select models', modelTip: 'Please select models',
createMib: 'Create MIB', createMib: 'New MIB',
mibFiles: 'MIB file', mibFiles: 'MIB file',
uploadTip: 'Please upload MIB file', uploadTip: 'Please upload MIB file',
requiredMibFile: 'MIB file is required', requiredMibFile: 'MIB file is required',
@@ -946,7 +948,7 @@ const en = {
nameMaxLength: 'The length should be less than 64', nameMaxLength: 'The length should be less than 64',
uriRequired: 'Required', uriRequired: 'Required',
filePathReg: 'Please enter the correct file path', filePathReg: 'Please enter the correct file path',
create: 'Create notification', create: 'New notification',
invalid: 'Invalid', invalid: 'Invalid',
valid: 'Valid' valid: 'Valid'
}, },
@@ -980,28 +982,28 @@ const en = {
authProtocol:'AuthProtocol', authProtocol:'AuthProtocol',
snmpEnable: 'SnmpEnable', snmpEnable: 'SnmpEnable',
snmpCollect:'SnmpCollect', snmpCollect:'SnmpCollect',
createModel:'Add Type', createModel:'New Type',
sshCollect:'SshCollect', sshCollect:'SshCollect',
sshCollectScript:'SshCollectScript', sshCollectScript:'SshCollectScript',
parent: 'Parent', parent: 'Parent',
pname: 'Parent name', pname: 'Parent name',
editAssetType: 'Edit asset type', editAssetType: 'Edit asset type',
createAssetType: 'Create asset type' createAssetType: 'New asset type'
}, },
assetState: { assetState: {
assetState: 'Asset State', assetState: 'Asset State',
monitor: 'Monitor', monitor: 'Monitor',
alert: 'Alert', alert: 'Alert',
assetTotal: 'Total assets', assetTotal: 'Total assets',
createAssetState: 'Create asset state', createAssetState: 'New asset state',
editAssetState: 'Edit asset state' editAssetState: 'Edit asset state'
}, },
assetLabel: { assetLabel: {
addMeta:'Add lables', addMeta: 'Add labels',
example: 'Example', example: 'Example',
assetLabel: 'Asset labels', assetLabel: 'Asset labels',
all: 'All', all: 'All',
addGroup: 'Create group', addGroup: 'Add group',
editGroup: 'Edit group', editGroup: 'Edit group',
addLabel: 'Create label', addLabel: 'Create label',
editLabel: 'Edit label', editLabel: 'Edit label',
@@ -1058,12 +1060,12 @@ const en = {
create: 'New expression template', create: 'New expression template',
expressionError: 'Please fill in the "expression" value', expressionError: 'Please fill in the "expression" value',
type: 'Type', type: 'Type',
varType: 'varType' varType: 'Variable type'
}, },
chartTemp: { chartTemp: {
chartTemp: 'Chart template', chartTemp: 'Chart template',
type: 'Type', type: 'Type',
varType: 'varType' varType: 'Variable type'
} }
}, },
alert: { alert: {
@@ -1072,7 +1074,7 @@ const en = {
rule: 'Rule', // '规则' rule: 'Rule', // '规则'
alertMessage: 'Alert message', // "告警信息" alertMessage: 'Alert message', // "告警信息"
alertRule: 'Alert rule', // "告警规则" alertRule: 'Alert rule', // "告警规则"
alertName: 'Alert name', // "告警名称" alertName: 'Name', // "告警名称"
severity: 'Priority', // "等级" severity: 'Priority', // "等级"
description: 'Description', // "描述" description: 'Description', // "描述"
summary: 'Summary', // "概要" summary: 'Summary', // "概要"
@@ -1122,14 +1124,15 @@ const en = {
alertRuleInfo: 'Alert rule information', alertRuleInfo: 'Alert rule information',
alertNumTrend: 'Alert num trend', alertNumTrend: 'Alert num trend',
affectEntity: 'Affect entity' affectEntity: 'Affect entity'
} },
}, },
silence: { silence: {
name:'Name',
silence: 'Alert silence', silence: 'Alert silence',
create: 'New alert silence', create: 'New alert silence',
edit: 'Edit alert silence', edit: 'Edit alert silence',
time: 'Time', time: 'Time',
matcher: 'Matcher', matchers: 'matchers',
reason: 'Description', reason: 'Description',
selectTime: 'Please select time', selectTime: 'Please select time',
selectMather: 'Required', selectMather: 'Required',
@@ -1180,7 +1183,7 @@ const en = {
alerts: 'Alerts', alerts: 'Alerts',
asset: 'Asset', asset: 'Asset',
editEndpoint: 'Edit endpoint', editEndpoint: 'Edit endpoint',
createEndpoint: 'Created endpoint', createEndpoint: 'New endpoint',
batchEndpoint: 'Batch Endpoint', batchEndpoint: 'Batch Endpoint',
endpointName: 'Endpoint name', endpointName: 'Endpoint name',
tip: { tip: {

View File

@@ -64,6 +64,7 @@ export default {
this.$emit('showBottomBox', targetTab, JSON.parse(JSON.stringify(row))) this.$emit('showBottomBox', targetTab, JSON.parse(JSON.stringify(row)))
}, },
tableDataSort (item) { tableDataSort (item) {
console.log(item)
let orderBy = '' let orderBy = ''
if (item.order === 'ascending') { if (item.order === 'ascending') {
orderBy = item.prop orderBy = item.prop
@@ -71,6 +72,7 @@ export default {
if (item.order === 'descending') { if (item.order === 'descending') {
orderBy = '-' + item.prop orderBy = '-' + item.prop
} }
console.log(orderBy)
this.$emit('orderBy', orderBy) this.$emit('orderBy', orderBy)
} }
} }

View File

@@ -169,8 +169,8 @@
</div> </div>
</div> </div>
<div class="el-picker-panel__footer" v-if="showTime"> <div class="el-picker-panel__footer" v-if="showTime">
<span class="timezone-area">{{timezone}}</span> <span class="timezone-area" :title='timezone'>{{timezone}}</span>
<span class="timezone-offset">{{timezoneOffset}}</span> <span class="timezone-offset">UTC {{timezoneOffset}}</span>
<!-- <el-button--> <!-- <el-button-->
<!-- size="mini"--> <!-- size="mini"-->
<!-- type="text"--> <!-- type="text"-->

View File

@@ -123,8 +123,8 @@
<div <div
class="el-picker-panel__footer" class="el-picker-panel__footer"
v-show="footerVisible && currentView === 'date'"> v-show="footerVisible && currentView === 'date'">
<span class="timezone-area">{{timezone}}</span> <span class="timezone-area" :title='timezone'>{{timezone}}</span>
<span class="timezone-offset">{{timezoneOffset}}</span> <span class="timezone-offset">UTC {{timezoneOffset}}</span>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"

View File

@@ -73,8 +73,8 @@
</div> </div>
</div> </div>
<div class="el-picker-panel__footer" v-if="showTime"> <div class="el-picker-panel__footer" v-if="showTime">
<span class="timezone-area">{{timezone}}</span> <span class="timezone-area" :title='timezone'>{{timezone}}</span>
<span class="timezone-offset">{{timezoneOffset}}</span> <span class="timezone-offset">UTC {{timezoneOffset}}</span>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -41,8 +41,8 @@
</div> </div>
</div> </div>
<div class="el-time-panel__footer"> <div class="el-time-panel__footer">
<span class="timezone-area">{{timezone}}</span> <span class="timezone-area" :title='timezone'>{{timezone}}</span>
<span class="timezone-offset">{{timezoneOffset}}</span> <span class="timezone-offset">UTC {{timezoneOffset}}</span>
<button <button
type="button" type="button"
class="el-time-panel__btn cancel" class="el-time-panel__btn cancel"

View File

@@ -16,8 +16,8 @@
</time-spinner> </time-spinner>
</div> </div>
<div class="el-time-panel__footer"> <div class="el-time-panel__footer">
<!-- <span class="timezone-area">{{timezone}}</span>--> <!-- <span class="timezone-area" :title='timezone'>{{timezone}}</span>-->
<!-- <span class="timezone-offset">{{timezoneOffset}}</span>--> <!-- <span class="timezone-offset">UTC {{timezoneOffset}}</span>-->
<button <button
type="button" type="button"
class="el-time-panel__btn cancel" class="el-time-panel__btn cancel"

View File

@@ -22,15 +22,15 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--iconToolState--> <!-- &lt;!&ndash;iconToolState&ndash;&gt;-->
<el-form-item :label="'Icon state'" class="half-form-item" prop="type" v-if="!selection.pen.type"> <!-- <el-form-item :label="'Icon state'" class="half-form-item" prop="type" v-if="!selection.pen.type">-->
<el-switch <!-- <el-switch-->
v-model="selection.pen.data.iconToolState" <!-- v-model="selection.pen.data.iconToolState"-->
:active-value="true" <!-- :active-value="true"-->
:inactive-value="false" <!-- :inactive-value="false"-->
active-color="#ee9d3f" <!-- active-color="#ee9d3f"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<!--metric--> <!--metric-->
<div class="right-box-sub-title" style="margin-bottom: 10px"> <div class="right-box-sub-title" style="margin-bottom: 10px">
@@ -57,7 +57,7 @@
:from-father-data="true" :from-father-data="true"
@removeExpression="removeExpression" @removeExpression="removeExpression"
></promql-input> ></promql-input>
<el-row> <el-row style="margin-top: 10px">
<template> <template>
<el-col class="legend-title"> <el-col class="legend-title">
{{$t('dashboard.panel.chartForm.legend')}}&nbsp; {{$t('dashboard.panel.chartForm.legend')}}&nbsp;
@@ -1579,6 +1579,12 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .metric-selector-input-box{
width: calc(100% - 120px) !important;
}
/deep/ .query-row .input-box{
margin: 0;
}
.legend-title{ .legend-title{
width: 100px; width: 100px;
margin-right: 10px; margin-right: 10px;
@@ -1718,20 +1724,9 @@ export default {
padding: 2px 6px; padding: 2px 6px;
color: #EC7F66; color: #EC7F66;
} }
/*.form-row-item .nz-icon-minus-position { .form-row-item .nz-icon-minus-position {
position: absolute; right: -44px;
top: 50%; }
right: -55px;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background: rgba(236, 127, 102, 0.1);
border-radius: 4px;
padding: 0 5px;
.nz-icon-minus {
color: #EC7F66;
}
}*/
.tooltip-box { .tooltip-box {
padding-left: 10px; padding-left: 10px;

File diff suppressed because it is too large Load Diff

View File

@@ -33,7 +33,7 @@
</el-form-item> </el-form-item>
<!--authProtocol--> <!--authProtocol-->
<el-form-item :label='$t("config.assetType.authProtocol")' prop="authProtocol"> <el-form-item :label='$t("config.assetType.authProtocol")' prop="authProtocol">
<el-select class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" v-model="editAssetType.authProtocol" placeholder="请选择"> <el-select class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" v-model="editAssetType.authProtocol" placeholder="Please select">
<el-option :key="option.value" v-for="option in assetConstants.assetType.authProtocolOptions" :value="option.value" :label="option.label"></el-option> <el-option :key="option.value" v-for="option in assetConstants.assetType.authProtocolOptions" :value="option.value" :label="option.label"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>

View File

@@ -22,17 +22,20 @@
<!-- ChartTemplate --> <!-- ChartTemplate -->
<el-form-item :label="$t('config.model.ChartTemplate')" prop="ChartTemplate"> <el-form-item :label="$t('config.model.ChartTemplate')" prop="ChartTemplate">
<v-selectpage <v-selectpage
:data="chartlList" :data="'visual/panel/chart'"
:tb-columns="ChartSearchShowFields" :tb-columns="ChartSearchShowFields"
:params="{
varType: 1, panelId: 0
}"
:multiple="true" :multiple="true"
language="en" language="en"
title="ChartSearch" title="ChartSearch"
placeholder="Please select item"
key-field="id" key-field="id"
v-model="editModel.chartIds" v-model="editModel.chartIds"
show-field="name" show-field="name"
class="form-control" class="form-control"
@values="(data) => {editModel.chartIds = data.map(d => d.id).join(',')}" @values="(data) => {editModel.chartIds = data.map(d => d.id).join(',')}"
:result-format="resultFormat"
></v-selectpage> ></v-selectpage>
</el-form-item> </el-form-item>
<!--remark--> <!--remark-->
@@ -80,17 +83,17 @@ export default {
editModule: {}, editModule: {},
chartlList: [], // chart 列表数据 chartlList: [], // chart 列表数据
ChartSearchShowFields: [ // ChartSearch 下拉搜索表头 ChartSearchShowFields: [ // ChartSearch 下拉搜索表头
{ title: 'id', data: 'id' }, { title: 'ID', data: 'id' },
{ title: 'name', data: 'name' }, { title: 'Name', data: 'name' },
{ title: 'desc', data: 'type' }, { title: 'Type', data: 'type' },
{ title: 'Description', data: 'Description' } { title: 'Description', data: 'remark' }
], ],
url: 'asset/model', url: 'asset/model',
brandUrl: 'asset/brand', brandUrl: 'asset/brand',
rightBox: { model: { show: false } }, rightBox: { model: { show: false } },
roles: [], roles: [],
rules: { rules: {
model: [ name: [
{ required: true, message: '必填', trigger: 'blur' } { required: true, message: '必填', trigger: 'blur' }
], ],
brandId: [ brandId: [
@@ -110,7 +113,7 @@ export default {
}, },
created () { created () {
this.getBrandList() this.getBrandList()
this.ChartTemplateList() // this.ChartTemplateList()
}, },
methods: { methods: {
clickOutside () { clickOutside () {
@@ -186,12 +189,20 @@ export default {
}) })
}) })
}, },
/* 获取chart列表数据 */ resultFormat (resp) {
ChartTemplateList () { if (resp && resp.data) {
this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0 }).then(res => { const assetData = {}
this.chartlList = res.data.list assetData.list = resp.data.list
}) assetData.totalRow = resp.data.total
return assetData
}
} }
/* 获取chart列表数据 */
// ChartTemplateList () {
// this.$get('visual/panel/chart', { pageSize: -1, varType: 1, panelId: 0 }).then(res => {
// this.chartlList = res.data.list
// })
// }
} }
} }
</script> </script>

View File

@@ -59,7 +59,6 @@ export default {
detail: Boolean detail: Boolean
}, },
data () { data () {
const vm = this
return { return {
editRole: {}, editRole: {},
url: 'sys/role', url: 'sys/role',

View File

@@ -2,7 +2,7 @@
<div v-clickoutside="{obj:editPromServer,func:clickOutside}" class="right-box right-box-prom"> <div v-clickoutside="{obj:editPromServer,func:clickOutside}" class="right-box right-box-prom">
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box__header"> <div class="right-box__header">
<div class="right-box__header">{{editPromServer.id ? ($t("config.promServer.editProm") + " ID" + editPromServer.id) : $t("config.promServer.createProm")}}</div> <div class="header__title">{{editPromServer.id ? ($t("config.agent.editProm") + " ID" + editPromServer.id) : $t("config.agent.createProm")}}</div>
<div class="header__operation"> <div class="header__operation">
<span v-cancel="{obj: editPromServer, func: esc}"><i class="nz-icon nz-icon-close"></i></span> <span v-cancel="{obj: editPromServer, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
</div> </div>
@@ -11,9 +11,9 @@
<!-- begin--表单--> <!-- begin--表单-->
<div class="right-box__container"> <div class="right-box__container">
<div class="container__form"> <div class="container__form">
<el-form ref="promServerForm" :model="editPromServer" :rules="rules" label-position = "top" label-width="120px"> <el-form ref="agentForm" :model="editPromServer" :rules="rules" label-position = "top" label-width="120px">
<!--DC--> <!--DC-->
<el-form-item :label="$t('config.dc.dc')" prop="dc.name"> <el-form-item :label="$t('config.agent.name')" prop="name">
<div class="right-box-form-content"> <div class="right-box-form-content">
<el-select id="prom-box-input-dc" v-model="editPromServer.dc" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id"> <el-select id="prom-box-input-dc" v-model="editPromServer.dc" placeholder="" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" value-key="id">
<el-option v-for="item in dcData" :id="'prom-edit-dc-op-'+item.id" :key="item.id" :label="item.name" :value="item"> <el-option v-for="item in dcData" :id="'prom-edit-dc-op-'+item.id" :key="item.id" :label="item.name" :value="item">
@@ -32,14 +32,14 @@
<el-input id="prom-box-input-port" v-model.number="editPromServer.port" placeholder="" size="small" type="text"></el-input> <el-input id="prom-box-input-port" v-model.number="editPromServer.port" placeholder="" size="small" type="text"></el-input>
</el-form-item> </el-form-item>
<!--type--> <!--type-->
<el-form-item :label="$t('config.promServer.type')" prop="type"> <el-form-item :label="$t('config.agent.type')" prop="type">
<!-- <el-cascader--> <!-- <el-cascader-->
<!-- id="prom-box-input-type"--> <!-- id="prom-box-input-type"-->
<!-- style="width: 100%"--> <!-- style="width: 100%"-->
<!-- v-model="editPromServer.type"--> <!-- v-model="editPromServer.type"-->
<!-- placeholder=""--> <!-- placeholder=""-->
<!-- size="small"--> <!-- size="small"-->
<!-- :options="$CONSTANTS.promServer.theData"--> <!-- :options="$CONSTANTS.agent.theData"-->
<!-- :props="{ multiple: false, checkStrictly: false ,emitPath:false}"--> <!-- :props="{ multiple: false, checkStrictly: false ,emitPath:false}"-->
<!-- clearable></el-cascader>--> <!-- 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-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">
@@ -77,7 +77,7 @@ import { agent2 } from '@/components/common/js/constants'
export default { export default {
name: 'agentBox', name: 'agentBox',
props: { props: {
promServer: Object agent: Object
}, },
data () { data () {
return { return {
@@ -127,11 +127,11 @@ export default {
}, },
/* 保存 */ /* 保存 */
save () { save () {
this.$refs.promServerForm.validate(valid => { this.$refs.agentForm.validate(valid => {
if (valid) { if (valid) {
this.prevent_opt.save = true this.prevent_opt.save = true
if (this.editPromServer.id) { if (this.editPromServer.id) {
this.$put('promServer', this.editPromServer).then(response => { this.$put('agent', this.editPromServer).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.esc(true) this.esc(true)
@@ -141,7 +141,7 @@ export default {
this.prevent_opt.save = false this.prevent_opt.save = false
}) })
} else { } else {
this.$post('promServer', this.editPromServer).then(response => { this.$post('agent', this.editPromServer).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
this.esc(true) this.esc(true)
@@ -163,7 +163,7 @@ export default {
cancelButtonText: this.$t('tip.no'), cancelButtonText: this.$t('tip.no'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$delete('promServer?ids=' + this.editPromServer.id).then(response => { this.$delete('agent?ids=' + this.editPromServer.id).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.deleteSuccess') }) this.$message({ duration: 1000, type: 'success', message: this.$t('tip.deleteSuccess') })
this.esc(true) this.esc(true)
@@ -184,7 +184,7 @@ export default {
}, },
watch: { watch: {
// 将prop里的user转为组件内部对象 // 将prop里的user转为组件内部对象
promServer: { agent: {
immediate: true, immediate: true,
deep: true, deep: true,
handler (n) { handler (n) {

View File

@@ -57,24 +57,16 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<!--severity--> <!--severity-->
<el-form-item :label="$t('alert.severity')" prop="severity"> <el-form-item :label="$t('alert.severity')" prop="severity" class="severity-box">
<el-select id="alert-box-input-severity" v-model="editAlertRule.severity" placeholder="" popper-class="config-dropdown" size="small"> <el-select id="alert-box-input-severity" v-model="editAlertRule.severityId" placeholder="" popper-class="config-dropdown severity-box" size="small">
<el-option v-for="item in $CONSTANTS.alertMessage.severityData" :id="'alert-severity-'+item.value" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in severityData" :id="'alert-severity-'+item.value" :key="item.id" :label="item.name" :value="item.id">
<template v-if="!item.isEdit">{{item.label}}</template> <span>
<span v-if="item.isEdit" class="config-dropdown-label-input" @click.stop> <i class="nz-icon nz-icon-circle" :style="{color:item.color,'font-size':'12px'}"></i> {{item.name}}
<el-input v-model="item.value" size="mini" type="text"></el-input>
</span> </span>
</el-option> </el-option>
</el-select> </el-select>
<i class="nz-icon nz-icon-circle severity-circle" v-if="editAlertRule.severityId" :style="{color:severityData.find(severity => severity.id === editAlertRule.severityId).color,'font-size':'12px'}"></i>
</el-form-item> </el-form-item>
<div class="rule-severity-remark">
<i class="nz-icon nz-icon-info-normal"></i>
<div>
<p>{{$t('alert.P1Rule')}}</p>
<p>{{$t('alert.P2Rule')}}</p>
<p>{{$t('alert.P3Rule')}}</p>
</div>
</div>
<!--receiver--> <!--receiver-->
<el-form-item :label="$t('config.user.receiver')" prop="receiver"> <el-form-item :label="$t('config.user.receiver')" prop="receiver">
<el-select <el-select
@@ -95,6 +87,13 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--notify-->
<el-form-item :label="$t('alert.notify')" prop="severity" class="notify-box">
<el-select id="alert-box-input-notify" v-model="editAlertRule.method" placeholder="" popper-class="config-dropdown notify-box" size="small" multiple>
<el-option v-for="item in notifyData" :id="'alert-severity-'+item.value" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<!--summary--> <!--summary-->
<el-form-item :label="$t('alert.summary')" prop="summary"> <el-form-item :label="$t('alert.summary')" prop="summary">
<el-input id="alert-box-input-summary" v-model="editAlertRule.summary" maxlength="512" placeholder="" rows="3" show-word-limit size="small" type="textarea"></el-input> <el-input id="alert-box-input-summary" v-model="editAlertRule.summary" maxlength="512" placeholder="" rows="3" show-word-limit size="small" type="textarea"></el-input>
@@ -150,7 +149,7 @@ export default {
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ type: 'number', message: this.$t('validate.number') } { type: 'number', message: this.$t('validate.number') }
], ],
severity: [ severityId: [
{ required: true, message: this.$t('validate.required'), trigger: 'change' } { required: true, message: this.$t('validate.required'), trigger: 'change' }
], ],
summary: [ summary: [
@@ -195,7 +194,9 @@ export default {
], ],
unitOptions: chartDataFormat.unitOptions(), unitOptions: chartDataFormat.unitOptions(),
userData: [] userData: [],
severityData: [],
notifyData: []
} }
}, },
methods: { methods: {
@@ -210,11 +211,15 @@ export default {
if (this.prevent_opt.save) { return } ; if (this.prevent_opt.save) { return } ;
this.prevent_opt.save = true this.prevent_opt.save = true
this.editAlertRule.expr = this.expressions[0] this.editAlertRule.expr = this.expressions[0]
const params = {
...this.editAlertRule,
method: this.editAlertRule.method.join(',')
}
this.$refs.alertRuleForm.validate((valid) => { this.$refs.alertRuleForm.validate((valid) => {
if (valid) { if (valid) {
this.editAlertRule.receiver = this.editAlertRule.receiverShow.join(',') this.editAlertRule.receiver = this.editAlertRule.receiverShow.join(',')
if (this.editAlertRule.id) { if (this.editAlertRule.id) {
this.$put('alert/rule', this.editAlertRule).then(response => { this.$put('alert/rule', params).then(response => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (response.code === 200) { if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
@@ -224,7 +229,7 @@ export default {
} }
}) })
} else { } else {
this.$post('alert/rule', this.editAlertRule).then(response => { this.$post('alert/rule', params).then(response => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (response.code === 200) { if (response.code === 200) {
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') })
@@ -270,10 +275,26 @@ export default {
}, },
metricChange (val) { metricChange (val) {
this.editAlertRule.expr = val this.editAlertRule.expr = val
},
getSeverityData () {
this.$get('alert/severity', { pageNo: 1, pageSize: -1 }).then(response => {
if (response.code == 200) {
this.severityData = response.data.list
}
})
},
getNotifyData () {
this.$get('alert/notify/method', { pageNo: 1, pageSize: -1 }).then(response => {
if (response.code == 200) {
this.notifyData = response.data.list
}
})
} }
}, },
mounted () { mounted () {
this.getUserList() this.getUserList()
this.getSeverityData()
this.getNotifyData()
}, },
watch: { watch: {
alertRule: { alertRule: {
@@ -335,7 +356,7 @@ export default {
/deep/ .metric-selector-title{ /deep/ .metric-selector-title{
margin-left: 0 !important; margin-left: 0 !important;
} }
/* 标题样式 */ /* 标题样式 */
.right-box-title{ .right-box-title{
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
@@ -361,4 +382,15 @@ export default {
box-sizing: border-box; box-sizing: border-box;
margin: -13px 30px 18px 30px; margin: -13px 30px 18px 30px;
} }
.severity-circle{
position: absolute;
left: 10px;
top: 0;
}
.severity-box{
position: relative;
}
.severity-box /deep/ .el-select .el-input__inner{
padding-left: 25px;
}
</style> </style>

View File

@@ -13,6 +13,13 @@
<div class="right-box-form-box right-box__container"> <div class="right-box-form-box right-box__container">
<el-form class="right-box-form right-box-form-left" :model="editAlertSilence" label-position="top" <el-form class="right-box-form right-box-form-left" :model="editAlertSilence" label-position="top"
label-width="120px" :rules="rules" ref="alertSilenceForm"> label-width="120px" :rules="rules" ref="alertSilenceForm">
<el-form-item :label='$t("alert.silence.name")' prop="name" class="range-name">
<el-input
:placeholder="''"
size="small"
v-model="editAlertSilence.name">
</el-input>
</el-form-item>
<el-form-item :label='$t("alert.silence.time")' prop="time" class="range-time"> <el-form-item :label='$t("alert.silence.time")' prop="time" class="range-time">
<div> <div>
<el-radio-group v-model="rangeTime" size="small" @change="rangeTimeChange"> <el-radio-group v-model="rangeTime" size="small" @change="rangeTimeChange">
@@ -28,7 +35,7 @@
<div class="datepicker"> <div class="datepicker">
<div class="datepicker-box"> <div class="datepicker-box">
<span class="datepicker-title">start time</span> <span class="datepicker-title">start time</span>
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar" <my-date-picker prefix-icon=" " class=" " size="mini" ref="calendar"
format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'startAt')}" v-model="editAlertSilence.startAt" format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'startAt')}" v-model="editAlertSilence.startAt"
type="datetime" type="datetime"
:clearable="false" :clearable="false"
@@ -40,7 +47,7 @@
</div> </div>
<div class="datepicker-box"> <div class="datepicker-box">
<span class="datepicker-title">end time</span> <span class="datepicker-title">end time</span>
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar" <my-date-picker prefix-icon=" " class=" " size="mini" ref="calendar"
format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'endAt')}" v-model="editAlertSilence.endAt" format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'endAt')}" v-model="editAlertSilence.endAt"
type="datetime" type="datetime"
:clearable="false" :clearable="false"
@@ -54,20 +61,20 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item :label='$t("alert.silence.matcher")' prop="matcher" class="matcher"> <el-form-item :label='$t("alert.silence.matchers")' prop="matchers" class="matchers">
<div v-for="(item, index) in editAlertSilence.matcher" :key="index" class="param-box-row"> <div v-for="(item, index) in editAlertSilence.matchers" :key="index" class="param-box-row">
<el-form-item class="param-box-row-key" :rules="[{ required: true, message: $t('validate.required'), trigger: 'change' },]" :prop="'matcher.' + index + '.name'"> <el-form-item class="param-box-row-key" :rules="[{ required: true, message: $t('validate.required'), trigger: 'change' },]" :prop="'matchers.' + index + '.name'">
<el-input placeholder="key" size="mini" v-model="item.name"></el-input> <el-input placeholder="key" size="mini" v-model="item.name"></el-input>
</el-form-item> </el-form-item>
<span class="param-box-row-eq">=</span> <span class="param-box-row-eq">=</span>
<el-form-item class="param-box-row-value" :prop="'matcher.' + index + '.value'" :rules="[{ required: true, message: $t('validate.required'), trigger: 'change' },]" > <el-form-item class="param-box-row-value" :prop="'matchers.' + index + '.value'" :rules="[{ required: true, message: $t('validate.required'), trigger: 'change' },]" >
<el-input placeholder="value" size="mini" v-model="item.value" class="silence-matcher-value"></el-input> <el-input placeholder="value" size="mini" v-model="item.value" class="silence-matchers-value"></el-input>
<el-checkbox class="silence-matcher-regex" v-model="item.regex" :true-label="1" :false-label="0" >Regex</el-checkbox> <el-checkbox class="silence-matchers-regex" v-model="item.regex" :true-label="1" :false-label="0" >Regex</el-checkbox>
</el-form-item> </el-form-item>
<span class="param-box-row-symbol" :id="'moduel-remove-label-'+index" @click="removeMatcher(index)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span> <span class="param-box-row-symbol" :id="'moduel-remove-label-'+index" @click="removematchers(index)"><i class="nz-icon nz-icon-shanchu1" style="color:#666;"></i></span>
</div> </div>
<div style="text-align: center"> <div style="text-align: center;" class="">
<span id="module-add-label" type="button" @click="addMatcher" class="right-box-form-add module-add-label" style="margin-right: 140px"> <span id="module-add-label" type="button" @click="addmatchers" class="right-box-form-add module-add-label right-box-form-minus-box module-add-label" style="">
<span><i style="font-size: 16px;" class="nz-icon nz-icon-create-square"></i></span> <span><i style="font-size: 16px;" class="nz-icon nz-icon-create-square"></i></span>
</span> </span>
</div> </div>
@@ -155,7 +162,7 @@ export default {
linkId: '', linkId: '',
reason: '', reason: '',
time: [], time: [],
matcher: [ matchers: [
{ name: '', value: '', regex: 0 } { name: '', value: '', regex: 0 }
], ],
name: '' name: ''
@@ -166,6 +173,9 @@ export default {
{ required: true, trigger: 'change' }, { required: true, trigger: 'change' },
{ validator: validate, trigger: 'change' } { validator: validate, trigger: 'change' }
], ],
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'change' },
],
}, },
rangeTime: '', rangeTime: '',
ruleList: [], ruleList: [],
@@ -213,7 +223,7 @@ export default {
}) })
return return
} }
const params = { ...this.editAlertSilence } const params = { ...this.editAlertSilence, matchers: JSON.stringify(this.editAlertSilence.matchers) }
if (valid) { if (valid) {
if (this.editAlertSilence.id) { if (this.editAlertSilence.id) {
this.$put('/alert/silence', params).then(response => { this.$put('/alert/silence', params).then(response => {
@@ -298,15 +308,15 @@ export default {
this.editAlertSilence.linkId = '' this.editAlertSilence.linkId = ''
}, },
// 新增label // 新增label
addMatcher () { addmatchers () {
this.editAlertSilence.matcher.push({ name: '', value: '', regex: 0 }) this.editAlertSilence.matchers.push({ name: '', value: '', regex: 0 })
}, },
// 移除单个Label // 移除单个Label
removeMatcher (index) { removematchers (index) {
if (this.editAlertSilence.matcher.length === 1) { if (this.editAlertSilence.matchers.length === 1) {
this.editAlertSilence.matcher = [{ name: '', value: '', regex: 0 }] this.editAlertSilence.matchers = [{ name: '', value: '', regex: 0 }]
} }
this.editAlertSilence.matcher.splice(index, 1) this.editAlertSilence.matchers.splice(index, 1)
} }
} }
} }
@@ -322,7 +332,7 @@ export default {
width: 14.2% width: 14.2%
} }
/deep/ .el-date-editor.el-range-editor.el-input__inner.panel-time-picker-hidden.el-date-editor--datetimerange.el-range-editor--mini { /deep/ .el-date-editor.el-range-editor.el-input__inner.el-date-editor--datetimerange.el-range-editor--mini {
width: 100%; width: 100%;
} }
@@ -348,7 +358,7 @@ export default {
} }
} }
} }
.matcher{ .matchers{
/deep/ .el-input__prefix{ /deep/ .el-input__prefix{
left: 0; left: 0;
} }
@@ -356,11 +366,11 @@ export default {
left: 126px; left: 126px;
padding-top: 10px; padding-top: 10px;
} }
.matcher-type{ .matchers-type{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 20px; margin-top: 20px;
.matcher-type-title{ .matchers-type-title{
width: 125px; width: 125px;
background:#E7EAED; background:#E7EAED;
font-family: ArialMT; font-family: ArialMT;
@@ -370,7 +380,7 @@ export default {
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
} }
/deep/ .matcher-type-title.el-select--small .el-input__inner{ /deep/ .matchers-type-title.el-select--small .el-input__inner{
background:#E7EAED; background:#E7EAED;
font-family: ArialMT; font-family: ArialMT;
font-size: 14px; font-size: 14px;
@@ -380,15 +390,15 @@ export default {
text-align: center; text-align: center;
border: none; border: none;
} }
.matcher-type-content{ .matchers-type-content{
flex: 1; flex: 1;
} }
} }
} }
/deep/ .silence-matcher-value{ /deep/ .silence-matchers-value{
width: calc(100% - 100px); width: calc(100% - 100px);
} }
.silence-matcher-regex{ .silence-matchers-regex{
margin-left: 10px; margin-left: 10px;
} }
/deep/ .param-box-row-key{ /deep/ .param-box-row-key{
@@ -397,4 +407,15 @@ export default {
/deep/ .param-box-row-value{ /deep/ .param-box-row-value{
width: 50%; width: 50%;
} }
.module-add-label{
display: inline-block;
width: 300px;
height: 18px;
background: #FFFCF9;
border: 1px solid #FFE0BD;
border-radius: 2px;
text-align: center;
line-height: 18px;
margin-right: 80px;
}
</style> </style>

View File

@@ -1,152 +1,128 @@
<template> <template>
<transition name="right-box-580"> <transition name="right-box-580">
<div class="right-box right-box-asset" v-clickoutside="{obj:editAssetMeta,func:clickOutside}"> <div class="right-box right-box-asset" v-clickoutside="{obj:editAssetMeta,func:clickOutside}">
<!-- begin--顶部按钮-->
<div class="right-box-top-btns right-box-form-delete">
<button @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien" id="alert-box-del" type="button"
v-has="'alert_silence_delete'" v-if="editAssetMeta.id">
<span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-delete"></i></span>
<span class="right-box-top-btn-txt">{{$t('overall.delete')}}</span>
</button>
</div>
<!-- end--顶部按钮-->
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box__header"> <div class="right-box__header">
<div class="header__title">{{editAssetMeta.id ? $t("config.assetLabel.editMeta") + " ID" + editAssetMeta.id : <div class="header__title">{{editAssetMeta.id ? $t("config.assetLabel.editMeta") + " ID" + editAssetMeta.id :
$t("config.assetLabel.addMeta")}}</div> $t("config.assetLabel.addMeta")}}
</div> </div>
<!-- end--标题--> <div class="header__operation">
<span v-cancel="{obj: editAssetMeta, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
</div>
</div>
<!-- begin--表单--> <!-- begin--表单-->
<div class="right-box__container"> <div class="right-box__container">
<el-form class="right-box-form right-box-form-left" label-width="120px" :model="editAssetMeta" label-position = "top" ref="editAssetMetaForm" :rules="rules"> <div class="container__form">
<el-form label-width="120px" :model="editAssetMeta" label-position = "top" ref="editAssetMetaForm" :rules="rules">
<el-form-item :label='$t("config.assetLabel.name")' prop="name"> <el-form-item :label='$t("config.assetLabel.name")' prop="name">
<el-input placeholder="" show-word-limit v-model="editAssetMeta.name" size="small" id="editAssetMeta-box-input-name"></el-input> <el-input placeholder="" show-word-limit v-model="editAssetMeta.name" size="small" id="editAssetMeta-box-input-name"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label='$t("config.assetLabel.key")' prop="metaKey">
<el-form-item :label='$t("config.assetLabel.key")' prop="metaKey"> <el-input placeholder="" show-word-limit v-model="editAssetMeta.metaKey" size="small" id="editAssetMeta-box-input-key"></el-input>
<el-input placeholder="" show-word-limit v-model="editAssetMeta.metaKey" size="small" id="editAssetMeta-box-input-key"></el-input> </el-form-item>
</el-form-item> <el-form-item :label='$t("config.assetLabel.group")' prop="groupId">
<el-select v-model="editAssetMeta.groupId" size="small" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" :popper-append-to-body="false">
<el-form-item :label='$t("config.assetLabel.group")' prop="groupId"> <el-option v-for="(item, index) in groupData" :key="index" :value="item.id" :label="item.name"></el-option>
<!-- <el-input placeholder="" show-word-limit v-model="editAssetMeta.group" size="small" id="editAssetMeta-box-input-group"></el-input>--> </el-select>
<el-select v-model="editAssetMeta.groupId" size="small" :popper-class="'nz-meta-group-box'" :popper-append-to-body="false"> </el-form-item>
<el-option v-for="(item, index) in groupData" :key="index" :value="item.id" :label="item.name"></el-option> <el-form-item :label='$t("config.assetLabel.search")' prop="search">
</el-select> <el-switch
</el-form-item> @change="switchSearch"
v-model="editAssetMeta.search"
<el-form-item :label='$t("config.assetLabel.search")' prop="search"> active-color="#ee9d3f"
<!-- <el-input placeholder="" show-word-limit v-model="editAssetMeta.search" size="small" id="editAssetMeta-box-input-search"></el-input>--> active-value="1"
<el-switch inactive-value="0">
@change="switchSearch" </el-switch>
v-model="editAssetMeta.search" </el-form-item>
active-color="#ee9d3f" <el-form-item :label='$t("config.assetLabel.display")' prop="display">
:active-value="1" <el-switch
:inactive-value="0"> v-model="editAssetMeta.display"
</el-switch> active-color="#ee9d3f"
</el-form-item> active-value="1"
inactive-value="0">
<el-form-item :label='$t("config.assetLabel.display")' prop="display"> </el-switch>
<!-- <el-input placeholder="" show-word-limit v-model="editAssetMeta.display" size="small" id="editAssetMeta-box-input-display"></el-input>--> </el-form-item>
<el-switch <el-form-item :label='$t("config.assetLabel.type")' prop="type">
v-model="editAssetMeta.display" <el-select v-model="editAssetMeta.type" :popper-append-to-body="false" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" size="small" @change="selectType">
active-color="#ee9d3f" <el-option v-for="(item, index) in typeData" :key="index" :value="item.value" :disabled="item.disabled">
:active-value="1" <div><i :class="item.icon"></i>&nbsp;&nbsp;<span>{{item.name}}</span></div>
:inactive-value="0"> </el-option>
</el-switch> </el-select>
</el-form-item> </el-form-item>
<div class="right-box-sub-title" style="margin-bottom: 20px" v-if="showParam">
<el-form-item :label='$t("config.assetLabel.type")' prop="type"> <span>{{$t('config.assetLabel.params')}}</span>
<el-select v-model="editAssetMeta.type" size="small" class="right-box__select" placeholder='请选择' popper-class="right-box-select-dropdown prevent-clickoutside" :popper-append-to-body="false" @change="selectType"> <span v-if="editAssetMeta.type.toUpperCase()!=='DATETIME'" class="float-right" style="height: 19px;display: inline-block;line-height: 1;" @click="addParam">
<el-option v-for="(item, index) in typeData" :key="index" :value="item.value" :disabled="item.disabled"> <span class="create-square-box">
<div><i :class="item.icon"></i>&nbsp;&nbsp;<span >{{item.name}}</span></div> <i style="font-size: 17px; cursor: pointer;" class="nz-icon nz-icon-create-square"></i>
</el-option> </span>
</el-select>
</el-form-item>
<div class="right-box-sub-title" style="margin-bottom: 20px" v-if="showParam">
<span>{{$t('config.assetLabel.params')}}</span>
<span @click="addParam" class="float-right" style="height: 19px;display: inline-block;line-height: 1;" v-if="editAssetMeta.type!=='datetime'">
<span class="create-square-box">
<i style="font-size: 17px; cursor: pointer;" class="nz-icon nz-icon-create-square"></i>
</span> </span>
</span>
</div>
<el-form-item prop="param" v-if="showParam" class="asset-meta-param">
<!-- <el-input placeholder="" show-word-limit v-model="editAssetMeta.param" size="small" id="editAssetMeta-box-input-param"></el-input>-->
<div v-if="editAssetMeta.type==='radio' || editAssetMeta.type==='checkbox' || editAssetMeta.type==='select'" class="meta-option-box">
<el-row class="asset-meta-param-row asset-meta-param-header">
<el-col :span="12">
{{$t('config.assetLabel.option')}}
</el-col>
<el-col :span="6">
{{$t('config.assetLabel.isCheck')}}
</el-col>
<el-col :span="6">
{{$t('config.assetLabel.operate')}}
</el-col>
</el-row>
<el-row v-for="(item,index) in editAssetMeta.param.items" :key="index" class="asset-meta-param-row">
<el-col :span="12">
<el-input v-model = "item.name" size="small" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" @input="(val)=>{inputChange(index, val)}" :ref="'metaNameOption'+index"></el-input>
</el-col>
<el-col :span="6">
<el-radio v-if="editAssetMeta.type==='radio' || editAssetMeta.type==='select'" v-model = "item.check" :label="true" @change="radioChange(index)">{{$t('config.assetLabel.default')}}</el-radio>
<el-checkbox v-else v-model="item.check" @change="checkBoxChange"> {{$t('config.assetLabel.default')}}</el-checkbox>
</el-col>
<el-col :span="6">
<div class="">
<span class="nz-icon-minus-medium">
<i @click="deleteParam(index)" class="nz-icon nz-icon-minus"></i>
</span>
<span class="nz-icon-copy">
<i @click="copyParam(index)" class="nz-icon nz-icon-override"></i>
</span>
</div>
</el-col>
</el-row>
</div> </div>
<el-form-item prop="param" v-if="showParam" class="asset-meta-param">
<div v-if="editAssetMeta.type==='datetime'"> <div v-if="editAssetMeta.type.toUpperCase()==='RADIO' || editAssetMeta.type.toUpperCase()==='CHECKBOX' || editAssetMeta.type.toUpperCase()==='SELECT'" class="meta-option-box">
<el-row style="margin-bottom: 10px"> <el-row class="asset-meta-param-row asset-meta-param-header">
<span class="datetime-header">{{$t('config.assetLabel.dateType')}}: </span> <el-col :span="12">
<el-radio-group v-model="editAssetMeta.param.subType"> {{$t('config.assetLabel.option')}}
<el-radio :label="'date'">{{$t('config.assetLabel.date')}}</el-radio> </el-col>
<el-radio :label="'time'">{{$t('config.assetLabel.time')}}</el-radio> <el-col :span="6">
<el-radio :label="'datetime'">{{$t('config.assetLabel.datetimes')}}</el-radio> {{$t('config.assetLabel.isCheck')}}
</el-radio-group> </el-col>
</el-row> <el-col :span="6">
<el-row> {{$t('config.assetLabel.operate')}}
<span class="datetime-header">{{$t('config.assetLabel.interval')}}: </span> </el-col>
<el-switch </el-row>
v-model="editAssetMeta.param.interval" <el-row v-for="(item,index) in editAssetMeta.param.items" :key="index" class="asset-meta-param-row">
@change="$forceUpdate" <el-col :span="12">
active-color="#ee9d3f"> <el-input v-model = "item.name" size="small" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" @input="(val)=>{inputChange(index, val)}" :ref="'metaNameOption'+index"></el-input>
</el-switch> </el-col>
</el-row> <el-col :span="6">
</div> <el-radio v-if="editAssetMeta.type.toUpperCase()==='RADIO' || editAssetMeta.type.toUpperCase()==='SELECT'" v-model = "item.check" :label="true" @change="radioChange(index)">{{$t('config.assetLabel.default')}}</el-radio>
<el-checkbox v-else v-model="item.check" @change="checkBoxChange"> {{$t('config.assetLabel.default')}}</el-checkbox>
<div v-if="editAssetMeta.type==='double'"> </el-col>
<el-row> <el-col :span="6">
<span class="datetime-header">{{$t('config.assetLabel.decimals')}}: </span> <div class="">
<el-input-number v-model="editAssetMeta.param.decimals" @change="$forceUpdate" :min="0" :max="10" :controls="false" size="small"></el-input-number> <span class="nz-icon-minus-medium">
</el-row> <i @click="deleteParam(index)" class="nz-icon nz-icon-minus"></i>
</div> </span>
</el-form-item> <span class="nz-icon-copy">
<i @click="copyParam(index)" class="nz-icon nz-icon-override"></i>
<el-form-item :label='$t("overall.remark")' prop="remark"> </span>
<el-input placeholder="" maxlength="512" type="textarea" show-word-limit v-model="editAssetMeta.remark" size="small" id="editAssetMeta-box-input-remark"></el-input> </div>
</el-form-item> </el-col>
</el-row>
<el-form-item :label='$t("config.assetLabel.example")'> </div>
<assetTagEx :type="editAssetMeta.type" :param="editAssetMeta.param"/> <div v-if="editAssetMeta.type.toUpperCase()==='DATETIME'">
</el-form-item> <el-row style="margin-bottom: 10px">
<span class="datetime-header">{{$t('config.assetLabel.dateType')}}: </span>
</el-form> <el-radio-group v-model="editAssetMeta.param.subType">
<el-radio :label="'date'">{{$t('config.assetLabel.date')}}</el-radio>
<el-radio :label="'time'">{{$t('config.assetLabel.time')}}</el-radio>
<el-radio :label="'datetime'">{{$t('config.assetLabel.datetimes')}}</el-radio>
</el-radio-group>
</el-row>
<el-row>
<span class="datetime-header">{{$t('config.assetLabel.interval')}}: </span>
<el-switch
v-model="editAssetMeta.param.interval"
@change="$forceUpdate"
active-color="#ee9d3f">
</el-switch>
</el-row>
</div>
<div v-if="editAssetMeta.type.toUpperCase()==='DOUBLE'">
<el-row>
<span class="datetime-header">{{$t('config.assetLabel.decimals')}}: </span>
<el-input-number v-model="editAssetMeta.param.decimals" @change="$forceUpdate" :min="0" :max="10" :controls="false" size="small"></el-input-number>
</el-row>
</div>
</el-form-item>
<el-form-item :label='$t("overall.remark")' prop="remark">
<el-input placeholder="" maxlength="512" type="textarea" show-word-limit v-model="editAssetMeta.remark" size="small" id="editAssetMeta-box-input-remark"></el-input>
</el-form-item>
<el-form-item :label='$t("config.assetLabel.example")'>
<assetTagEx :param="editAssetMeta.param" :type="editAssetMeta.type.toUpperCase()"/>
</el-form-item>
</el-form>
</div>
</div> </div>
<!-- end--表单--> <!-- end--表单-->
@@ -170,25 +146,12 @@ import assetTagEx from '../../page/asset/components/assetTagEx'
export default { export default {
name: 'assetLabelBox', name: 'assetLabelBox',
props: { props: {
assetLabel: {} obj: { type: Object }
}, },
components: { assetTagEx }, components: { assetTagEx },
data () { data () {
return { return {
editAssetMeta: { editAssetMeta: {},
id: '',
name: '',
metaKey: '',
groupId: {
id: '',
name: ''
},
search: 1,
display: 1,
type: '',
param: {},
remark: ''
},
rightBox: { // 面板弹出框相关 rightBox: { // 面板弹出框相关
show: false show: false
}, },
@@ -199,66 +162,66 @@ export default {
groupId: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }], groupId: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }],
type: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }] type: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }]
}, },
value:'', value: '',
typeData: [ typeData: [
{ {
icon: 'nz-icon nz-icon-text', icon: 'nz-icon nz-icon-text',
disabled:true, disabled: true,
value: 'text', value: 'TEXT',
name: this.$t('config.assetLabel.text') name: this.$t('config.assetLabel.text')
}, },
{ {
icon: 'nz-icon nz-icon-multitext', icon: 'nz-icon nz-icon-multitext',
disabled:true, disabled: true,
value: 'multitext', value: 'MULTITEXT',
name: this.$t('config.assetLabel.multitext') name: this.$t('config.assetLabel.multitext')
}, },
{ {
icon: 'nz-icon nz-icon-textarea', icon: 'nz-icon nz-icon-textarea',
disabled:true, disabled: true,
value: 'textarea', value: 'TEXTAREA',
name: this.$t('config.assetLabel.textarea') name: this.$t('config.assetLabel.textarea')
}, },
{ {
icon: 'nz-icon nz-icon-radio', icon: 'nz-icon nz-icon-radio',
disabled:true, disabled: true,
value: 'radio', value: 'RADIO',
name: this.$t('config.assetLabel.radio') name: this.$t('config.assetLabel.radio')
}, },
{ {
icon: 'nz-icon nz-icon-checkbox', icon: 'nz-icon nz-icon-checkbox',
disabled:true, disabled: true,
value: 'checkbox', value: 'CHECKBOX',
name: this.$t('config.assetLabel.checkbox') name: this.$t('config.assetLabel.checkbox')
}, },
{ {
icon: 'nz-icon nz-icon-xialaxuanze', icon: 'nz-icon nz-icon-xialaxuanze',
disabled:true, disabled: true,
value: 'select', value: 'SELECT',
name: this.$t('config.assetLabel.select') name: this.$t('config.assetLabel.select')
}, },
{ {
icon: 'nz-icon nz-icon-integer', icon: 'nz-icon nz-icon-integer',
disabled:true, disabled: true,
value: 'integer', value: 'INTEGER',
name: this.$t('config.assetLabel.integer') name: this.$t('config.assetLabel.integer')
}, },
{ {
icon: 'nz-icon nz-icon-double', icon: 'nz-icon nz-icon-double',
disabled:true, disabled: true,
value: 'double', value: 'DOUBLE',
name: this.$t('config.assetLabel.double') name: this.$t('config.assetLabel.double')
}, },
{ {
icon: 'nz-icon nz-icon-double', icon: 'el-icon-time',
disabled:true, disabled: true,
value: 'datetime', value: 'DATETIME',
name: this.$t('config.assetLabel.datetime') name: this.$t('config.assetLabel.datetime')
}, },
{ {
icon: 'nz-icon nz-icon-double', icon: 'el-icon-message',
disabled:true, disabled: true,
value: 'email', value: 'EMAIL',
name: this.$t('config.assetLabel.email') name: this.$t('config.assetLabel.email')
} }
], ],
@@ -266,33 +229,56 @@ export default {
} }
}, },
watch: { watch: {
assetLabel: { obj: {
deep: true,
immediate: true, immediate: true,
handler (n) { handler (n) {
this.editAssetMeta = { ...n } this.editAssetMeta = {
this.selectType(n.type, true) ...n,
search: `${n.search}`,
display: `${n.display}`,
param: n.param && typeof n.param === 'string' ? JSON.parse(n.param) : {},
type: n.type.toUpperCase()
}
console.info(this.editAssetMeta)
}
},
'editAssetMeta.search': {
deep: true,
immediate: true,
handler (n) {
this.switchSearch(n)
} }
} }
}, },
mounted () { mounted () {
this.getGroupData() this.getGroupData()
this.switchSearch()
}, },
methods: { methods: {
switchSearch(value){ switchSearch (value) {
this.typeData.forEach(element => { if (value == 0) {
if( value === 0 ) { this.typeData.forEach(t => {
element.disabled = false t.disabled = false
}else { })
if(element.value == 'radio'){ } else if (value == 1) {
element.disabled = false if (this.editAssetMeta.type !== 'RADIO' &&
}else if(element.value == 'checkbox'){ this.editAssetMeta.type !== 'CHECKBOX' &&
element.disabled = false this.editAssetMeta.type !== 'SELECT') {
}else if(element.value == 'select'){ this.editAssetMeta.type = 'RADIO'
element.disabled = false }
} this.typeData.forEach(t => {
if (t.value === 'RADIO' || t.value === 'CHECKBOX' || t.value === 'SELECT') {
t.disabled = false
} else {
t.disabled = true
} }
}) })
} else {
this.editAssetMeta.search = '0'
this.typeData.forEach(t => {
t.disabled = false
})
}
}, },
clickOutside () { clickOutside () {
this.esc(false) this.esc(false)
@@ -304,7 +290,7 @@ export default {
save () { save () {
if (this.prevent_opt.save) { if (this.prevent_opt.save) {
return return
}; }
this.prevent_opt.save = true this.prevent_opt.save = true
this.$refs.editAssetMetaForm.validate((valid) => { this.$refs.editAssetMetaForm.validate((valid) => {
if (valid) { if (valid) {
@@ -355,7 +341,6 @@ export default {
if (this.prevent_opt.save) { if (this.prevent_opt.save) {
return return
} }
;
this.prevent_opt.save = true this.prevent_opt.save = true
this.$confirm(this.$t('tip.confirmDelete'), { this.$confirm(this.$t('tip.confirmDelete'), {
confirmButtonText: this.$t('tip.yes'), confirmButtonText: this.$t('tip.yes'),
@@ -384,9 +369,9 @@ export default {
}, },
selectType (val, init) { selectType (val, init) {
switch (val) { switch (val) {
case 'radio' : case 'RADIO' :
case 'checkbox' : case 'CHECKBOX' :
case 'select' : case 'SELECT' :
this.showParam = true this.showParam = true
if (init) return if (init) return
this.editAssetMeta.param = {} this.editAssetMeta.param = {}
@@ -398,7 +383,7 @@ export default {
check: false check: false
}] }]
break break
case 'datetime' : case 'DATETIME' :
this.showParam = true this.showParam = true
if (init) return if (init) return
this.editAssetMeta.param = { this.editAssetMeta.param = {
@@ -406,7 +391,7 @@ export default {
interval: false interval: false
} }
break break
case 'double' : case 'DOUBLE' :
this.showParam = true this.showParam = true
if (init) return if (init) return
this.editAssetMeta.param = { this.editAssetMeta.param = {
@@ -427,7 +412,7 @@ export default {
this.editAssetMeta.param.items.forEach((item, index) => { this.editAssetMeta.param.items.forEach((item, index) => {
if (index === i) { if (index === i) {
item.check = !!item.check item.check = !!item.check
} else if (this.editAssetMeta.type !== 'checkbox') { } else if (this.editAssetMeta.type.toUpperCase() !== 'CHECKBOX') {
item.check = false item.check = false
} }
}) })
@@ -456,7 +441,7 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}, },
copyParam (index) { copyParam (index) {
if (this.editAssetMeta.type !== 'checkbox') { if (this.editAssetMeta.type.toUpperCase() !== 'CHECKBOX') {
this.editAssetMeta.param.items.push({ this.editAssetMeta.param.items.push({
name: this.editAssetMeta.param.items[index].name, name: this.editAssetMeta.param.items[index].name,
check: false check: false

View File

@@ -851,7 +851,7 @@ export default {
width: 37.5%; width: 37.5%;
margin-right: 2%; margin-right: 2%;
background: #FFFFFF; background: #FFFFFF;
border: 1px solid #E7EAED; border: 1px solid $--right-box-border-color;
border-radius: 2px; border-radius: 2px;
position: relative; position: relative;
} }
@@ -875,7 +875,7 @@ export default {
width: 100%; width: 100%;
background: #FFFFFF; background: #FFFFFF;
border: 1px solid #E7EAED; border: 1px solid $--right-box-border-color;
border-radius: 2px; border-radius: 2px;
} }
/* end--table*/ /* end--table*/
@@ -884,7 +884,7 @@ export default {
.search-box{ .search-box{
width: calc(100% - 10px); width: calc(100% - 10px);
padding: 10px 5px; padding: 10px 5px;
border-bottom: 1px solid #E7EAED; border-bottom: 1px solid $--right-box-border-color;
display: flex; display: flex;
} }
/deep/ .new-search .search-input-all{ /deep/ .new-search .search-input-all{

View File

@@ -113,7 +113,7 @@ export default {
cancelButtonText: this.$t('tip.no'), cancelButtonText: this.$t('tip.no'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response => { this.$delete('dc/cabinet?ids=' + this.editCabinet.id).then(response => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (response.code == 200) { if (response.code == 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })

View File

@@ -2,7 +2,7 @@
<div class="right-box right-box-dc" v-clickoutside="{obj:editDc,func:clickOutside}"> <div class="right-box right-box-dc" v-clickoutside="{obj:editDc,func:clickOutside}">
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box__header"> <div class="right-box__header">
<div class="right-box__header">{{editDc.id ? ($t("config.dc.editDc") + " ID" + editDc.id) : $t("config.dc.createDc")}}</div> <div class="header__title">{{editDc.id ? ($t("config.dc.editDc") + " ID" + editDc.id) : $t("config.dc.createDc")}}</div>
<div class="header__operation"> <div class="header__operation">
<span v-cancel="{obj: editDc, func: esc}"><i class="nz-icon nz-icon-close"></i></span> <span v-cancel="{obj: editDc, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
</div> </div>

View File

@@ -2,7 +2,7 @@
<div v-clickoutside="{obj:editExprTemp,func:clickOutside}" class="right-box right-box-alert-config"> <div v-clickoutside="{obj:editExprTemp,func:clickOutside}" class="right-box right-box-alert-config">
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box__header"> <div class="right-box__header">
<div class="right-box__header">{{editExprTemp.id ? $t("config.exprTemp.edit") + " ID" + editExprTemp.id : <div class="header__title">{{editExprTemp.id ? $t("config.exprTemp.edit") + " ID" + editExprTemp.id :
$t("config.exprTemp.create")}} $t("config.exprTemp.create")}}
</div> </div>
<div class="header__operation"> <div class="header__operation">

View File

@@ -2,7 +2,7 @@
<div class="right-box right-box-mib" v-clickoutside="{obj:editMib,func:clickOutside}" > <div class="right-box right-box-mib" v-clickoutside="{obj:editMib,func:clickOutside}" >
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box__header"> <div class="right-box__header">
<div class="right-box__header">{{editMib.id ? ($t("config.mib.editMib") + " ID" + editMib.id) : $t("config.mib.createMib")}}</div> <div class="header__title">{{editMib.id ? ($t("config.mib.editMib") + " ID" + editMib.id) : $t("config.mib.createMib")}}</div>
<div class="header__operation"> <div class="header__operation">
<span v-cancel="{obj: editMib, func: esc}"><i class="nz-icon nz-icon-close"></i></span> <span v-cancel="{obj: editMib, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
</div> </div>

View File

@@ -831,13 +831,13 @@ export default {
min-height: 30px; min-height: 30px;
overflow-x: hidden; overflow-x: hidden;
border-radius: 2px; border-radius: 2px;
padding: 0; padding: 0 !important;
} }
/deep/ .ti-tag{ /deep/ .ti-tag{
background-color: #f4f4f5; background-color: #f4f4f5;
border-color: #e9e9eb; border-color: #e9e9eb;
color: #909399; color: #909399;
padding: 2px 4px; padding: 2px 4px!important;;
} }
</style> </style>
<style> <style>

View File

@@ -105,7 +105,7 @@ export default {
cancelButtonText: this.$t('tip.no'), cancelButtonText: this.$t('tip.no'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$delete('/cabinet?ids=' + this.editCabinet.id).then(response => { this.$delete('dc/cabinet?ids=' + this.editCabinet.id).then(response => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (response.code == 200) { if (response.code == 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })

View File

@@ -2,7 +2,7 @@
<div class="right-box right-box-credential" v-clickoutside="{obj:editCredential,func:clickOutside}"> <div class="right-box right-box-credential" v-clickoutside="{obj:editCredential,func:clickOutside}">
<!-- begin--标题--> <!-- begin--标题-->
<div class="right-box__header"> <div class="right-box__header">
<div class="right-box__header">{{editCredential.id ? ($t("config.mib.credential.edit") + " ID" + editCredential.id) : $t("config.mib.credential.create")}}</div> <div class="header__title">{{editCredential.id ? ($t("config.mib.credential.edit") + " ID" + editCredential.id) : $t("config.mib.credential.create")}}</div>
<div class="header__operation"> <div class="header__operation">
<span v-cancel="{obj: editCredential, func: esc}"><i class="nz-icon nz-icon-close"></i></span> <span v-cancel="{obj: editCredential, func: esc}"><i class="nz-icon nz-icon-close"></i></span>
</div> </div>
@@ -17,14 +17,14 @@
<el-form-item :label='$t("config.mib.credential.remark")' prop="remark"> <el-form-item :label='$t("config.mib.credential.remark")' prop="remark">
<el-input placeholder="" v-model="editCredential.remark" size="small" id="credential-box-input-remark"></el-input> <el-input placeholder="" v-model="editCredential.remark" size="small" id="credential-box-input-remark"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label='$t("config.mib.credential.type")' prop="type" class="half-form-item"> <el-form-item :label='$t("config.mib.credential.type")' prop="type">
<el-select v-model="editCredential.type" class="right-box-row-with-btn" placeholder="" id="credential-box-input-type" popper-class="chart-box-dropdown-small" @change="typeChange"> <el-select v-model="editCredential.type" placeholder="" id="credential-box-input-type" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" @change="typeChange">
<el-option v-for="item in $CONSTANTS.snmpProtocolTypes" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in $CONSTANTS.snmpProtocolTypes" :key="item.value" :label="item.label" :value="item.value">
<span class="panel-dropdown-label-txt" >{{item.label}}</span> <span class="panel-dropdown-label-txt" >{{item.label}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label='$t("config.mib.credential.port")' prop="port" class="half-form-item" > <el-form-item :label='$t("config.mib.credential.port")' prop="port" >
<el-input placeholder="" v-model.number="editCredential.port" size="small" id="credential-box-input-port"></el-input> <el-input placeholder="" v-model.number="editCredential.port" size="small" id="credential-box-input-port"></el-input>
</el-form-item> </el-form-item>
<el-form-item label='Read community' prop="readCommunity" v-if="editCredential.type ===1 || editCredential.type === 2"> <el-form-item label='Read community' prop="readCommunity" v-if="editCredential.type ===1 || editCredential.type === 2">
@@ -33,38 +33,38 @@
<el-form-item label='Write community' prop="writeCommunity" v-if="editCredential.type ===1 || editCredential.type === 2"> <el-form-item label='Write community' prop="writeCommunity" v-if="editCredential.type ===1 || editCredential.type === 2">
<el-input placeholder="" v-model="editCredential.config.writeCommunity" size="small" id="credential-box-input-writeCommunity" type="password" show-password></el-input> <el-input placeholder="" v-model="editCredential.config.writeCommunity" size="small" id="credential-box-input-writeCommunity" type="password" show-password></el-input>
</el-form-item> </el-form-item>
<el-form-item label="Username" prop="username" v-if="editCredential.type === 3" class="half-form-item"> <el-form-item label="Username" prop="username" v-if="editCredential.type === 3">
<el-input placeholder="" v-model="editCredential.config.username" size="small" id="credential-box-input-username"></el-input> <el-input placeholder="" v-model="editCredential.config.username" size="small" id="credential-box-input-username"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="Content name" prop="contextname" v-if="editCredential.type === 3" class="half-form-item"> <el-form-item label="Content name" prop="contextname" v-if="editCredential.type === 3">
<el-input placeholder="" v-model="editCredential.config.contextname" size="small" id="credential-box-input-contextname"></el-input> <el-input placeholder="" v-model="editCredential.config.contextname" size="small" id="credential-box-input-contextname"></el-input>
</el-form-item> </el-form-item>
<div class="right-box-sub-title" v-if="editCredential.type === 3">{{$t('config.mib.credential.auth')}}</div> <div class="right-box-sub-title" v-if="editCredential.type === 3">{{$t('config.mib.credential.auth')}}</div>
<div style="margin-bottom: 20px;width: 100%"></div> <div style="margin-bottom: 20px;width: 100%"></div>
<el-form-item :label='$t("config.mib.credential.method")' prop="authProtocol" v-if="editCredential.type === 3" class="half-form-item"> <el-form-item :label='$t("config.mib.credential.method")' prop="authProtocol" v-if="editCredential.type === 3">
<el-select v-model="editCredential.config.authProtocol" class="right-box-row-with-btn" placeholder="" id="credential-box-input-type" popper-class="chart-box-dropdown-small"> <el-select v-model="editCredential.config.authProtocol" placeholder="" id="credential-box-input-type" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside">
<el-option v-for="item in $CONSTANTS.snmpAuthMethod" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in $CONSTANTS.snmpAuthMethod" :key="item.value" :label="item.label" :value="item.value">
<span class="panel-dropdown-label-txt" >{{item.label}}</span> <span class="panel-dropdown-label-txt" >{{item.label}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label='$t("config.mib.credential.pin")' prop="authPin" v-if="editCredential.type === 3" class="half-form-item"> <el-form-item :label='$t("config.mib.credential.pin")' prop="authPin" v-if="editCredential.type === 3">
<el-input placeholder="" v-model="editCredential.config.authPin" size="small" id="credential-box-input-authPin" type="password" show-password></el-input> <el-input placeholder="" v-model="editCredential.config.authPin" size="small" id="credential-box-input-authPin" type="password" show-password></el-input>
</el-form-item> </el-form-item>
<div class="right-box-sub-title" v-if="editCredential.type === 3">{{$t('config.mib.credential.encryption')}}</div> <div class="right-box-sub-title" v-if="editCredential.type === 3">{{$t('config.mib.credential.encryption')}}</div>
<div style="margin-bottom: 20px;width: 100%"></div> <div style="margin-bottom: 20px;width: 100%"></div>
<el-form-item :label='$t("config.mib.credential.method")' prop="privProtocol" v-if="editCredential.type === 3" class="half-form-item"> <el-form-item :label='$t("config.mib.credential.method")' prop="privProtocol" v-if="editCredential.type === 3">
<el-select v-model="editCredential.config.privProtocol" class="right-box-row-with-btn" placeholder="" id="credential-box-input-type" popper-class="chart-box-dropdown-small" :disabled="!editCredential.config.authProtocol || editCredential.config.authProtocol === ''"> <el-select v-model="editCredential.config.privProtocol" placeholder="" id="credential-box-input-type" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" :disabled="!editCredential.config.authProtocol || editCredential.config.authProtocol === ''">
<el-option v-for="item in $CONSTANTS.snmpEncryptionMethod" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in $CONSTANTS.snmpEncryptionMethod" :key="item.value" :label="item.label" :value="item.value">
<span class="panel-dropdown-label-txt" >{{item.label}}</span> <span class="panel-dropdown-label-txt" >{{item.label}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label='$t("config.mib.credential.pin")' prop="privPin" v-if="editCredential.type === 3" class="half-form-item"> <el-form-item :label='$t("config.mib.credential.pin")' prop="privPin" v-if="editCredential.type === 3">
<el-input placeholder="" v-model="editCredential.config.privPin" size="small" id="credential-box-input-privPin" :disabled="!editCredential.config.authProtocol || editCredential.config.authProtocol === ''" type="password" show-password></el-input> <el-input placeholder="" v-model="editCredential.config.privPin" size="small" id="credential-box-input-privPin" :disabled="!editCredential.config.authProtocol || editCredential.config.authProtocol === ''" type="password" show-password></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@@ -93,7 +93,7 @@
export default { export default {
name: 'accountBox', name: 'accountBox',
props: { props: {
user: Object obj: Object
}, },
computed: { computed: {
isCurrentUser () { isCurrentUser () {
@@ -292,7 +292,7 @@ export default {
}, },
watch: { watch: {
// 将prop里的user转为组件内部对象 // 将prop里的user转为组件内部对象
user: { obj: {
immediate: true, immediate: true,
deep: true, deep: true,
handler (n) { handler (n) {

View File

@@ -31,7 +31,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="$tableSet.sortableShow(item.prop,'alertMessage')" :sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
> >
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
@@ -57,10 +57,8 @@
<template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template> <template v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</template>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<span v-else-if="item.prop === 'severity'" class="severity"> <span v-else-if="item.prop === 'severity'&&scope.row[item.prop]" class="severity">
<span v-if="scope.row[item.prop] === 'P1'" class="P1">P1</span> <i class="nz-icon nz-icon-circle" :style="{color:scope.row[item.prop].color,'font-size':'12px','margin-right':'5px'}"></i> {{scope.row[item.prop].name}}
<span v-if="scope.row[item.prop] === 'P2'" class="P2">P2</span>
<span v-if="scope.row[item.prop] === 'P3'" class="P3">P3</span>
</span> </span>
<span v-else-if="item.prop === 'startAt'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span> <span v-else-if="item.prop === 'startAt'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<template v-else-if="item.prop === 'duration'"> <template v-else-if="item.prop === 'duration'">
@@ -167,23 +165,28 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('alert.alertName'), label: this.$t('alert.alertName'),
prop: 'alertRule', prop: 'alertRule',
show: true, show: true,
width: 180 width: 180,
sortable:false,
sortable:'custom'
}, { }, {
label: this.$t('alert.list.labels'), label: this.$t('alert.list.labels'),
prop: 'labels', prop: 'labels',
show: true, show: true,
NotSet: true, NotSet: true,
minWidth: 250 minWidth: 250,
sortable:'custom'
}, { }, {
label: this.$t('alert.severity'), label: this.$t('alert.severity'),
prop: 'severity', prop: 'severity',
show: true, show: true,
width: 110 width: 110,
sortable:'custom'
}, { }, {
label: this.$t('alert.summary'), label: this.$t('alert.summary'),
prop: 'summary', prop: 'summary',
@@ -203,7 +206,8 @@ export default {
label: this.$t('alert.startAt'), label: this.$t('alert.startAt'),
prop: 'startAt', prop: 'startAt',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, { }, {
label: this.$t('config.terminallog.duration'), label: this.$t('config.terminallog.duration'),
prop: 'duration', prop: 'duration',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -33,17 +34,15 @@
<div class="col-resize-area"></div> <div class="col-resize-area"></div>
</template> </template>
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
<span v-if="item.prop === 'severity'" class="severity"> <span v-if="item.prop === 'severity'&&scope.row[item.prop]" class="severity">
<span v-if="scope.row[item.prop] == 'P1'" class="P1">P1</span> <i class="nz-icon nz-icon-circle" :style="{color:scope.row[item.prop].color,'font-size':'12px','margin-right':'5px'}"></i> {{scope.row[item.prop].name}}
<span v-if="scope.row[item.prop] == 'P2'" class="P2">P2</span>
<span v-if="scope.row[item.prop] == 'P3'" class="P3">P3</span>
</span> </span>
<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 === 'threshold'">{{formatThreshold(scope.row[item.prop], scope.row.unit)}}</template> <template v-else-if="item.prop === 'threshold'">{{formatThreshold(scope.row[item.prop], scope.row.unit)}}</template>
<template v-else-if="item.prop === 'receivers'"> <template v-else-if="item.prop === 'receivers'">
<el-tag v-for="(user, index) in scope.row[item.prop]" v-if="user.userName" :key="index" class="alert-rule-tag" effect="dark" size="mini">{{user.userName}}&nbsp;</el-tag> <el-tag v-for="(user, index) in scope.row[item.prop]" v-if="user&&user.userName" :key="index" class="alert-rule-tag" effect="dark" size="mini">{{user.userName}}&nbsp;</el-tag>
</template> </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>
@@ -83,11 +82,13 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable: 'custom'
}, { }, {
label: this.$t('alert.alertName'), label: this.$t('alert.alertName'),
prop: 'name', prop: 'name',
show: true show: true,
sortable: 'custom'
}, { }, {
label: this.$t('alert.config.expr'), label: this.$t('alert.config.expr'),
prop: 'expr', prop: 'expr',
@@ -107,7 +108,8 @@ export default {
}, { }, {
label: this.$t('alert.severity'), label: this.$t('alert.severity'),
prop: 'severity', prop: 'severity',
show: true show: true,
sortable: 'custom'
}, { }, {
label: this.$t('alert.summary'), label: this.$t('alert.summary'),
prop: 'summary', prop: 'summary',
@@ -120,7 +122,8 @@ export default {
label: this.$t('alert.message'), label: this.$t('alert.message'),
prop: 'alertNum', prop: 'alertNum',
show: true, show: true,
width: 90 width: 150,
sortable: 'custom'
}, { }, {
label: this.$t('alert.config.receiver'), label: this.$t('alert.config.receiver'),
prop: 'receivers', prop: 'receivers',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -53,7 +54,19 @@
<!-- <span :title="scope.row.ruleName" class="nz-silence-tag-content">{{scope.row.ruleName}}</span>--> <!-- <span :title="scope.row.ruleName" class="nz-silence-tag-content">{{scope.row.ruleName}}</span>-->
<!-- </span>--> <!-- </span>-->
<!-- </div>--> <!-- </div>-->
matchers <span v-for="(item1, i) in labelsSort(scope.row.matchers)" :key="i">
<span >
<nz-alert-tag
v-if="item1.name !== 'alertname' && item1.name !== 'severity'" :key="i" :cursor-point="tagType(item1.name) !== 'info'"
:label="item1.name"
:type="tagType(item1.name)"
:regex="item1.regex"
style="margin: 5px 0 5px 5px;"
>
{{item1.value}}
</nz-alert-tag>
</span>
</span>
</template> </template>
<template v-else-if="item.prop === 'state'"> <template v-else-if="item.prop === 'state'">
<span v-if="scope.row.state===1" class="silence-pending">pending</span> <span v-if="scope.row.state===1" class="silence-pending">pending</span>
@@ -73,13 +86,13 @@
fixed="right"> fixed="right">
<div slot="header" class="table-operation-title">{{$t('overall.option')}}</div> <div slot="header" class="table-operation-title">{{$t('overall.option')}}</div>
<div slot-scope="scope" class="table-operation-items"> <div slot-scope="scope" class="table-operation-items">
<button class="table-operation-item" @click="copyRow(scope.row,'alertSilence')"><i class="nz-icon nz-icon-override"></i></button> <button class="table-operation-item" @click="$emit('edit', scope.row)"><i class="nz-icon nz-icon-edit"></i></button>
<el-dropdown size="medium" trigger="hover" @command="tableOperation"> <el-dropdown size="medium" trigger="hover" @command="tableOperation">
<div class="table-operation-item table-operation-item--more"> <div class="table-operation-item table-operation-item--more">
<span></span><i class="nz-icon nz-icon-arrow-down"></i> <span></span><i class="nz-icon nz-icon-arrow-down"></i>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item> <!-- <el-dropdown-item :command="['edit', scope.row]"><i class="nz-icon nz-icon-edit"></i><span class="operation-dropdown-text">{{$t('overall.edit')}}</span></el-dropdown-item>-->
<el-dropdown-item :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('buttons.expire')}}</span></el-dropdown-item> <el-dropdown-item :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('buttons.expire')}}</span></el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
@@ -91,8 +104,12 @@
<script> <script>
import table from '@/components/common/mixin/table' import table from '@/components/common/mixin/table'
import { calcDurationByStringTimeB } from '@/components/common/js/tools' import { calcDurationByStringTimeB } from '@/components/common/js/tools'
import nzAlertTag from '../../../page/alert/nzAlertTag'
export default { export default {
name: 'alertSilenceTable', name: 'alertSilenceTable',
components: {
nzAlertTag
},
mixins: [table], mixins: [table],
data () { data () {
return { return {
@@ -102,16 +119,19 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable: 'custom'
}, { }, {
label: 'matchers', label: 'matchers',
prop: 'matchers', prop: 'matchers',
show: true show: true,
sortable: 'custom'
}, { }, {
label: 'Start time', label: 'Start time',
prop: 'startAt', prop: 'startAt',
show: true, show: true,
width: 300 width: 300,
sortable: 'custom'
}, { }, {
label: this.$t('config.terminallog.duration'), label: this.$t('config.terminallog.duration'),
prop: 'duration', prop: 'duration',
@@ -144,6 +164,39 @@ export default {
} }
return calcDurationByStringTimeB(record.startAt, this.nowTime) return calcDurationByStringTimeB(record.startAt, this.nowTime)
} }
},
tagType () {
return (key) => {
if (key == 'asset' || key == 'module' || key == 'project' || key == 'datacenter' || key == 'endpoint') {
return 'normal'
} else {
return 'info'
}
}
}
},
methods: {
labelsSort (obj) {
obj = obj || []
const buildIn = ['asset', 'endpoint', 'module', 'project', 'datacenter']
if (typeof obj === 'string') obj = JSON.parse(obj)
const labels = JSON.parse(JSON.stringify(obj))
const result = []
const result2 = []
for (const key of buildIn) {
labels.forEach(item => {
if (item.name === key) {
result.push(item)
}
})
}
labels.forEach(item => {
if (buildIn.indexOf(item.name) === -1) {
result2.push(item)
}
})
console.log([...result, ...result2])
return [...result, ...result2]
} }
} }
} }

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -45,14 +46,16 @@
<div v-else-if="scope.row[item.prop] === 0">Disabled</div> <div v-else-if="scope.row[item.prop] === 0">Disabled</div>
</div> </div>
<div v-else-if=" item.prop === 'type' "> <div v-else-if=" item.prop === 'type' ">
<div v-if="scope.row[item.prop] == 'TEXT'&&'text'"><i class="nz-icon nz-icon-text"></i>TEXT</div> <div v-if="scope.row[item.prop].toUpperCase() == 'TEXT'"><i class="nz-icon nz-icon-text"></i>&nbsp;&nbsp;TEXT</div>
<div v-else-if="scope.row[item.prop] == 'multitext'"><i class="nz-icon nz-icon-multitext"></i>MULTITEXT</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'MULTITEXT'"><i class="nz-icon nz-icon-multitext"></i>&nbsp;&nbsp;MULTITEXT</div>
<div v-else-if="scope.row[item.prop] == 'textarea'"><i class="nz-icon nz-icon-textarea"></i>TEXTAREA</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'TEXTAREA'"><i class="nz-icon nz-icon-textarea"></i>&nbsp;&nbsp;TEXTAREA</div>
<div v-else-if="scope.row[item.prop] == 'radio'"><i class="nz-icon nz-icon-radio"></i>RADI0</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'RADIO'"><i class="nz-icon nz-icon-radio"></i>&nbsp;&nbsp;RADI0</div>
<div v-else-if="scope.row[item.prop] == 'checkbox'"><i class="nz-icon nz-icon-checkbox"></i>CHECKBOX</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'CHECKBOX'"><i class="nz-icon nz-icon-checkbox"></i>&nbsp;&nbsp;CHECKBOX</div>
<div v-else-if="scope.row[item.prop] == 'xialaxuanze'"><i class="nz-icon nz-icon-xialaxuanze"></i>SELECT</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'SELECT'"><i class="nz-icon nz-icon-xialaxuanze"></i>&nbsp;&nbsp;SELECT</div>
<div v-else-if="scope.row[item.prop] == 'integer'"><i class="nz-icon nz-icon-integer"></i>INTEGER</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'INTEGER'"><i class="nz-icon nz-icon-integer"></i>&nbsp;&nbsp;INTEGER</div>
<div v-else-if="scope.row[item.prop] == 'double'"><i class="nz-icon nz-icon-double"></i>DOUBLE</div> <div v-else-if="scope.row[item.prop].toUpperCase() == 'DOUBLE'"><i class="nz-icon nz-icon-double"></i>&nbsp;&nbsp;DOUBLE</div>
<div v-else-if="scope.row[item.prop].toUpperCase() == 'DATETIME'"><i class="nz-icon nz-icon-double"></i>&nbsp;&nbsp;DOUBLE</div>
<div v-else-if="scope.row[item.prop].toUpperCase() == 'EMAIL'"><i class="nz-icon nz-icon-double"></i>&nbsp;&nbsp;DOUBLE</div>
</div> </div>
<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>
@@ -91,20 +94,24 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.assetLabel.name'), label: this.$t('config.assetLabel.name'),
prop: 'name', prop: 'name',
show: true, show: true,
width: 100 width: 100,
sortable:'custom'
}, { }, {
label: this.$t('config.assetLabel.key'), label: this.$t('config.assetLabel.key'),
prop: 'metaKey', prop: 'metaKey',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.assetLabel.group'), label: this.$t('config.assetLabel.group'),
prop: 'group', prop: 'group',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.assetLabel.search'), label: this.$t('config.assetLabel.search'),
prop: 'search', prop: 'search',
@@ -126,7 +133,7 @@ export default {
} }
}, },
methods: { methods: {
} }
} }
</script> </script>

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -92,16 +93,19 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 110 width: 110,
sortable:'custom'
}, { }, {
label: this.$t('overall.name'), label: this.$t('overall.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('asset.manageIp'), label: this.$t('asset.manageIp'),
prop: 'manageIp', prop: 'manageIp',
show: true, show: true,
width: 120 width: 120,
sortable:'custom'
}, { }, {
label: this.$t('overall.parent'), label: this.$t('overall.parent'),
prop: 'parent', prop: 'parent',
@@ -111,42 +115,50 @@ export default {
label: this.$t('overall.type'), label: this.$t('overall.type'),
prop: 'type', prop: 'type',
show: true, show: true,
width: 140 width: 140,
sortable:'custom'
}, { }, {
label: this.$t('asset.state'), label: this.$t('asset.state'),
prop: 'state', prop: 'state',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('overall.dc'), label: this.$t('overall.dc'),
prop: 'dc', prop: 'dc',
show: true, show: true,
width: 110 width: 110,
sortable:'custom'
}, { }, {
label: this.$t('asset.cabinet'), label: this.$t('asset.cabinet'),
prop: 'cabinet', prop: 'cabinet',
show: true, show: true,
width: 110 width: 110,
sortable:'custom'
}, { }, {
label: this.$t('asset.alertNum'), label: this.$t('asset.alertNum'),
prop: 'alertNum', prop: 'alertNum',
show: true, show: true,
width: 140 width: 140,
sortable:'custom'
}, { }, {
label: this.$t('asset.endpointNum2'), label: this.$t('asset.endpointNum2'),
prop: 'endpointNum', prop: 'endpointNum',
show: true, show: true,
width: 140 width: 140,
sortable:'custom'
}, { }, {
label: this.$t('asset.brand'), label: this.$t('asset.brand'),
prop: 'brand', prop: 'brand',
show: true, show: true,
width: 120 width: 120,
sortable:'custom'
}, { }, {
label: this.$t('asset.model'), label: this.$t('asset.model'),
prop: 'model', prop: 'model',
show: true, show: true,
width: 110 width: 110,
sortable:'custom'
}, { }, {
label: 'SN', label: 'SN',
prop: 'sn', prop: 'sn',

View File

@@ -5,7 +5,7 @@
<!-- 顶部工具栏 --> <!-- 顶部工具栏 -->
<div class="main-modal"></div> <div class="main-modal"></div>
<div class="main-container"> <div class="main-container">
<div v-show="bottomBox.mainResizeShow" class="top-tools"> <div v-show="bottomBox.mainResizeShow" :style="from === fromRoute.project ? 'padding-right: 5px' : ''" class="top-tools">
<div class="top-tool-left" style="min-width: 300px"> <div class="top-tool-left" style="min-width: 300px">
<slot name="top-tool-left"></slot> <slot name="top-tool-left"></slot>
</div> </div>
@@ -25,10 +25,10 @@
<div v-if="showLayout.indexOf('clickSearch') > -1" class="search-box"> <div v-if="showLayout.indexOf('clickSearch') > -1" class="search-box">
<slot name="search"></slot> <slot name="search"></slot>
</div> </div>
<div v-show="bottomBox.mainResizeShow" class="nz-table2"> <div v-show="bottomBox.mainResizeShow" :style="from === fromRoute.project ? 'padding-right: 5px' : ''" class="nz-table2">
<slot v-bind:mainResizeShow="bottomBox.mainResizeShow"></slot> <slot v-bind:mainResizeShow="bottomBox.mainResizeShow"></slot>
</div> </div>
<div v-show="bottomBox.mainResizeShow" class="pagination-bottom"> <div v-show="bottomBox.mainResizeShow" :style="from === fromRoute.project ? 'width: calc(100% - 15px);bottom: 18px' : ''" class="pagination-bottom">
<slot name="pagination"></slot> <slot name="pagination"></slot>
</div> </div>
</div> </div>
@@ -62,6 +62,7 @@
</template> </template>
<script> <script>
import { fromRoute } from '@/components/common/js/constants'
import bottomBox from '@/components/common/bottomBox/bottomBox' import bottomBox from '@/components/common/bottomBox/bottomBox'
import { bottomBoxWindow } from '@/components/common/js/tools' import { bottomBoxWindow } from '@/components/common/js/tools'
@@ -91,6 +92,7 @@ export default {
}, },
data () { data () {
return { return {
fromRoute: fromRoute,
/* 二级页面相关 */ /* 二级页面相关 */
bottomBox: { bottomBox: {
object: {}, object: {},

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -84,11 +85,13 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.dc.dc'), label: this.$t('config.agent.name'),
prop: 'dc', prop: 'dc',
show: true show: true,
sortable:'custom'
}, { }, {
label: 'Host', label: 'Host',
prop: 'host', prop: 'host',
@@ -100,11 +103,13 @@ export default {
}, { }, {
label: this.$t('config.agent.type'), label: this.$t('config.agent.type'),
prop: 'type', prop: 'type',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('asset.state'), label: this.$t('asset.state'),
prop: 'status', prop: 'status',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.agent.checkTime'), label: this.$t('config.agent.checkTime'),
prop: 'checkTime', prop: 'checkTime',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
> >
<template slot="header"> <template slot="header">
@@ -97,12 +98,14 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.assetType.name'), label: this.$t('config.assetType.name'),
prop: 'name', prop: 'name',
show: true, show: true,
width: 120 width: 120,
sortable:'custom'
}, { }, {
label: this.$t('config.assetType.vm'), label: this.$t('config.assetType.vm'),
prop: 'vm', prop: 'vm',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -75,19 +76,23 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.name'), label: this.$t('config.exprTemp.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.type'), label: this.$t('config.exprTemp.type'),
prop: 'type', prop: 'type',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.varType'), label: this.$t('config.exprTemp.varType'),
prop: 'varType', prop: 'varType',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.remark'), label: this.$t('config.exprTemp.remark'),
prop: 'remark', prop: 'remark',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -96,15 +97,18 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('overall.name'), label: this.$t('overall.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.mib.credential.type'), label: this.$t('config.mib.credential.type'),
prop: 'type', prop: 'type',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.mib.credential.port'), label: this.$t('config.mib.credential.port'),
prop: 'port', prop: 'port',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -61,12 +62,12 @@
</template> </template>
<template v-else-if="item.prop === 'assetNum'"> <template v-else-if="item.prop === 'assetNum'">
<span class="endpoint-num" @click="showBottomBox('asset', scope.row)"> <span class="endpoint-num" @click="showBottomBox('asset', scope.row)">
<i class="nz-icon nz-icon-overview-project" :class="scope.row[item.prop]>0?'color23BF9A':'color23BF9A'"/> <i class="nz-icon nz-icon-overview-project monitorColor" :class="scope.row[item.prop]>0?'color23BF9A':'color23BF9A'"/>
{{scope.row[item.prop]}} {{scope.row[item.prop]}}
</span> </span>
</template> </template>
<template v-else-if="item.prop === 'alertNum'"> <template v-else-if="item.prop === 'alertNum'">
<span class="alert-num" @click="showBottomBox('moduleAlertMessage', scope.row)"> <span class="alert-num" @click="showBottomBox('alertMessageTab', scope.row)">
<i class="nz-icon nz-icon-overview-alert" :class="scope.row[item.prop]>0?'colorEF7458':'color23BF9A'"/> <i class="nz-icon nz-icon-overview-alert" :class="scope.row[item.prop]>0?'colorEF7458':'color23BF9A'"/>
{{scope.row[item.prop]}} {{scope.row[item.prop]}}
</span> </span>
@@ -74,7 +75,7 @@
<template v-else-if="item.prop === 'cabinetNum'"> <template v-else-if="item.prop === 'cabinetNum'">
<span class="alert-num" @click="showBottomBox('cabinet', scope.row)"> <span class="alert-num" @click="showBottomBox('cabinet', scope.row)">
<i class="nz-icon nz-icon-cabinet" :class="scope.row[item.prop]>0?'color23BF9A':'colorEF7458'"/> <i class="nz-icon nz-icon-cabinet monitorColor" :class="scope.row[item.prop]>0?'color23BF9A':'colorEF7458'"/>
{{scope.row[item.prop]}} {{scope.row[item.prop]}}
</span> </span>
</template> </template>
@@ -116,11 +117,13 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('overall.name'), label: this.$t('overall.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('asset.location'), label: this.$t('asset.location'),
prop: 'location', prop: 'location',
@@ -128,11 +131,13 @@ export default {
}, { }, {
label: this.$t('config.dc.cabinetNum'), label: this.$t('config.dc.cabinetNum'),
prop: 'cabinetNum', prop: 'cabinetNum',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.dc.assets'), label: this.$t('config.dc.assets'),
prop: 'assetNum', prop: 'assetNum',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.dc.alert'), label: this.$t('config.dc.alert'),
prop: 'alertNum', prop: 'alertNum',
@@ -156,7 +161,8 @@ export default {
}, { }, {
label: this.$t('config.dc.state'), label: this.$t('config.dc.state'),
prop: 'state', prop: 'state',
show: true show: true,
sortable:'custom'
} }
] ]
} }

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -120,11 +121,13 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('project.endpoint.name'), label: this.$t('project.endpoint.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('project.module.type'), label: this.$t('project.module.type'),
prop: 'type', prop: 'type',
@@ -132,12 +135,14 @@ export default {
}, { }, {
label: this.$t('project.project.project'), label: this.$t('project.project.project'),
prop: 'project', prop: 'project',
show: true show: true,
sortable:'custom'
}, },
{ {
label: this.$t('project.endpoint.asset'), label: this.$t('project.endpoint.asset'),
prop: 'asset', prop: 'asset',
show: true show: true,
sortable:'custom'
}, },
{ {
label: this.$t('project.module.module'), label: this.$t('project.module.module'),
@@ -152,12 +157,14 @@ export default {
{ {
label: this.$t('project.endpoint.alerts'), label: this.$t('project.endpoint.alerts'),
prop: 'alerts', prop: 'alerts',
show: true show: true,
sortable:'custom'
}, },
{ {
label: this.$t('project.endpoint.state'), label: this.$t('project.endpoint.state'),
prop: 'state', prop: 'state',
show: true show: true,
sortable:'custom'
} }
] ]
} }

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -70,15 +71,18 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.name'), label: this.$t('config.exprTemp.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.gname'), label: this.$t('config.exprTemp.gname'),
prop: 'gname', prop: 'gname',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.exprTemp.expression'), label: this.$t('config.exprTemp.expression'),
prop: 'expression', prop: 'expression',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -104,11 +105,13 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('overall.name'), label: this.$t('overall.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.mib.fileName'), label: this.$t('config.mib.fileName'),
prop: 'fileName', prop: 'fileName',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
> >
<template slot="header"> <template slot="header">
@@ -44,6 +45,12 @@
{{scope.row.brand.name}} {{scope.row.brand.name}}
</template> </template>
<span v-else-if="item.prop === 'createTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span> <span v-else-if="item.prop === 'createTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<template v-else-if="item.prop === 'assetNum'">
<span class="endpoint-num" @click="showBottomBox('asset', scope.row)">
<i class="nz-icon nz-icon-overview-project monitorColor" :class="scope.row[item.prop]>0?'color23BF9A':'color23BF9A'"/>
{{scope.row[item.prop]}}
</span>
</template>
<span v-else>{{scope.row[item.prop]}}</span> <span v-else>{{scope.row[item.prop]}}</span>
</template> </template>
</el-table-column> </el-table-column>
@@ -80,17 +87,20 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.model.name'), label: this.$t('config.model.name'),
prop: 'name', prop: 'name',
show: true, show: true,
width: 160 width: 160,
sortable:'custom'
}, { }, {
label: this.$t('config.model.brand'), label: this.$t('config.model.brand'),
prop: 'brand', prop: 'brand',
show: true, show: true,
width: 160 width: 160
,sortable:'custom'
}, { }, {
label: this.$t('config.model.remark'), label: this.$t('config.model.remark'),
prop: 'remark', prop: 'remark',
@@ -99,7 +109,8 @@ export default {
label: this.$t('config.model.assetNum'), label: this.$t('config.model.assetNum'),
prop: 'assetNum', prop: 'assetNum',
show: true, show: true,
width: 200 width: 200,
sortable:'custom'
} }
] ]
} }

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -90,12 +91,14 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('project.module.moduleName'), label: this.$t('project.module.moduleName'),
prop: 'name', prop: 'name',
show: true, show: true,
minWidth: 200 minWidth: 200,
sortable:'custom'
}, { }, {
label: this.$t('project.module.type'), label: this.$t('project.module.type'),
prop: 'type', prop: 'type',
@@ -105,18 +108,21 @@ export default {
label: this.$t('project.project.project'), label: this.$t('project.project.project'),
prop: 'project', prop: 'project',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, },
{ {
label: this.$t('project.endpoint.endpoint'), label: this.$t('project.endpoint.endpoint'),
prop: 'endpointNum', prop: 'endpointNum',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, { }, {
label: this.$t('project.module.alerts'), label: this.$t('project.module.alerts'),
prop: 'alertNum', prop: 'alertNum',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, },
{ {
label: this.$t('overall.remark'), label: this.$t('overall.remark'),

View File

@@ -126,9 +126,6 @@ export default {
return '-' return '-'
} }
} }
},
mounted () {
console.info(this.customTableTitle)
} }
} }
</script> </script>

View File

@@ -4,6 +4,7 @@
ref="dataTable" ref="dataTable"
:data="tableData" :data="tableData"
:height="height" :height="height"
style="width: calc(100% - 25px)"
border border
@header-dragend="dragend" @header-dragend="dragend"
@sort-change="tableDataSort" @sort-change="tableDataSort"
@@ -25,6 +26,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -92,27 +94,32 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('project.project.project'), label: this.$t('project.project.project'),
prop: 'name', prop: 'name',
show: true, show: true,
minWidth: 150 minWidth: 150,
sortable:'custom'
}, { }, {
label: this.$t('project.module.module'), label: this.$t('project.module.module'),
prop: 'moduleNum', prop: 'moduleNum',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, { }, {
label: this.$t('project.endpoint.endpoint'), label: this.$t('project.endpoint.endpoint'),
prop: 'endpointNum', prop: 'endpointNum',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, { }, {
label: this.$t('project.endpoint.alerts'), label: this.$t('project.endpoint.alerts'),
prop: 'alertNum', prop: 'alertNum',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, },
{ {
label: this.$t('overall.remark'), label: this.$t('overall.remark'),

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
class="data-column" class="data-column"
> >
@@ -79,11 +80,13 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.roles.name'), label: this.$t('config.roles.name'),
prop: 'name', prop: 'name',
show: true show: true,
sortable:'custom'
}, { }, {
label: this.$t('config.roles.description'), label: this.$t('config.roles.description'),
prop: 'remark', prop: 'remark',

View File

@@ -25,6 +25,7 @@
:prop="item.prop" :prop="item.prop"
:resizable="true" :resizable="true"
:sort-orders="['ascending', 'descending']" :sort-orders="['ascending', 'descending']"
:sortable="item.sortable"
:width="`${item.width}`" :width="`${item.width}`"
> >
<template slot="header"> <template slot="header">
@@ -87,12 +88,14 @@ export default {
label: 'ID', label: 'ID',
prop: 'id', prop: 'id',
show: true, show: true,
width: 80 width: 80,
sortable:'custom'
}, { }, {
label: this.$t('config.user.name'), label: this.$t('config.user.name'),
prop: 'name', prop: 'name',
show: true, show: true,
width: 150 width: 150,
sortable:'custom'
}, { }, {
label: this.$t('config.user.username'), label: this.$t('config.user.username'),
prop: 'username', prop: 'username',

View File

@@ -141,7 +141,6 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$get("/prom/api/v1/query?query={endpoint='" + this.currentEndpoint.id + "'}&time=" + new Date(this.formatTime).getTime()).then(response => { this.$get("/prom/api/v1/query?query={endpoint='" + this.currentEndpoint.id + "'}&time=" + new Date(this.formatTime).getTime()).then(response => {
this.loading = false this.loading = false
response = JSON.parse(localStorage.getItem('queryData'))
if (response.status === 'success') { if (response.status === 'success') {
const results = response.data.result const results = response.data.result
this.queryData = JSON.parse(JSON.stringify(results)) this.queryData = JSON.parse(JSON.stringify(results))
@@ -150,7 +149,7 @@ export default {
this.$nextTick(this.$refs.dataTable.doLayout()) this.$nextTick(this.$refs.dataTable.doLayout())
if (!this.scrollbarWrap) { if (!this.scrollbarWrap) {
this.$nextTick(() => { this.$nextTick(() => {
this.scrollbarWrap = this.$refs.dataTable.$refs.singleTable.bodyWrapper // this.scrollbarWrap = this.$refs.dataTable.$refs.singleTable.bodyWrapper
// this.toTopBtnHandler(this.scrollbarWrap) // this.toTopBtnHandler(this.scrollbarWrap)
}) })
} }

View File

@@ -19,6 +19,7 @@ export default {
box-sizing: border-box; box-sizing: border-box;
height: calc(100% - 50px); height: calc(100% - 50px);
background-color: #f6f6f6; background-color: #f6f6f6;
width: 100%;
&>div { &>div {
height: 100%; height: 100%;

View File

@@ -23,14 +23,15 @@
</div> </div>
</el-dropdown> </el-dropdown>
<el-dropdown> <el-dropdown>
<div class="header-menu__item"><i class="nz-icon nz-icon-create-square"></i></div> <div class="header-menu__item" @click="centerDialogVisible = true"><i class="nz-icon nz-icon-guide"></i></div>
<el-dropdown-menu slot="dropdown"> <!-- <el-dialog
<el-dropdown-item v-for="(item, createIndex) in createMenu" :key="createIndex" v-has="item.permission" :index="`${createIndex}`"> title="Get started in 6 steps"
<div :id="'create-box-'+createIndex"> :visible.sync="centerDialogVisible"
<span>{{item.label}}</span> :show="centerDialogVisible"
</div> center>
</el-dropdown-item> <path-navigation></path-navigation>
</el-dropdown-menu> </el-dialog> -->
<path-navigation :show.sync="centerDialogVisible"></path-navigation>
</el-dropdown> </el-dropdown>
</div> </div>
<!--个人操作--> <!--个人操作-->
@@ -68,10 +69,12 @@
import bus from '../../libs/bus' import bus from '../../libs/bus'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import changePin from '../page/config/changePin' import changePin from '../page/config/changePin'
import PathNavigation from './path_navigation/PathNavigation'
export default { export default {
name: 'Header', name: 'Header',
components: { components: {
'change-password': changePin, 'change-password': changePin,
PathNavigation
}, },
data () { data () {
return { return {
@@ -111,7 +114,8 @@ export default {
permission: 'header_add_rule' permission: 'header_add_rule'
} }
], ],
showChangePin: false showChangePin: false,
centerDialogVisible: false
} }
}, },
methods: { methods: {
@@ -239,6 +243,22 @@ export default {
text-align: center; text-align: center;
height: 36px; height: 36px;
line-height: 50px; line-height: 50px;
.el-dialog{
width: 1000px;
height: 70px;
.el-dialog__header{
background-color: orange;
.el-dialog__title{
color: #fff;
}
.el-dialog__close{
color: #fff;
line-height: 50px;
font-size: 30px;
}
}
}
} }
} }
.header-menu--item { .header-menu--item {

View File

@@ -52,7 +52,7 @@ export default {
.body { .body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: auto; width: calc(100% - 240px);
transition: all .2s; transition: all .2s;
} }
} }

View File

@@ -0,0 +1,172 @@
<template>
<div class="navigation">
<el-dialog title="Get started in 6 steps" :visible.sync="show" center>
<el-tabs type="border-card">
<el-tab-pane>
<span slot="label"
><i class="nz-icon nz-icon-datacenter1"></i> 我的行程</span
>
<div style="margin-top: 0">
1sadssssssssssssssssssssssasddddddddddddddddddddddddddddddddddddsdsadasdasdasdasdasdasdasdassssssssssssssssssssssssssssssssssssssssssddddd
</div>
<div style="margin-top: 0">
1sadssssssssssssssssssssssasddddddddddddddddddddddddddddddddddddsdasdassssssssssssssssssssssssssssssssssssssssssddddd
</div>
<el-button @click="addDatacenter">add a</el-button>
<el-button @click="addCabinet">add b</el-button>
</el-tab-pane>
<el-tab-pane>
<span slot="label"
><i class="nz-icon nz-icon-agent"></i> 我的行程</span
>
<div>1</div>
<el-button @click="addAgent">add a</el-button>
<el-button @click="downloadAgent">add b</el-button>
</el-tab-pane>
<el-tab-pane>
<span slot="label"
><i class="nz-icon nz-icon-menu-assets"></i> 我的行程</span
>
<div>1</div>
<el-button @click="addAsset">add a</el-button>
<el-button @click="importAsset">add b</el-button>
<el-button @click="webTerminal">add c</el-button>
</el-tab-pane>
<el-tab-pane>
<span slot="label"
><i class="nz-icon nz-icon-menu-project"></i> 我的行程</span
>
<div>1</div>
<el-button @click="addPeoject">add a</el-button>
<el-button @click="addModule">add b</el-button>
<el-button @click="addEndpoint">add c</el-button>
<el-button @click="importEndpoint">add d</el-button>
</el-tab-pane>
<el-tab-pane>
<span slot="label"
><i class="nz-icon nz-icon-visualization"></i> 我的行程</span
>
<div>1</div>
<el-button @click="addPanel">add a</el-button>
<el-button @click="addChart">add b</el-button>
</el-tab-pane>
<el-tab-pane>
<span slot="label"
><i class="nz-icon nz-icon-terminal-log"></i> 我的行程</span
>
<div>1</div>
<el-button @click="addAlertRule">add a</el-button>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
<script>
import DcBox from "@/components/common/rightBox/dcBox";
export default {
props: {
show: Boolean,
},
components: {
DcBox
},
data() {
return {};
},
methods: {
// Datacenter
addDatacenter() {
this.$router.push({
path: "/dc",
});
this.$emit("update:show", false);
},
addCabinet() {
console.log(2);
console.log(this.$route);
this.$router.push({
path: "/dc/cabinet",
});
this.$emit("update:show", false);
},
// Angebt
addAgent() {
this.$router.push({
path: "/agent",
});
this.$emit("update:show", false);
},
downloadAgent() {
console.log(4);
},
// Asset
addAsset() {
this.$router.push({
path: "/asset",
});
this.$emit("update:show", false);
},
importAsset() {
console.log(6);
},
webTerminal() {
console.log(7);
},
// Monitor
addPeoject() {
this.$router.push({
path: "/monitor/project",
});
this.$emit("update:show", false);
},
addModule() {
console.log(9);
},
addEndpoint() {
console.log(10);
},
importEndpoint() {
console.log(11);
},
// Visualization
addPanel() {
this.$router.push({
path: "/panel",
});
this.$emit("update:show", false);
},
addChart() {
console.log(13);
},
// Alert
addAlertRule() {
this.$router.push({
path: "/alertRule",
});
this.$emit("update:show", false);
},
},
computed: {},
};
</script>
<style lang="scss">
.el-dialog__body {
background-color: #fff;
.el-tab-pane {
text-align: center;
div {
text-align: left;
line-height: 20px;
}
.el-button {
width: 156px;
height: 46px;
border-radius: 2px;
background-color: #666;
span {
color: #fff;
}
}
}
}
</style>

View File

@@ -655,19 +655,6 @@ export default {
} }
this.getTableData() this.getTableData()
}, },
// 数据排序
tableDataSort (item) {
let orderBy = ''
if (item.order === 'ascending') {
orderBy = item.prop
}
if (item.order === 'descending') {
orderBy = '-' + item.prop
}
this.pageObj.orderBy = orderBy
this.$set(this.searchLabel, 'orderBy', orderBy)
this.getTableData()
}
} }
} }
</script> </script>

View File

@@ -84,9 +84,10 @@ export default {
unit: 2, unit: 2,
operator: '>', operator: '>',
last: 60, last: 60,
severity: 'P2', severityId: '',
summary: '', summary: '',
description: '' description: '',
method: []
}, },
searchMsg: { // 给搜索框子组件传递的信息 searchMsg: { // 给搜索框子组件传递的信息
zheze_none: true, zheze_none: true,
@@ -147,6 +148,17 @@ export default {
} }
}) })
}, },
edit (u) {
this.$get(`${this.url}/${u.id}`).then(response => {
if (response.code === 200) {
this.object = {
...response.data,
method: response.data.method ? response.data.method.split(',').map(item => Number(item)) : []
}
this.rightBox.show = true
}
})
},
initEvent () { initEvent () {
bus.$on('alert-rule-list-change', () => { bus.$on('alert-rule-list-change', () => {
this.getTableData() this.getTableData()

View File

@@ -127,7 +127,7 @@ export default {
linkId: '', linkId: '',
reason: '', reason: '',
time: [], time: [],
matcher: [ matchers: [
{ name: '', value: '', regex: 0 } { name: '', value: '', regex: 0 }
], ],
name: '' name: ''
@@ -172,7 +172,18 @@ export default {
this.blackObject.endAt = bus.timeFormate(bus.getOffsetTimezoneData(1), 'yyyy-MM-dd hh:mm:ss') this.blackObject.endAt = bus.timeFormate(bus.getOffsetTimezoneData(1), 'yyyy-MM-dd hh:mm:ss')
this.object = JSON.parse(JSON.stringify(this.blackObject)) this.object = JSON.parse(JSON.stringify(this.blackObject))
this.rightBox.show = true this.rightBox.show = true
} },
edit (u) {
this.$get(`${this.url}/${u.id}`).then(response => {
if (response.code === 200) {
this.object = {
...response.data,
matchers: JSON.parse(response.data.matchers)
}
this.rightBox.show = true
}
})
},
} }
} }
</script> </script>

View File

@@ -1,7 +1,7 @@
<template> <template>
<span class="nz-alert-tag" :class="['nz-alert-tag_' + type]" :style="{cursor: cursorPoint ? 'pointer' : 'default'}" @click="$emit('click')"> <span class="nz-alert-tag" :class="['nz-alert-tag_' + type]" :style="{cursor: cursorPoint ? 'pointer' : 'default'}" @click="$emit('click')">
<span class="nz-alert-tag__label">{{label}}</span> <span class="nz-alert-tag__label"> {{label}}</span>
<span class="nz-alert-tag__content"><slot></slot></span> <span class="nz-alert-tag__content"><span v-if="!!regex"> ~ </span> <slot></slot></span>
</span> </span>
</template> </template>
@@ -11,7 +11,8 @@ export default {
props: { props: {
label: String, // 标题 label: String, // 标题
type: { type: String, default: 'normal' }, // normal:blue; success:green; info:gray; danger:red; warning:orange; type: { type: String, default: 'normal' }, // normal:blue; success:green; info:gray; danger:red; warning:orange;
cursorPoint: { type: Boolean, default: true } // 是否鼠标悬停变手指 cursorPoint: { type: Boolean, default: true }, // 是否鼠标悬停变手指
regex: { type: Number, default: 0 }
}, },
methods: { methods: {
}, },

View File

@@ -56,7 +56,7 @@
</nz-data-list> </nz-data-list>
<!--侧滑--> <!--侧滑-->
<transition name="right-box"> <transition name="right-box">
<asset-meta-box v-if="rightBox.metaShow" ref="assetMetaBox" v-bind:asset-label="object" @close="closeRightBox"></asset-meta-box> <asset-meta-box v-if="rightBox.metaShow" ref="assetMetaBox" :obj="object" @close="closeRightBox"></asset-meta-box>
</transition> </transition>
<transition name="right-box"> <transition name="right-box">
<asset-meta-group v-if="rightBox.groupShow" :metaGroup="metaGroup" @close="closeRightBox" <asset-meta-group v-if="rightBox.groupShow" :metaGroup="metaGroup" @close="closeRightBox"
@@ -128,9 +128,9 @@ export default {
name: '', name: '',
metaKey: '', metaKey: '',
groupId: '', groupId: '',
search: 1, search: '0',
display: 1, display: '0',
type: 'text', type: 'TEXT',
param: {}, param: {},
remark: '' remark: ''
}, },
@@ -227,14 +227,9 @@ export default {
}, },
add () { add () {
this.object = JSON.parse(JSON.stringify(this.blankObject)) this.object = JSON.parse(JSON.stringify(this.blankObject))
console.log(this.object);
this.rightBox.metaShow = true this.rightBox.metaShow = true
}, },
edit (row) { edit (row) {
/* this.$get('asset/field/meta/' + row.id).then(res => {
this.object = { ...res.data, param: JSON.parse(res.data.param) }
this.rightBox.metaShow = true
}) */
this.object = JSON.parse(JSON.stringify(row)) this.object = JSON.parse(JSON.stringify(row))
this.rightBox.metaShow = true this.rightBox.metaShow = true
}, },

View File

@@ -65,7 +65,6 @@ export default {
showTab: String showTab: String
}, },
components: { components: {
mibBrowser,
deleteButton, deleteButton,
nzDataList, nzDataList,
credentialsTable, credentialsTable,

View File

@@ -1,5 +1,166 @@
<template> <template>
<span class="mib-browser"> <div class="mib-browser" style="height: 100%">
<nz-data-list
v-if="showTab === 'browser'"
ref="dataList"
>
<template v-slot:top-tool-left>
<div id="module-type-1" class="nz-tab-item-box" @click="clickTab(['mib','file'],'file')">
<div class="nz-tab-item">{{$t("config.mib.mibFiles")}}</div>
</div>
<div id="module-type-2" class="nz-tab-item-box">
<div class="nz-tab-item nz-tab-item-active">{{$t("config.mib.mibBrowser")}}</div>
</div>
<div id="module-type-3" class="nz-tab-item-box" @click="clickTab(['mib','credentials'],'credentials')">
<div class="nz-tab-item">{{$t("config.mib.credentials")}}</div>
</div>
</template>
<template v-slot:top-tool-right>
<el-autocomplete
id="mib-browser-host"
v-model="searchParam.host"
:fetch-suggestions="assetSuggestion"
class="margin-r-20"
placeholder="IP"
size="small"
style="width: 100%;"
value-key="manageIp"
@input="assetChange"
>
<template slot-scope="{ item }">
<div>{{ item.manageIp }}</div>
</template>
</el-autocomplete>
<el-input id="mib-browser-oid" v-model="searchParam.oid" class="margin-r-20" placeholder="OID" size="small"></el-input>
<div class="margin-r-10" style="width: 50%">
<el-select id="mib-browser-host" v-model="searchParam.operation" size="small">
<el-option v-for="item in operationData" :key="item" :value="item"></el-option>
</el-select>
</div>
<div class="top-tool-btn-group">
<el-popover :offset="-143" placement="bottom" trigger="click" width="300">
<div class="mib-browser-ad-search">
<el-select v-model="searchParam.snmpCredentialId" placeholder="Select credential" size="mini" style="width: 300px" value-key="id">
<el-option v-for="(item, index) in credentialData" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
<button id="browser-advanced" slot="reference" class="top-tool-btn" style="border-right: none;">
<i class="el-icon-more"></i>
</button>
</el-popover>
<button id="browser-go" :class="{'nz-btn-disabled': loading}" class="top-tool-btn" @click="search(false)">Go</button>
</div>
</template>
<template v-slot>
<div class="mib-browser-box">
<!--左半部分-->
<div class="mib-browser-left">
<div class="mib-browser-tree-title">
<span>SNMP MIBs</span>
<el-dropdown ref="modelDropdown" :hide-on-click="false" trigger="click" @command="selectModel">
<span class="mib-browser-table-op">{{$t("config.model.model") + " "}}<i class="nz-icon nz-icon-funnel"></i></span>
<el-dropdown-menu slot="dropdown" class="mib-browser-model-dropdown el-dropdown-multi">
<el-dropdown-item v-for="(item, index) in modelData" :key="index" :class="{'dropdown-item-active': walkParam.models.indexOf(item.id) > -1}" :command="item">{{item.name}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<!--tree-->
<div ref="treeScrollbar" class="mib-browser-tree">
<el-tree
ref="walkTree"
v-loading="treeLoading"
:data="walkData"
:expand-on-click-node="false"
:props="{label: 'name', children: 'subTree'}"
check-on-click-node
check-strictly
highlight-current
node-key="objectID"
@node-click="showDetail"
>
<div slot-scope="{node, data}" class="walk-tree-item">
<span v-if="!data.type"><i class="nz-icon nz-icon-reading"></i></span>
<span v-else>
<i v-if="data.type.toUpperCase() == 'IDENTIFIER'" class="el-icon-folder-opened"></i>
<i v-if="data.type.toUpperCase() == 'OBJECT' && data.subTree.length > 0" class="el-icon-folder-opened"></i>
<i v-if="data.type.toUpperCase() == 'OBJECT' && data.subTree.length == 0" class="nz-icon nz-icon-leaf"></i>
<i v-if="data.type.toUpperCase() == 'ENTRY'" class="nz-icon nz-icon-table-edit"></i>
<i v-if="data.type.toUpperCase() == 'TABLE'" class="nz-icon nz-icon-table"></i>
</span>
{{data.name}}
</div>
</el-tree>
</div>
<!--拖拽区-->
<div class="tree-detail-resize" @mousedown="treeDetailResize"></div>
<!--detail-->
<div ref="detailScrollbar" class="mib-browser-detail">
<div class="mib-browser-detail-row">
<div>Name</div>
<div>{{currentWalk.name}}</div>
</div>
<div class="mib-browser-detail-row">
<div>OID</div>
<div>{{currentWalk.objectID}}</div>
</div>
<div class="mib-browser-detail-row">
<div>MIB</div>
<div>{{mibName(currentWalk.objectID)}}</div>
</div>
<div class="mib-browser-detail-row">
<div>Syntax</div>
<div>{{currentWalk.syntax}}</div>
</div>
<div class="mib-browser-detail-row">
<div>Access</div>
<div>{{currentWalk.access}}</div>
</div>
<div class="mib-browser-detail-row">
<div>Status</div>
<div>{{currentWalk.status}}</div>
</div>
<div class="mib-browser-detail-row">
<div>Indexes</div>
<div>{{currentWalk.index && currentWalk.index.length > 0 ? currentWalk.index : ""}}</div>
</div>
<div class="mib-browser-detail-row">
<div>Description</div>
<div>{{currentWalk.description}}</div>
</div>
</div>
</div>
<!--拖拽区-->
<div class="left-right-resize" @mousedown="leftRightResize"></div>
<!--右半部分-->
<div class="mib-browser-right">
<div class="mib-browser-table-title">
<span>Result table</span>
<span>
<span id="mib-browser-export" v-has="'snmp_browser_export'" :class="{'mib-browser-table-op-light': resultData.length == 0}" :title="$t('overall.exportExcel')" class="mib-browser-table-op" @click="exportXlsx"><i class="nz-icon nz-icon-download1"></i></span>
<span id="mib-browser-clear" :title="$t('overall.clear')" class="mib-browser-table-op" @click="clearResult"><i class="nz-icon nz-icon-close"></i></span>
</span>
</div>
<pl-table v-if="showTable" ref="resultTable" v-loading="loading" :datas="resultData" :empty-text="$t('config.mib.noData')" :pagination-show="false" :row-height="28"
border class="mib-browser-table" size="small" style="width: 100%; height: 100%" use-virtual>
<pl-table-column v-slot="{row}" label="Name/OID">
<div class="too-long-split" @click="searchParam.oid = row.oid">{{row.name ? row.name : row.oid}}</div>
</pl-table-column>
<pl-table-column v-slot="{row}" label="Value">
<template><div @click="searchParam.oid = row.oid">{{row.value}}</div></template>
</pl-table-column>
<pl-table-column v-slot="{row}" label="Type">
<template><div @click="searchParam.oid = row.oid">{{row.type}}</div></template>
</pl-table-column>
<pl-table-column v-slot="{row}" label="IP:Port">
<template><div @click="searchParam.oid = row.oid">{{row.ip + (row.port ? ":" + row.port : "")}}</div></template>
</pl-table-column>
</pl-table>
</div>
</div>
</template>
</nz-data-list>
</div>
<!-- <span class="mib-browser">
<div class="top-tools"> <div class="top-tools">
<div class="nz-tab top-tool-main-right top-tool-main-right-to-left-little" style="width: 300px"> <div class="nz-tab top-tool-main-right top-tool-main-right-to-left-little" style="width: 300px">
<div class="nz-tab-item-box" @click="toFileTab" id="module-type-3"> <div class="nz-tab-item-box" @click="toFileTab" id="module-type-3">
@@ -33,7 +194,7 @@
<el-input size="mini" v-model="searchParam.oid" placeholder="OID" id="mib-browser-oid"></el-input> <el-input size="mini" v-model="searchParam.oid" placeholder="OID" id="mib-browser-oid"></el-input>
</div> </div>
<div class="nz-btn-group nz-btn-group-size-normal nz-btn-group-light margin-l-20 mib-browser-btn-group"> <div class="nz-btn-group nz-btn-group-size-normal nz-btn-group-light margin-l-20 mib-browser-btn-group">
<!--<div class="el-popover mib-browser-ad-tip" v-show="searchParam.version != 2 || searchParam.port != 161 || searchParam.community != 'public'"><i class="el-icon-more"></i></div>--> &lt;!&ndash;<div class="el-popover mib-browser-ad-tip" v-show="searchParam.version != 2 || searchParam.port != 161 || searchParam.community != 'public'"><i class="el-icon-more"></i></div>&ndash;&gt;
<el-select class="nz-input-group-left input-x-mini-24 operation" v-model="searchParam.operation" id="mib-browser-host"> <el-select class="nz-input-group-left input-x-mini-24 operation" v-model="searchParam.operation" id="mib-browser-host">
<el-option v-for="item in operationData" :key="item" :value="item"></el-option> <el-option v-for="item in operationData" :key="item" :value="item"></el-option>
</el-select><el-popover trigger="click" placement="bottom" @show="popShow" @hide="popHide"> </el-select><el-popover trigger="click" placement="bottom" @show="popShow" @hide="popHide">
@@ -59,7 +220,7 @@
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</el-row> </el-row>
<!--SNMP V3 setting--> &lt;!&ndash;SNMP V3 setting&ndash;&gt;
<template v-if="searchParamPop.version == 3"> <template v-if="searchParamPop.version == 3">
<el-row class="mib-browser-ad-search-item"> <el-row class="mib-browser-ad-search-item">
<el-col :span="6"> <el-col :span="6">
@@ -136,7 +297,7 @@
</div> </div>
</div> </div>
<div class="mib-browser-box"> <div class="mib-browser-box">
<!--左半部分--> &lt;!&ndash;左半部分&ndash;&gt;
<div class="mib-browser-left"> <div class="mib-browser-left">
<div class="mib-browser-tree-title"> <div class="mib-browser-tree-title">
<span>SNMP MIBs</span> <span>SNMP MIBs</span>
@@ -147,7 +308,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
<!--tree--> &lt;!&ndash;tree&ndash;&gt;
<div class="mib-browser-tree" ref="treeScrollbar"> <div class="mib-browser-tree" ref="treeScrollbar">
<el-tree <el-tree
ref="walkTree" ref="walkTree"
@@ -174,9 +335,9 @@
</div> </div>
</el-tree> </el-tree>
</div> </div>
<!--拖拽区--> &lt;!&ndash;拖拽区&ndash;&gt;
<div class="tree-detail-resize" @mousedown="treeDetailResize"></div> <div class="tree-detail-resize" @mousedown="treeDetailResize"></div>
<!--detail--> &lt;!&ndash;detail&ndash;&gt;
<div class="mib-browser-detail" ref="detailScrollbar"> <div class="mib-browser-detail" ref="detailScrollbar">
<div class="mib-browser-detail-row"> <div class="mib-browser-detail-row">
<div>Name</div> <div>Name</div>
@@ -212,9 +373,9 @@
</div> </div>
</div> </div>
</div> </div>
<!--拖拽区--> &lt;!&ndash;拖拽区&ndash;&gt;
<div class="left-right-resize" @mousedown="leftRightResize"></div> <div class="left-right-resize" @mousedown="leftRightResize"></div>
<!--右半部分--> &lt;!&ndash;右半部分&ndash;&gt;
<div class="mib-browser-right"> <div class="mib-browser-right">
<div class="mib-browser-table-title"> <div class="mib-browser-table-title">
<span>Result table</span> <span>Result table</span>
@@ -254,16 +415,17 @@
</div> </div>
<div slot="footer" class="footer"> <div slot="footer" class="footer">
<div class="el-message-box__btns"> <div class="el-message-box__btns">
<button @click="snmpSetFormVisible = false" class="el-button el-button--default el-button--small">{{$t("overall.cancel")}}</button> <button @click="snmpSetFormVisible = false" class="el-button el-button&#45;&#45;default el-button&#45;&#45;small">{{$t("overall.cancel")}}</button>
<button @click="search(true)" class="el-button el-button--default el-button--small" id="mib-browser-search">{{$t("overall.ok")}}</button> <button @click="search(true)" class="el-button el-button&#45;&#45;default el-button&#45;&#45;small" id="mib-browser-search">{{$t("overall.ok")}}</button>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
</span> </span>-->
</template> </template>
<script> <script>
import fileSaver from 'file-saver' import fileSaver from 'file-saver'
import nzDataList from '@/components/common/table/nzDataList'
import xlsx from 'xlsx' import xlsx from 'xlsx'
export default { export default {
@@ -271,6 +433,9 @@ export default {
props: { props: {
showTab: String showTab: String
}, },
components: {
nzDataList
},
data () { data () {
return { return {
loading: false, loading: false,
@@ -278,6 +443,15 @@ export default {
snmpSetFormVisible: false, // snmp set表单 snmpSetFormVisible: false, // snmp set表单
searchParam: { searchParam: {
host: '', host: '',
oid: '',
port: 161,
operation: 'get',
version: 2,
community: 'public',
snmpCredentialId: null
},
/* searchParam: {
manageIp: '',
port: 161, port: 161,
oid: '', oid: '',
operation: 'get', operation: 'get',
@@ -295,7 +469,7 @@ export default {
value: '' value: ''
}, },
searchParamPop: { searchParamPop: {
host: '', manageIp: '',
port: 161, port: 161,
oid: '', oid: '',
operation: 'get', operation: 'get',
@@ -309,9 +483,9 @@ export default {
privProtocol: '', privProtocol: '',
privPin: '' privPin: ''
} }
}, }, */
operationData: ['get', 'walk', 'getnext', 'set'], operationData: ['get', 'walk', 'getnext', 'set'],
advancedShow: false, // advancedShow: false,
walkParam: { models: [] }, walkParam: { models: [] },
walkData: [], walkData: [],
@@ -321,7 +495,9 @@ export default {
assetData: [], assetData: [],
showTable: true, showTable: true,
typeData: ['OctetString', 'Integer', 'OID', 'Gauge', 'Counter32', 'IpAddress', 'TimeTicks', 'Counter64', 'UnsignedInteger', 'BITS', 'Float', 'DateAndTime'], typeData: ['OctetString', 'Integer', 'OID', 'Gauge', 'Counter32', 'IpAddress', 'TimeTicks', 'Counter64', 'UnsignedInteger', 'BITS', 'Float', 'DateAndTime'],
assetInputTimer: null assetInputTimer: null,
credentialData: []
} }
}, },
computed: { computed: {
@@ -359,6 +535,14 @@ export default {
return mibName || '' return mibName || ''
}, },
/* 获取右上角筛选数据 */
getCredentialData () {
this.$get('snmp/credential', { pageSize: -1 }).then(response => {
if (response.code === 200) {
this.credentialData = response.data.list
}
})
},
/* 获取tree的数据 */ /* 获取tree的数据 */
getWalkData () { getWalkData () {
this.treeLoading = true this.treeLoading = true
@@ -374,7 +558,7 @@ export default {
}) })
}, },
getModelData () { getModelData () {
this.$get('model', { pageSize: -1, pageNo: 1 }).then(response => { this.$get('asset/model', { pageSize: -1, pageNo: 1 }).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.modelData = response.data.list this.modelData = response.data.list
} }
@@ -390,14 +574,14 @@ export default {
this.getWalkData() this.getWalkData()
}, },
search (set) { search (set) {
if (this.loading) { /* if (this.loading) {
return return
} } */
this.popShow(); this.popHide() // 再调用一次,对数据赋值 // this.popShow(); this.popHide() // 再调用一次,对数据赋值
/* 处理snmpset */ /* 处理snmpset */
if (!set) { /* if (!set) {
if (this.searchParam.operation == 'set') { if (this.searchParam.operation == 'set') {
this.snmpSetFormVisible = true this.snmpSetFormVisible = true
return return
@@ -409,15 +593,15 @@ export default {
return return
} }
this.snmpSetFormVisible = false this.snmpSetFormVisible = false
} } */
console.info(this.searchParam)
this.loading = true this.loading = true
setTimeout(() => { setTimeout(() => {
this.$post('mib/browser', this.searchParam).then(response => { this.$post('mib/browser', this.searchParam).then(response => {
this.loading = false this.loading = false
if (response.code === 200) { if (response.code === 200) {
this.resultData = this.resultData.concat(response.data.list) this.resultData = this.resultData.concat(response.data.list)
if (this.searchParam.operation == 'set') { if (this.searchParam.operation === 'set') {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.success') }) this.$message({ duration: 2000, type: 'success', message: this.$t('tip.success') })
} }
this.showTable = false this.showTable = false
@@ -431,14 +615,14 @@ export default {
}, 300) }, 300)
}, },
popShow () { /* popShow () {
this.searchParamPop.host = this.searchParam.host this.searchParamPop.host = this.searchParam.host
this.searchParamPop.oid = this.searchParam.oid this.searchParamPop.oid = this.searchParam.oid
this.searchParamPop.operation = this.searchParam.operation this.searchParamPop.operation = this.searchParam.operation
}, },
popHide () { popHide () {
this.searchParam = JSON.parse(JSON.stringify(this.searchParamPop)) this.searchParam = JSON.parse(JSON.stringify(this.searchParamPop))
}, }, */
/* 清空result table */ /* 清空result table */
clearResult () { clearResult () {
this.resultData = [] this.resultData = []
@@ -461,6 +645,9 @@ export default {
} }
} }
}, },
clickTab (showTabInfo, showTab) {
this.$emit('changeShowTab', showTab)
},
assetChange: function (value) { assetChange: function (value) {
clearTimeout(this.assetInputTimer) clearTimeout(this.assetInputTimer)
this.assetInputTimer = setTimeout(() => { this.assetInputTimer = setTimeout(() => {
@@ -496,7 +683,7 @@ export default {
data = this.assetData data = this.assetData
} else { } else {
for (let i = 0; i < this.assetData.length; i++) { for (let i = 0; i < this.assetData.length; i++) {
if (this.assetData[i].host.indexOf(queryString) != -1) { if (this.assetData[i].manageIp.indexOf(queryString) != -1) {
data.push(this.assetData[i]) data.push(this.assetData[i])
} }
} }
@@ -504,7 +691,7 @@ export default {
callback(data) callback(data)
}, },
getAssetData () { getAssetData () {
this.$get('asset', { pageSize: -1, pageNo: 1 }).then(response => { this.$get('asset/asset', { pageSize: -1, pageNo: 1 }).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.assetData = response.data.list this.assetData = response.data.list
} }
@@ -637,6 +824,7 @@ export default {
this.getWalkData() this.getWalkData()
this.getModelData() this.getModelData()
this.getAssetData() this.getAssetData()
this.getCredentialData()
window.addEventListener('resize', this.domResize) window.addEventListener('resize', this.domResize)
}, },
beforeDestroy () { beforeDestroy () {
@@ -664,10 +852,6 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
.mib-browser { .mib-browser {
.top-tool-search .el-input__inner {
height: 25px;
line-height: 25px;
}
.operation { .operation {
width: 90px; width: 90px;
} }
@@ -675,12 +859,6 @@ export default {
border-radius: 0; border-radius: 0;
border-right: 1px solid rgba(162,162,162,0.50); border-right: 1px solid rgba(162,162,162,0.50);
} }
.oid-input.top-tool-search {
width: 380px;
}
.host-input.top-tool-search {
width: 160px;
}
.mib-browser-btn-group { .mib-browser-btn-group {
position: relative; position: relative;
} }
@@ -715,11 +893,12 @@ export default {
} }
.mib-browser-box { .mib-browser-box {
border: 1px solid #D8D8D8; display: flex;
border-radius: 4px;
height: calc(100% - 55px); height: calc(100% - 55px);
width: 100%; width: 100%;
display: flex; border: 1px solid #D8D8D8;
border-radius: 4px;
box-sizing: border-box;
} }
.mib-browser-left { .mib-browser-left {
@@ -808,8 +987,23 @@ export default {
border-top: none; border-top: none;
border-bottom: none; border-bottom: none;
} }
.mib-browser-table-title { .mib-browser-table {
margin-bottom: 10px; height: calc(100% - 50px) !important;
width: calc(100% - 20px) !important;
padding: 10px;
.ant-table-scroll {
max-height: unset !important;
width: 100%;
height: 100%;
.el-table {
height: calc(100% - 20px) !important;
width: calc(100% - 20px) !important;
}
.el-table__body-wrapper td {
padding: 2px 0 !important;
}
}
} }
.mib-browser-table-title, .mib-browser-tree-title { .mib-browser-table-title, .mib-browser-tree-title {
height: 30px; height: 30px;
@@ -825,6 +1019,7 @@ export default {
display: inline-block; display: inline-block;
margin: 0 5px; margin: 0 5px;
cursor: pointer; cursor: pointer;
color: #666;
} }
.mib-browser-table-op.mib-browser-table-op-light { .mib-browser-table-op.mib-browser-table-op-light {
color: #ccc; color: #ccc;
@@ -835,6 +1030,10 @@ export default {
font-weight: bold; font-weight: bold;
color: #ee9d3f; color: #ee9d3f;
} }
.pagination-bottom {
display: none;
}
} }
.mib-browser-table.nz-table th .cell { .mib-browser-table.nz-table th .cell {

View File

@@ -75,6 +75,12 @@ export default {
}] }]
} }
} }
},
methods: {
edit (row) {
this.object = { ...row }
this.rightBox.show = true
}
} }
} }
</script> </script>

View File

@@ -1,9 +1,9 @@
<template> <template>
<div style="hight: 100%"> <div>
<mib-file :show-tab="showTab" v-if="showTab == 'file'" @changeShowTab="changeShowTab" @toCredentialTab="changeTab(['mib','credentials'],'credentials')" @toBrowserTab="changeTab(['mib','browser'],'browser')"></mib-file> <mib-file v-if="showTab === 'file'" :show-tab="showTab" @changeShowTab="changeShowTab" @toBrowserTab="changeTab(['mib','browser'],'browser')" @toCredentialTab="changeTab(['mib','credentials'],'credentials')"></mib-file>
<mib-browser :show-tab="showTab" v-if="showTab == 'browser'" @changeShowTab="changeShowTab" @toFileTab="changeTab(['mib','file'],'file')" @toCredentialTab="changeTab(['mib','credentials'],'credentials')"></mib-browser> <mib-browser v-if="showTab === 'browser'" :show-tab="showTab" @changeShowTab="changeShowTab" @toCredentialTab="changeTab(['mib','credentials'],'credentials')" @toFileTab="changeTab(['mib','file'],'file')"></mib-browser>
<credentials :show-tab="showTab" v-if="showTab == 'credentials'" @changeShowTab="changeShowTab" @toFileTab="changeTab(['mib','file'],'file')" @toBrowserTab="changeTab(['mib','browser'],'browser')"></credentials> <credentials v-if="showTab === 'credentials'" :show-tab="showTab" @changeShowTab="changeShowTab" @toBrowserTab="changeTab(['mib','browser'],'browser')" @toFileTab="changeTab(['mib','file'],'file')"></credentials>
</div> </div>
</template> </template>
<script> <script>

View File

@@ -197,7 +197,7 @@
<!-- varType --> <!-- varType -->
<el-form-item :label="$t('dashboard.panel.chartForm.varType')" v-if="from === 'temp'"> <el-form-item :label="$t('dashboard.panel.chartForm.varType')" v-if="from === 'temp'">
<el-select id="chart-box-group" v-model="editChart.varType" :disabled="!!editChart.id" class="form-item--end-with-btn" clearable placeholder="" popper-class="chart-box-dropdown-small prevent-clickoutside" size="small" value-key="chartType"> <el-select id="chart-box-group" v-model="editChart.varType" :disabled="!!editChart.id" class="right-box__select" popper-class="right-box-select-dropdown prevent-clickoutside" clearable placeholder="" size="small" value-key="chartType">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in varTypeArr"> <el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in varTypeArr">
<span class="panel-dropdown-label-txt" >{{item.name}}</span> <span class="panel-dropdown-label-txt" >{{item.name}}</span>
</el-option> </el-option>
@@ -300,7 +300,7 @@
@change="expressionChange" @change="expressionChange"
@removeExpression="removeExpression" @removeExpression="removeExpression"
></promql-input> ></promql-input>
<el-row> <el-row style="margin-top: 18px">
<el-col class="legend-title"> <el-col class="legend-title">
{{$t('dashboard.panel.chartForm.legend')}}&nbsp; {{$t('dashboard.panel.chartForm.legend')}}&nbsp;
<el-popover placement="top" trigger="hover" width="211"> <el-popover placement="top" trigger="hover" width="211">

View File

@@ -776,7 +776,7 @@ export default {
$temp.quill.setSelection($temp.cursorIndex+text.length); $temp.quill.setSelection($temp.cursorIndex+text.length);
},200)//此值必须大于userChangeTimer的值 */ },200)//此值必须大于userChangeTimer的值 */
}) })
this.quill.clipboard.addMatcher(Node.ELEMENT_NODE, (node, delta) => { this.quill.clipboard.addmatchers(Node.ELEMENT_NODE, (node, delta) => {
const ops = [] const ops = []
delta.ops.forEach(op => { delta.ops.forEach(op => {
if (op.insert && typeof op.insert === 'string') { if (op.insert && typeof op.insert === 'string') {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="explore list-page"> <div class="explore list-page">
<div class="main-list"> <div class="main-list">
<div class="main-container"> <div class="main-container" style="overflow: auto;">
<!-- 顶部工具栏 --> <!-- 顶部工具栏 -->
<div class="top-tools" style="z-index: 1"> <div class="top-tools" style="z-index: 1">
<div class="top-tool-left"></div> <div class="top-tool-left"></div>
@@ -16,36 +16,34 @@
</button> </button>
</div> </div>
</div> </div>
<div class="top-tools" style="width: 100%;box-sizing: border-box; padding-left: 10px;"> <div id="explore-promql-box" class="top-tools" style="padding-top: 0; flex-wrap: wrap">
<div id="explore-promql-box" class="expression-room"> <!--这个index居然是从1开始-->
<!--这个index居然是从1开始--> <promql-input
<promql-input v-for="index of promqlKeys.length"
v-for="index of promqlKeys.length" :id="promqlKeys[index-1]"
:id="promqlKeys[index-1]" :key="promqlKeys[index-1]"
:key="promqlKeys[index-1]" :ref="'promql-'+(index-1)"
:ref="'promql-'+(index-1)" :expression-list="expressions"
:expression-list="expressions" :index="index-1"
:index="index-1" :plugins="['metric-selector', 'metric-input', 'add', 'remove', 'copy']"
:plugins="['metric-selector', 'metric-input', 'add', 'remove', 'copy']" :styleType="1"
:styleType="1" @addExpression="addExpression"
@addExpression="addExpression" @change="expressionChange"
@change="expressionChange" @copyExpression="copyExpression"
@copyExpression="copyExpression" @removeExpression="removeExpression"
@removeExpression="removeExpression" ></promql-input>
></promql-input>
</div>
</div> </div>
<div ref="scrollWrap" style="height: 100%; overflow: auto;"> <div ref="scrollWrap" style="height: auto; padding: 0 20px 4px;">
<div class="chart-view right-margin" v-show="!showIntroduce" <div v-show="!showIntroduce" class="chart-view"
:class="{'shrink-view':!chartVisible || !defaultChartVisible}" style="position:relative;"> :class="{'shrink-view':!chartVisible || !defaultChartVisible}" style="position:relative;">
<div class="view-title" @click="changeChartVisible" style="position:absolute;z-index: 1000;top:10px;"><i class="nz-icon nz-icon-caret-top" ></i>&nbsp;graph</div> <div class="view-title" @click="changeChartVisible" style="position:absolute;z-index: 1000;top:10px;"><i class="nz-icon nz-icon-caret-top" ></i>&nbsp;graph</div>
<div class="chart-room"> <div class="chart-room">
<chart ref="exploreChart" :unit="chartUnit"></chart> <chart ref="exploreChart" :unit="chartUnit"></chart>
</div> </div>
</div> </div>
<div class="table-view right-margin" v-show="!showIntroduce" <div v-show="!showIntroduce" class="table-view"
:class="{'shrink-view':!tableVisible || !defaultTableVisible}" style="position: relative"> :class="{'shrink-view':!tableVisible || !defaultTableVisible}" style="position: relative">
<div class="view-title" @click="changeTableVisible" style="position:absolute;z-index: 1000;top:10px;"><i class="nz-icon nz-icon-caret-top"></i>&nbsp;table</div> <div class="view-title" style="position:absolute;z-index: 1000;top:4px;" @click="changeTableVisible"><i class="nz-icon nz-icon-caret-top"></i>&nbsp;table</div>
<div class="table-room"> <div class="table-room">
<!-- 自定义table列 --> <!-- 自定义table列 -->
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
@@ -63,8 +61,7 @@
border border
ref="exploreTable" ref="exploreTable"
tooltip-effect="light" tooltip-effect="light"
v-loading="tools.loading" v-loading="tools.loading">
style="width: 100%;">
<el-table-column <el-table-column
:resizable="false" :resizable="false"
v-for="(item, index) in tools.customTableTitle" v-for="(item, index) in tools.customTableTitle"
@@ -87,7 +84,7 @@
:append-to-body="false"></pagination> :append-to-body="false"></pagination>
</div> </div>
</div> </div>
<div class="introduce-view right-margin" v-show="showIntroduce"> <div v-show="showIntroduce" class="introduce-view">
<div class="info-room"> <div class="info-room">
<div class="col-md-9 doc-content"> <div class="col-md-9 doc-content">
<h1 class="page-header">Query examples<a class="header-anchor" href="https://prometheus.io/docs/prometheus/latest/querying/examples/" target="_blank" rel="noopener norefferrer"><i style="font-size: 16px;" class="nz-icon nz-icon-link1"></i></a></h1> <h1 class="page-header">Query examples<a class="header-anchor" href="https://prometheus.io/docs/prometheus/latest/querying/examples/" target="_blank" rel="noopener norefferrer"><i style="font-size: 16px;" class="nz-icon nz-icon-link1"></i></a></h1>
@@ -725,7 +722,6 @@ export default {
padding: 24px; padding: 24px;
background-color: #e9edf2; background-color: #e9edf2;
border-top: 3px solid #3274d9; border-top: 3px solid #3274d9;
margin-bottom: 16px;
-webkit-box-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, .1), 1px 1px 0 0 rgba(0, 0, 0, .1); -webkit-box-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, .1), 1px 1px 0 0 rgba(0, 0, 0, .1);
box-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, .1), 1px 1px 0 0 rgba(0, 0, 0, .1); box-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, .1), 1px 1px 0 0 rgba(0, 0, 0, .1);
-webkit-box-flex: 1; -webkit-box-flex: 1;
@@ -919,4 +915,7 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.explore .promqlInput:not(:first-of-type) {
margin-top: 10px;
}
</style> </style>

View File

@@ -1,38 +1,45 @@
<template> <template>
<div class="promqlInput"> <div class="promqlInput">
<div class="query-row"> <div class="query-row">
<div class="query-input"> <!--explore页面的样式-->
<!--explore页面的样式--> <template v-if="styleType == 1">
<template v-if="styleType == 1"> <div v-if="plugins.indexOf('metric-selector') > -1">
<div v-if="plugins.indexOf('metric-selector') > -1"> <el-dropdown class="metric-selector">
<el-dropdown class="metric-selector"> <el-dropdown-menu style="display: none"></el-dropdown-menu>
<el-dropdown-menu style="display: none"></el-dropdown-menu> <button class="top-tool-btn top-tool-btn--text" type="button" @click="toggleDropdown">Metric
<button class="top-tool-btn" type="button" @click="toggleDropdown">Metric &nbsp;<i class="nz-icon nz-icon-arrow-down" style="font-size: 12px"></i></button>
&nbsp;<i class="nz-icon nz-icon-arrow-down"></i></button> <el-cascader-panel v-show="dropDownVisible" ref="metricSelector" slot="dropdown" v-model="cascaderValue"
<el-cascader-panel v-loading="tempBoxShowLoading" v-show="dropDownVisible" v-model="cascaderValue" v-clickoutside="closeDropdown" v-clickoutside="closeDropdown" v-loading="tempBoxShowLoading" :loading="loading" :options="metricOptions"
slot="dropdown" ref="metricSelector" :props="{emitPath:false,}" :loading="loading" :props="{emitPath:false,}" @change="metricChange">
:options="metricOptions" @change="metricChange">
<template slot-scope="{ node, data }"> <template slot-scope="{ node, data }">
<div :class="['nz-cascade',data.temp&&!data.child?'nz-cascade-temp':'']" @click="()=>{lazyLoad(node,data)}"> <div :class="['nz-cascade',data.temp&&!data.child?'nz-cascade-temp':'']" @click="()=>{lazyLoad(node,data)}">
<i class="nz-icon nz-icon-template2"></i> <i class="nz-icon nz-icon-template2"></i>
{{data.label}} {{data.label}}
</div> </div>
</template> </template>
</el-cascader-panel> </el-cascader-panel>
</el-dropdown> </el-dropdown>
</div> </div>
<div class="input-box" @click="dropDownVisible=false" v-if="plugins.indexOf('metric-input') > -1"> <div v-if="plugins.indexOf('metric-input') > -1" class="input-box" @click="dropDownVisible=false">
<el-input @keyup.enter.native="expressionChange" v-model="expressionList[index]" :id="inputId" <el-input :id="inputId" v-model="expressionList[index]" :autosize="{ minRows: 1, maxRows: 6}"
@input="metricKeyDown" type="textarea" class="not-fixed-height no-resize" type="textarea"
:autosize="{ minRows: 1, maxRows: 6}" class="not-fixed-height no-resize"></el-input> @input="metricKeyDown" @keyup.enter.native="expressionChange"></el-input>
<div class="append-msg error" v-if="errorMsg"><span>{{errorMsg}}</span></div> <div v-if="errorMsg" class="append-msg error"><span>{{errorMsg}}</span></div>
<div class="append-msg error" v-if="appendMsg"><span>{{appendMsg}}</span></div> <div v-if="appendMsg" class="append-msg error"><span>{{appendMsg}}</span></div>
</div> </div>
</template> <div class="top-tool-btn-group">
<!--right-box里的样式--> <button v-if="plugins.indexOf('add') > -1" class="top-tool-btn"
<template v-if="styleType == 2"> @click="addExpression"><i class="nz-icon nz-icon-plus"></i></button>
<button v-if="plugins.indexOf('copy') > -1" class="top-tool-btn"
@click="copyExpression"><i class="nz-icon nz-icon-override"></i></button>
<button v-if="plugins.indexOf('remove') > -1" class="top-tool-btn"
@click="removeExpression"><i class="nz-icon nz-icon-minus"></i></button>
</div>
</template>
<!--right-box里的样式-->
<template v-if="styleType == 2">
<el-row v-if="plugins.indexOf('metric-input') > -1 || plugins.indexOf('metric-selector') > -1" <el-row v-if="plugins.indexOf('metric-input') > -1 || plugins.indexOf('metric-selector') > -1"
style="width: 100%;"> style="width: 100%;">
<el-col <el-col
@@ -69,17 +76,6 @@
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
</div>
</div>
<div v-if="styleType == 1" style="margin-left: 10px">
<div class="query-options nz-btn-group nz-btn-group-size-normal nz-btn-group-light">
<div class="option nz-btn nz-btn-size-normal nz-btn-style-light" @click="addExpression"
v-if="plugins.indexOf('add') > -1"><i class="nz-icon nz-icon-plus"></i></div>
<div @click="copyExpression" class="option nz-btn nz-btn-size-normal nz-btn-style-light"
v-if="plugins.indexOf('copy') > -1"><i class="nz-icon nz-icon-override"></i></div>
<div class="option nz-btn nz-btn-size-normal nz-btn-style-light" @click="removeExpression"
v-if="plugins.indexOf('remove') > -1"><i class="nz-icon nz-icon-minus"></i></div>
</div>
</div> </div>
<div v-if="styleType == 2&&showRemove"> <div v-if="styleType == 2&&showRemove">
<div class="option" @click="addExpression" v-if="plugins.indexOf('add') > -1"><i class="nz-icon nz-icon-plus"></i> <div class="option" @click="addExpression" v-if="plugins.indexOf('add') > -1"><i class="nz-icon nz-icon-plus"></i>
@@ -249,10 +245,8 @@ export default {
const metricMap = new Map() const metricMap = new Map()
metrics.forEach((item) => { metrics.forEach((item) => {
let key = '' let key = ''
if (/^[a-zA-Z]+?_[a-zA-Z]*/.test(item)) { if (/^[a-zA-Z_:][a-zA-Z0-9_:]*/.test(item)) {
key = item.split('_')[0] key = item.split(/[_:]/, 1)[0]
} else if (/^_\w*/.test(item)) {
key = ' '
} else { } else {
key = item key = item
} }
@@ -548,10 +542,11 @@ export default {
position: relative; position: relative;
width: 100%; width: 100%;
display: flex; display: flex;
margin-bottom: 18px;
} }
.promqlInput .query-row { .promqlInput .query-row {
display: flex;
flex-wrap: wrap;
width: 100%; width: 100%;
} }
@@ -564,10 +559,6 @@ export default {
.input-box .error { .input-box .error {
color: #F56C6C; color: #F56C6C;
} }
.query-row .query-input {
display: flex;
justify-content: flex-start;
}
.promqlInput .query-options { .promqlInput .query-options {
/*display: flex;*/ /*display: flex;*/
@@ -589,16 +580,11 @@ export default {
background-color: rgb(247, 248, 250); background-color: rgb(247, 248, 250);
} }
.query-input .metric-btn { .query-row .input-box {
width: 100px; flex: auto;
margin-right: 10px; margin-right: 10px;
} }
.query-input .input-box {
width: 100%;
height: 100%;
}
.metric-btn { .metric-btn {
height: 29px !important; height: 29px !important;
width: 105px; width: 105px;

View File

@@ -109,7 +109,7 @@
<div v-loading="topologyLoading" class="content-col-content"> <div v-loading="topologyLoading" class="content-col-content">
<transition name = "el-zoom-in-center"> <transition name = "el-zoom-in-center">
<div v-if="allProject&&allProject.length>0" style="width: 100%;height: 100%;position: relative"> <div v-if="allProject&&allProject.length>0" style="width: 100%;height: 100%;position: relative">
<el-carousel :interval="5000" :trigger="'click'" arrow="hover"> <el-carousel :interval="5000" :autoplay="false" :trigger="'click'" arrow="hover">
<el-carousel-item v-for="(item,index) in allProject" :key="index"> <el-carousel-item v-for="(item,index) in allProject" :key="index">
<div class="maskLayer" @click="toProject(item)"></div> <div class="maskLayer" @click="toProject(item)"></div>
<span class="project-name">{{item.name}}</span> <span class="project-name">{{item.name}}</span>
@@ -349,7 +349,7 @@ export default {
}) })
}, },
queryAllProjectData () { queryAllProjectData () {
this.$get('/project', { pageSize: -1 }).then(res => { this.$get('monitor/project', { pageSize: -1 }).then(res => {
this.topologyLoading = true this.topologyLoading = true
const axiosAll = [] const axiosAll = []
const temp = [] const temp = []

View File

@@ -127,7 +127,7 @@
<div class="content-col-content" v-loading="topologyLoading"> <div class="content-col-content" v-loading="topologyLoading">
<transition name = "el-zoom-in-center"> <transition name = "el-zoom-in-center">
<div style="width: 100%;height: 100%;position: relative" v-if="allProject&&allProject.length>0"> <div style="width: 100%;height: 100%;position: relative" v-if="allProject&&allProject.length>0">
<el-carousel :interval="5000" arrow="hover" :trigger="'click'"> <el-carousel :interval="50000" :autoplay="false" arrow="hover" :trigger="'click'">
<el-carousel-item v-for="(item,index) in allProject" :key="index"> <el-carousel-item v-for="(item,index) in allProject" :key="index">
<div class="maskLayer" @click="toProject(item)"></div> <div class="maskLayer" @click="toProject(item)"></div>
<span class="project-name">{{item.name}}</span> <span class="project-name">{{item.name}}</span>

View File

@@ -549,13 +549,6 @@ export default {
} }
} }
}, },
getUserData () {
this.$get('sys/user/list').then(response => {
if (response.code === 200) {
this.userData = response.data.list
}
})
},
// 刷新拓扑图 // 刷新拓扑图
visNetworkReload () { visNetworkReload () {
this.$refs.facade.$refs.visNetwork.reload() this.$refs.facade.$refs.visNetwork.reload()
@@ -617,7 +610,6 @@ export default {
if (pageSize) { if (pageSize) {
this.endpointPageObj.pageSize = pageSize this.endpointPageObj.pageSize = pageSize
} }
this.getUserData()
}, },
mounted () { mounted () {
// 初始化表头 // 初始化表头

View File

@@ -23,9 +23,10 @@
v-loading="slotProps.loading" v-loading="slotProps.loading"
:api="url" :api="url"
:custom-table-title="tools.customTableTitle" :custom-table-title="tools.customTableTitle"
:height="mainTableHeight" :height="projectTableHeight"
:table-data="tableData" :table-data="tableData"
:tableId="tableId" :tableId="tableId"
style="padding-right: 0"
@del="del" @del="del"
@edit="edit" @edit="edit"
@orderBy="tableDataSort" @orderBy="tableDataSort"
@@ -35,7 +36,8 @@
</template> </template>
<template v-slot:pagination> <template v-slot:pagination>
<div class="project-page"> <div class="project-page">
<Pagination ref="Pagination" :page-obj="pageObj" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></Pagination> <Pagination ref="Pagination" :page-obj="pageObj" :table-id="tableId" style="width: calc(100% - 15px);padding-bottom: 6px;" @pageNo='pageNo'
@pageSize='pageSize'></Pagination>
</div> </div>
</template> </template>
</nz-data-list> </nz-data-list>
@@ -68,6 +70,7 @@ export default {
name: '', name: '',
remark: '' remark: ''
}, },
projectTableHeight: 'calc(100% - 58px)',
tableId: 'projectTable', tableId: 'projectTable',
queryPermission: 'account_view', queryPermission: 'account_view',
searchMsg: { // 给搜索框子组件传递的信息 searchMsg: { // 给搜索框子组件传递的信息
@@ -140,8 +143,8 @@ export default {
<style lang="scss"> <style lang="scss">
.project-list{ .project-list{
.project-page{ .project-page{
margin: 0 10px 0 20px; margin: 0 0 0 20px;
border: 1px solid #eeeeee; border: 1px solid $--right-box-border-color;
border-top: none; border-top: none;
/deep/ .pagination{ /deep/ .pagination{
padding-top: 0; padding-top: 0;

View File

@@ -33,7 +33,18 @@ import bus from '@/libs/bus'
import theme from '@/assets/css/theme.scss' import theme from '@/assets/css/theme.scss'
import myDatePicker from '@/components/common/myDatePicker' import myDatePicker from '@/components/common/myDatePicker'
import vSelectPage from 'v-selectpage' import vSelectPage from 'v-selectpage'
Vue.use(vSelectPage) Vue.use(vSelectPage, {
dataLoad: function (vue, url, params) {
if (params.pageNumber) {
params.pageNo = params.pageNumber
}
return new Promise((resolve, reject) => {
get(url, params).then(res => {
resolve(res)
}, e => reject(e))
})
}
})
Vue.use(myDatePicker) Vue.use(myDatePicker)
Vue.component('Pagination', Pagination) Vue.component('Pagination', Pagination)
Vue.component('searchInput', searchInput) Vue.component('searchInput', searchInput)