From 5135e3f47d16f19e7dd0f09f6f5dc24208896c3d Mon Sep 17 00:00:00 2001 From: vargburz Date: Fri, 6 May 2022 21:37:36 +0300 Subject: [PATCH] rversed options --- src/models/options.ts | 1 + src/module.ts | 8 +++++++- src/types.ts | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/models/options.ts b/src/models/options.ts index 2608597..bf572f9 100644 --- a/src/models/options.ts +++ b/src/models/options.ts @@ -43,6 +43,7 @@ export class Options { minValue: this.minValue, valueFormatter: (val: any) => val.toFixed(2), defaultColor: 'green', + reversed: this.grafanaOptions.gauge.reversed, stops: [ { color: 'green', diff --git a/src/module.ts b/src/module.ts index 4dd7a1b..86de3c7 100644 --- a/src/module.ts +++ b/src/module.ts @@ -79,7 +79,13 @@ export const plugin = new PanelPlugin(Panel).setPanelOptions((buil category: ['Extremum'], showIf: (config) => config.visualizationType === Pod.GAUGE, }) - + .addBooleanSwitch({ + path: 'gauge.reversed', + name: 'Reversed', + defaultValue: false, + category: ['Direction'], + showIf: (config) => config.visualizationType === Pod.GAUGE, + }) .addCustomEditor({ id: 'icons', path: 'gauge.icons', diff --git a/src/types.ts b/src/types.ts index 3b62bab..f0427d2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,6 +4,7 @@ export interface PanelOptions { min: ExtremumOptions; max: ExtremumOptions; value: ExtremumOptions; + reversed: boolean; }; }