From 8a6da26217643226ef50e06322546f9edab2c013 Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Wed, 7 Jul 2021 14:30:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.=20Panel=20>=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=80=81=E6=95=B0=E6=8D=AE=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=202.=20=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E7=AD=89=E7=BA=A7=20Priority=20select=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=20color=20=E4=B8=BA=20undefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/charts/chart-alert-list.vue | 48 +++++++++++-------- .../common/popBox/selectAssetMetaGroup.vue | 6 +++ .../common/rightBox/alertRuleBox.vue | 2 +- .../page/dashboard/alertChartParam.vue | 2 +- .../components/page/dashboard/chartBox.vue | 8 +++- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-alert-list.vue b/nezha-fronted/src/components/charts/chart-alert-list.vue index ca1a5b495..e8f10b43c 100644 --- a/nezha-fronted/src/components/charts/chart-alert-list.vue +++ b/nezha-fronted/src/components/charts/chart-alert-list.vue @@ -232,52 +232,52 @@ export default { label: 'ID', prop: 'id', show: true, - width: 80 - }, { + width: 160, + sortable: 'custom' + },{ label: this.$t('alert.alertName'), prop: 'alertRule', show: true, - }, /* { - label: this.$t("alert.list.type"), - prop: 'type', - show: true, - width: 100 }, { - label: this.$t("alert.list.linked"), - prop: 'linkObject', - show: true, - width: 140 - }, */{ label: this.$t('alert.list.labels'), prop: 'labels', show: true, - width: 300 + NotSet: true, + minWidth: 250, + sortable: 'custom' }, { label: this.$t('alert.severity'), - prop: 'severity', + prop: 'severityId', show: true, - width: 100 + width: 110, + sortable: 'custom' }, { label: this.$t('alert.summary'), prop: 'summary', show: true, - width: 200 + minWidth: 200 }, { label: this.$t('overall.remark'), prop: 'description', show: true, - width: 200 + minWidth: 200 }, { label: this.$t('alert.list.state'), prop: 'state', show: true, width: 100 - }, { + },{ label: this.$t('alert.startAt'), prop: 'startAt', show: true, - width: 160 + width: 150, + sortable: 'custom' }, { + label: this.$t('config.terminallog.duration'), + prop: 'duration', + show: true, + width: 150 + },{ label: this.$t('alert.endAt'), prop: 'endAt', show: true, @@ -328,6 +328,14 @@ export default { deep: true, immediate: true, handler (n, o) { + if (n.id) { + if (!n.param.state && n.param.state != Number) { + n.param.state = "1" + } + if (n.param.severity && n.param.severity != Number) { + n.param.severity = 1 + } + } this.data = Object.assign({}, n) } }, @@ -700,7 +708,7 @@ export default { this.getAlerScreetList() }, promQueryParamConvert (obj) { - let r = '(' + obj.alertRule.expr + ')' + let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')' let intoLabels = false obj.labels = JSON.parse(obj.labels) if (Object.keys(obj.labels).length > 0) { diff --git a/nezha-fronted/src/components/common/popBox/selectAssetMetaGroup.vue b/nezha-fronted/src/components/common/popBox/selectAssetMetaGroup.vue index 43460c3ac..36e3fe39f 100644 --- a/nezha-fronted/src/components/common/popBox/selectAssetMetaGroup.vue +++ b/nezha-fronted/src/components/common/popBox/selectAssetMetaGroup.vue @@ -130,6 +130,12 @@ export default { justify-content: space-between; width: calc(100% - 28px); } +.tree--node span:nth-of-type(1) { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + word-break: break-word; +} .tree--operation { opacity: 0; } diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index c1e2e7322..1daca168a 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -64,7 +64,7 @@ - + diff --git a/nezha-fronted/src/components/page/dashboard/alertChartParam.vue b/nezha-fronted/src/components/page/dashboard/alertChartParam.vue index 78b407845..a8d6600d0 100644 --- a/nezha-fronted/src/components/page/dashboard/alertChartParam.vue +++ b/nezha-fronted/src/components/page/dashboard/alertChartParam.vue @@ -23,7 +23,7 @@ - + diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index 4091fcc6b..b663fa504 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -1761,7 +1761,13 @@ export default { immediate: true, handler (n) { if (n.id) { - this.isEdit = true + this.isEdit = true; + if (!n.param.state && n.param.state != Number) { + n.param.state = "1" + } + if (n.param.severity && n.param.severity != Number) { + n.param.severity = 1 + } } if ((n.param && n.param.valueMapping) && (n.type === 'singleStat' || n.type === 'table')) { n.param.valueMapping.mapping.forEach(item => {