From a1fba1817eb220a56bdc9928f535bda8060f02d6 Mon Sep 17 00:00:00 2001 From: likexuan Date: Fri, 2 Sep 2022 14:22:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?NEZ-2166=20fix=20:=20record=20=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=9C=AA=E5=AE=9E=E7=8E=B0=E6=A0=BC=E5=BC=8F=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/components/common/rightBox/recordRuleBox.scss | 3 +++ .../src/components/common/rightBox/recordRuleBox.vue | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.scss index afa59159c..47c6c5be6 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.scss @@ -12,6 +12,9 @@ } } } + .matchers .el-form-item__error{ + left: 3px; + } .promqlInput{ // .metric-selector-title{ // width: 80px; diff --git a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue index e90d546bf..04a7c00db 100644 --- a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue @@ -81,7 +81,7 @@
- + = @@ -159,7 +159,8 @@ export default { }, rules: { name: [ - { required: true, message: this.$t('validate.required'), trigger: 'change' } + { required: true, message: this.$t('validate.required'), trigger: 'change' }, + { pattern: /[a-zA-Z_][a-zA-Z0-9_]*/, message: this.$t('overall.ASCIIKey'), trigger: 'change' } ], type: [ { required: true, message: this.$t('validate.required'), trigger: 'change' } From c36129bb2a4ce128c812ccdff894c6ec250fc135 Mon Sep 17 00:00:00 2001 From: likexuan Date: Fri, 2 Sep 2022 14:38:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?NEZ-2167=20fix=20:=20record=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E9=9D=A2=20labels=20=E5=88=97=E5=8F=96?= =?UTF-8?q?=E6=B6=88=20=E9=BC=A0=E6=A0=87=E6=82=AC=E6=B5=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/alert/alertLabel.vue | 50 ------------------- .../common/table/settings/recordRuleTable.vue | 39 ++++++--------- 2 files changed, 14 insertions(+), 75 deletions(-) diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue index be446cc9b..2a0b932ec 100644 --- a/nezha-fronted/src/components/common/alert/alertLabel.vue +++ b/nezha-fronted/src/components/common/alert/alertLabel.vue @@ -712,56 +712,6 @@
- - -
-
-
ID
-
- {{ alertLabelData && alertLabelData.id ? alertLabelData.id : "--" }} -
-
-
-
{{$t('overall.name')}}
-
{{alertLabelData && alertLabelData.name ? alertLabelData.name : '--'}}
- -
-
-
{{ $t("overall.type") }}
-
- {{ alertLabelData && alertLabelData.type == "1" ? $t('overall.metric') : $t("overall.logs")}} -
-
-
-
{{ $t("config.exprTemp.expression") }}
-
- {{ alertLabelData && alertLabelData.expr ? alertLabelData.expr : "--" }} -
-
-
-
{{ $t("config.assetLabel.interval") }}
-
- {{ alertLabelData && alertLabelData.inr ? alertLabelData.inr : "--" }} -
-
-
-
{{ $t("overall.remark") }}
-
- {{ alertLabelData && alertLabelData.remark ? alertLabelData.remark : "--" }} -
-
-
-
{{ $t("overall.state") }}
-
-
- {{ alertLabelData && alertLabelData.state == "1" ? $t("overall.enabled") : $t("overall.disabled")}} -
-
-
diff --git a/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue b/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue index 09a1f603b..1260c71ff 100644 --- a/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue +++ b/nezha-fronted/src/components/common/table/settings/recordRuleTable.vue @@ -61,12 +61,11 @@ + + @@ -123,14 +132,6 @@
 
- - @@ -139,14 +140,13 @@ import lodash from 'lodash' import copy from '@/components/common/copy' import table from '@/components/common/mixin/table' import nzAlertTag from '../../../page/alert/nzAlertTag' -import alertLabelMixin from '@/components/common/mixin/alertLabelMixin' export default { name: 'recordRuleTable', components: { nzAlertTag, copy }, - mixins: [table, alertLabelMixin], + mixins: [table], props: { loading: Boolean }, @@ -210,17 +210,6 @@ export default { ] } }, - computed: { - tagType () { - return (key) => { - if (key == 'asset' || key == 'module' || key == 'project' || key == 'dc' || key == 'endpoint') { - return 'normal' - } else { - return 'info' - } - } - } - }, methods: { labelsSort (obj) { if (typeof obj != 'object') {