Stat: improve color mode migration from singlestat panels (#35538)

This commit is contained in:
Ryan McKinley
2021-06-11 09:03:30 -07:00
committed by GitHub
parent 4907d09ffe
commit 056e17216e
6 changed files with 63 additions and 14 deletions

View File

@ -1,4 +1,9 @@
import { BigValueTextMode, commonOptionsBuilder, sharedSingleStatMigrationHandler } from '@grafana/ui';
import {
BigValueColorMode,
BigValueTextMode,
commonOptionsBuilder,
sharedSingleStatMigrationHandler,
} from '@grafana/ui';
import { PanelPlugin } from '@grafana/data';
import { addOrientationOption, addStandardDataReduceOptions, StatPanelOptions } from './types';
import { StatPanel } from './StatPanel';
@ -34,12 +39,13 @@ export const plugin = new PanelPlugin<StatPanelOptions>(StatPanel)
.addRadio({
path: 'colorMode',
name: 'Color mode',
defaultValue: 'value',
defaultValue: BigValueColorMode.Value,
category: mainCategory,
settings: {
options: [
{ value: 'value', label: 'Value' },
{ value: 'background', label: 'Background' },
{ value: BigValueColorMode.None, label: 'None' },
{ value: BigValueColorMode.Value, label: 'Value' },
{ value: BigValueColorMode.Background, label: 'Background' },
],
},
})