+
+
+
+
+
+ | {{$t('overall.name')}} |
+ {{$t('overall.remark')}} |
+
+
+
+ | {{item.name}} |
+ {{item.description}} |
+
+
+
+
+ {{$t('dashboard.panel.queryExpression')}}
+
+
+
+
+
+
+
+
@@ -371,7 +391,14 @@ export default {
],
dateFormatStr: localStorage.getItem('nz-default-dateFormat')
? localStorage.getItem('nz-default-dateFormat')
- : 'YYYY-MM-DD HH:ss:mm'
+ : 'YYYY-MM-DD HH:ss:mm',
+ queryVariableList: [
+ { name: 'label_names()', description: 'Returns a list of metric label names.' },
+ { name: 'label_values(label)', description: 'Returns a list of label values for the label in every metric.' },
+ { name: 'label_values(metric, label)', description: 'Returns a list of label values for the label in the specified metric.' },
+ { name: 'metrics(metric)', description: 'Returns a list of metrics matching the specified metric regex.' },
+ { name: 'query_result(query)', description: 'Returns a list of metric query result for the query.' }
+ ]
}
},
created () {
@@ -418,7 +445,7 @@ export default {
addVariable () {
const temp = {
show: true,
- type: 'custom',
+ type: 'query',
multi: false,
allOption: false
}
@@ -563,7 +590,7 @@ export default {
if (!this.editPanel.param.variables || !this.editPanel.param.variables.length) {
const temp = [{
show: true,
- type: 'custom',
+ type: 'query',
multi: false,
allOption: false
}]
diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue
index b3ff2b0a5..9d7d23fe3 100644
--- a/nezha-fronted/src/components/page/dashboard/panel.vue
+++ b/nezha-fronted/src/components/page/dashboard/panel.vue
@@ -458,8 +458,7 @@ export default {
repeat: 1
}
},
- chartShare: 'none',
- variables: []
+ chartShare: 'none'
}
}
// this.$refs.panelBox.setTitle(this.$t('dashboard.panel.createPanelTitle'))