From 1464dd4095c897eb03b72c77c8674e59db8aa754 Mon Sep 17 00:00:00 2001 From: Victor Marin <36818606+mdvictor@users.noreply.github.com> Date: Fri, 27 Jan 2023 12:52:32 +0200 Subject: [PATCH] Re-add RowHeight option to StatusHistory (#62293) --- .../statushistorypanelcfg/schema-reference.md | 1 + public/app/plugins/panel/status-history/module.tsx | 10 ++++++++++ public/app/plugins/panel/status-history/panelcfg.cue | 2 ++ .../app/plugins/panel/status-history/panelcfg.gen.ts | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md b/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md index 2daba7d77d2..46a8a21a125 100644 --- a/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md +++ b/docs/sources/developers/kinds/composable/statushistorypanelcfg/schema-reference.md @@ -34,6 +34,7 @@ title: StatusHistoryPanelCfg kind | Property | Type | Required | Description | |-------------|--------|----------|-----------------------------------------------------------| | `colWidth` | number | No | Controls the column width Default: `0.9`. | +| `rowHeight` | number | No | Set the height of the rows Default: `0.9`. | | `showValue` | string | No | TODO docs Possible values are: `auto`, `never`, `always`. | diff --git a/public/app/plugins/panel/status-history/module.tsx b/public/app/plugins/panel/status-history/module.tsx index 5f7a1ec915e..8a922cf43e2 100644 --- a/public/app/plugins/panel/status-history/module.tsx +++ b/public/app/plugins/panel/status-history/module.tsx @@ -56,6 +56,16 @@ export const plugin = new PanelPlugin(StatusHist }, defaultValue: VisibilityMode.Auto, }) + .addSliderInput({ + path: 'rowHeight', + name: 'Row height', + defaultValue: 0.9, + settings: { + min: 0, + max: 1, + step: 0.01, + }, + }) .addSliderInput({ path: 'colWidth', name: 'Column width', diff --git a/public/app/plugins/panel/status-history/panelcfg.cue b/public/app/plugins/panel/status-history/panelcfg.cue index 7dda14c56f4..04a7fc4c6fc 100644 --- a/public/app/plugins/panel/status-history/panelcfg.cue +++ b/public/app/plugins/panel/status-history/panelcfg.cue @@ -30,6 +30,8 @@ composableKinds: PanelCfg: { ui.OptionsWithTooltip ui.OptionsWithTimezones + //Set the height of the rows + rowHeight: float32 & >=0 & <=1 | *0.9 //Show values on the columns showValue: ui.VisibilityMode | *"auto" //Controls the column width diff --git a/public/app/plugins/panel/status-history/panelcfg.gen.ts b/public/app/plugins/panel/status-history/panelcfg.gen.ts index 49948fe6c3b..4c96a911e9c 100644 --- a/public/app/plugins/panel/status-history/panelcfg.gen.ts +++ b/public/app/plugins/panel/status-history/panelcfg.gen.ts @@ -17,6 +17,10 @@ export interface PanelOptions extends ui.OptionsWithLegend, ui.OptionsWithToolti * Controls the column width */ colWidth?: number; + /** + * Set the height of the rows + */ + rowHeight: number; /** * Show values on the columns */ @@ -25,6 +29,7 @@ export interface PanelOptions extends ui.OptionsWithLegend, ui.OptionsWithToolti export const defaultPanelOptions: Partial = { colWidth: 0.9, + rowHeight: 0.9, showValue: ui.VisibilityMode.Auto, };