diff --git a/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss b/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss index 6f8bf674e..ecffa92f6 100644 --- a/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss +++ b/nezha-fronted/src/assets/css/components/common/rightBox/panelBox.scss @@ -225,6 +225,9 @@ } } +.query-variable-table{ + +} .multiTip{ max-width:200px; } diff --git a/nezha-fronted/src/components/common/rightBox/panelBox.vue b/nezha-fronted/src/components/common/rightBox/panelBox.vue index 0c96ef7d8..e00bb1062 100644 --- a/nezha-fronted/src/components/common/rightBox/panelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/panelBox.vue @@ -97,18 +97,38 @@ - - - - - + +
+ + + + + + + + + + + + +
{{$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'))