diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.css b/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.css
index 7b6a23e1c..abd57e32f 100644
--- a/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.css
+++ b/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.css
@@ -1 +1 @@
-.right-box-record-rule .metric-selector-input-box .input-box{width:100%;height:100%}.right-box-record-rule .metric-selector-input-box .input-box .not-fixed-height.no-resize.no-close{width:100%;height:100%}.right-box-record-rule .promqlInput .metric-selector-title{width:80px}.right-box-record-rule .promqlInput .metric-selector-input-box{width:calc(100% - 92px) !important}.right-box-record-rule .promqlInput .cm-editor.ͼ1.ͼ2.ͼo.cm-focused{height:100%}.right-box-record-rule .promqlInput .cm-editor.ͼ1.ͼ2.ͼo{height:100%}.right-box-record-rule .promqlInput .cm-content.cm-lineWrapping{display:flex;align-items:center}.right-box-record-rule .silence-matchers-value{width:100%}.right-box-record-rule .param-box-row-symbol{padding-left:20px}
+.right-box-record-rule .metric-selector-input-box .input-box{width:100%;height:100%}.right-box-record-rule .metric-selector-input-box .input-box .not-fixed-height.no-resize.no-close{width:100%;height:100%}.right-box-record-rule .metric-selector-input-box .input-box .el-textarea .el-input__count{right:5px !important}.right-box-record-rule .promqlInput .cm-editor.ͼ1.ͼ2.ͼo.cm-focused{height:100%}.right-box-record-rule .promqlInput .cm-editor.ͼ1.ͼ2.ͼo{height:100%}.right-box-record-rule .promqlInput .cm-content.cm-lineWrapping{display:flex;align-items:center}.right-box-record-rule .silence-matchers-value{width:100%}.right-box-record-rule .param-box-row-symbol{padding-left:20px}
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 d7e4ecb45..afa59159c 100644
--- a/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.scss
+++ b/nezha-fronted/src/assets/css/components/common/rightBox/recordRuleBox.scss
@@ -7,15 +7,18 @@
width: 100%;
height: 100%;
}
+ .el-textarea .el-input__count{
+ right: 5px !important;
+ }
}
}
.promqlInput{
- .metric-selector-title{
- width: 80px;
- }
- .metric-selector-input-box{
- width: calc(100% - 92px) !important;
- }
+ // .metric-selector-title{
+ // width: 80px;
+ // }
+ // .metric-selector-input-box{
+ // width: calc(100% - 92px) !important;
+ // }
.cm-editor.ͼ1.ͼ2.ͼo.cm-focused{
height: 100%;
}
diff --git a/nezha-fronted/src/components/common/alert/alertLabel.vue b/nezha-fronted/src/components/common/alert/alertLabel.vue
index 3a09a45ff..be446cc9b 100644
--- a/nezha-fronted/src/components/common/alert/alertLabel.vue
+++ b/nezha-fronted/src/components/common/alert/alertLabel.vue
@@ -36,7 +36,7 @@
{{ alertLabelData && alertLabelData.name ? alertLabelData.name : "--" }}
-
+
+
+
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")}}
+
+
+
@@ -892,6 +942,10 @@ export default {
this.loading = false
this.alertLabelData = this.that
}
+ if (this.type === 'recordRule') {
+ this.loading = false
+ this.alertLabelData = this.that
+ }
const weekDays = this.getWeeksTime()
if (this.trendTimer) {
clearTimeout(this.trendTimer)
@@ -954,6 +1008,8 @@ export default {
return 'nz-icon-Alertrule'
case 'user':
return 'nz-icon-user1'
+ case 'recordRule':
+ return 'nz-icon-Alertrule'
}
return 'nz-icon-module5'
},
diff --git a/nezha-fronted/src/components/common/mixin/alertLabelMixin.js b/nezha-fronted/src/components/common/mixin/alertLabelMixin.js
index c9cae186c..ea03f866f 100644
--- a/nezha-fronted/src/components/common/mixin/alertLabelMixin.js
+++ b/nezha-fronted/src/components/common/mixin/alertLabelMixin.js
@@ -39,7 +39,7 @@ export default {
this.alertLabelObj = item
this.alertLabelType = type
}
- this.$set(item[type], 'loading', loading)
+ this.$set(item, 'loading', loading)
}
this.timer = setTimeout(() => {
this.alertLabelShow = loading
@@ -61,6 +61,7 @@ export default {
case 'project':
case 'dc':
case 'user':
+ case 'recordRule':
return false
default: return true
}
diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js
index e13550b2d..d84e73ec7 100644
--- a/nezha-fronted/src/components/common/mixin/dataList.js
+++ b/nezha-fronted/src/components/common/mixin/dataList.js
@@ -1002,6 +1002,115 @@ export default {
jsonKey: 'valnum'
}
}
+ } else if (path === 'recordRule') {
+ searchKeys = {
+ // key: path 键
+ // value: vue set 参数
+ pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
+ pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
+ orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
+ ids: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'ids',
+ type: 'string',
+ defaultJson: {
+ disabled: false,
+ label: 'ids',
+ name: 'ID',
+ type: 'input',
+ val: ''
+ },
+ jsonKey: 'val'
+ },
+ state: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'state',
+ type: 'Number',
+ defaultJson: {
+ disabled: false,
+ label: 'recordState',
+ name: 'State',
+ readonly: true,
+ type: 'select',
+ val: ''
+ },
+ jsonKey: 'val'
+ },
+ name: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'name',
+ type: 'string',
+ defaultJson: {
+ disabled: false,
+ id: 'name',
+ label: 'name',
+ name: 'Name',
+ type: 'input',
+ val: ''
+ },
+ jsonKey: 'val'
+ },
+ type: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'type',
+ type: 'Number',
+ defaultJson: {
+ disabled: false,
+ label: 'recordType',
+ name: 'Type',
+ readonly: true,
+ type: 'select',
+ val: ''
+ },
+ jsonKey: 'val'
+ },
+ expr: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'expr',
+ type: 'string',
+ defaultJson: {
+ disabled: false,
+ label: 'expr',
+ name: 'Expression',
+ type: 'input',
+ val: ''
+ },
+ jsonKey: 'val'
+ },
+ starrd: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'starrd',
+ type: 'Number',
+ defaultJson: {
+ disabled: false,
+ label: 'starrd',
+ name: 'Starrd',
+ type: 'select',
+ val: ''
+ },
+ jsonKey: 'val'
+ },
+ buildIn: {
+ target: this.searchLabel,
+ isSearchInput: true,
+ propertyName: 'buildIn',
+ type: 'Number',
+ defaultJson: {
+ disabled: false,
+ label: 'buildIn',
+ name: 'buildIn',
+ type: 'select',
+ val: ''
+ },
+ jsonKey: 'val'
+ }
+ }
}
this.initQueryFromPath(searchKeys)
},
diff --git a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue
index f9bbeb10c..0cd2544f0 100644
--- a/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/recordRuleBox.vue
@@ -69,7 +69,7 @@