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; }; }