mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* WIP: initial commit to transition to new edit mode * More old edit cleanup * Minor update * Refactoring url edit/fullscreen state to simplify logic, now seperate states * Fixed tests and part of the explore integration * Updated snapshot * Fix alert rule links * Fixed issue going back from explore * Updated snapshots * Fixes and changes * Fixed bridge srv issue * Fixed add panel issue * Removed console log * Removed render * Tests: fixes e2e smoketest * Make description optional * Fixed typings * e2e fixes * removed import * updated snapshot Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { sharedSingleStatPanelChangedHandler } from '@grafana/ui';
|
|
import { PanelPlugin } from '@grafana/data';
|
|
import { BarGaugePanel } from './BarGaugePanel';
|
|
import { BarGaugeOptions, displayModes } from './types';
|
|
import { addStandardDataReduceOptions } from '../stat/types';
|
|
import { barGaugePanelMigrationHandler } from './BarGaugeMigrations';
|
|
|
|
export const plugin = new PanelPlugin<BarGaugeOptions>(BarGaugePanel)
|
|
.useFieldConfig()
|
|
.setPanelOptions(builder => {
|
|
addStandardDataReduceOptions(builder);
|
|
builder
|
|
.addRadio({
|
|
path: 'displayMode',
|
|
name: 'Display mode',
|
|
settings: {
|
|
options: displayModes,
|
|
},
|
|
defaultValue: 'gradient',
|
|
})
|
|
.addBooleanSwitch({
|
|
path: 'showUnfilled',
|
|
name: 'Show unfilled area',
|
|
description: 'When enabled renders the unfilled region as gray',
|
|
defaultValue: true,
|
|
showIf: (options: BarGaugeOptions) => options.displayMode !== 'lcd',
|
|
});
|
|
})
|
|
.setPanelChangeHandler(sharedSingleStatPanelChangedHandler)
|
|
.setMigrationHandler(barGaugePanelMigrationHandler);
|