Browse Source

options for value

merge-requests/3/head
vargburz 3 years ago
parent
commit
f6e525365d
  1. 19
      src/module.ts
  2. 3
      src/types.ts

19
src/module.ts

@ -29,6 +29,25 @@ export const plugin = new PanelPlugin<PanelOptions>(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',

3
src/types.ts

@ -7,6 +7,9 @@ export interface PanelOptions {
max?: number;
useMetricForMax: boolean;
maxMetricName: string;
value?: number;
useMetricForValue: boolean;
valueMetricName: string;
};
}

Loading…
Cancel
Save