From f6e525365d462bc9de1274f9a87349436a4ce983 Mon Sep 17 00:00:00 2001 From: vargburz Date: Tue, 3 May 2022 18:23:32 +0300 Subject: [PATCH] options for value --- src/module.ts | 19 +++++++++++++++++++ src/types.ts | 3 +++ 2 files changed, 22 insertions(+) diff --git a/src/module.ts b/src/module.ts index 3cefdac..c8fef42 100644 --- a/src/module.ts +++ b/src/module.ts @@ -29,6 +29,25 @@ export const plugin = new PanelPlugin(Panel).setPanelOptions((buil ], }, }) + .addNumberInput({ + name: 'Value', + path: 'gauge.value', + category: ['Extremum'], + showIf: (config) => config.visualizationType === Pod.GAUGE && !config.gauge.useMetricForValue, + }) + .addFieldNamePicker({ + name: 'Value', + path: 'gauge.valueMetricName', + category: ['Extremum'], + showIf: (config) => config.visualizationType === Pod.GAUGE && config.gauge.useMetricForValue, + }) + .addBooleanSwitch({ + path: 'gauge.useMetricForValue', + name: 'Use metric', + defaultValue: false, + category: ['Extremum'], + showIf: (config) => config.visualizationType === Pod.GAUGE, + }) .addNumberInput({ path: 'gauge.min', name: 'Min', diff --git a/src/types.ts b/src/types.ts index 0950057..b44a56e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,6 +7,9 @@ export interface PanelOptions { max?: number; useMetricForMax: boolean; maxMetricName: string; + value?: number; + useMetricForValue: boolean; + valueMetricName: string; }; }