mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
23 lines
752 B
TypeScript
23 lines
752 B
TypeScript
import { ReactPanelPlugin } from '@grafana/ui';
|
|
|
|
import { BarGaugePanel } from './BarGaugePanel';
|
|
import { BarGaugePanelEditor } from './BarGaugePanelEditor';
|
|
import { BarGaugeOptions, defaults } from './types';
|
|
|
|
export const reactPanel = new ReactPanelPlugin<BarGaugeOptions>(BarGaugePanel);
|
|
|
|
reactPanel.setEditor(BarGaugePanelEditor);
|
|
reactPanel.setDefaults(defaults);
|
|
reactPanel.setPreserveOptionsHandler((pluginId: string, prevOptions: any) => {
|
|
const options: Partial<BarGaugeOptions> = {};
|
|
|
|
if (prevOptions.valueOptions) {
|
|
options.valueOptions = prevOptions.valueOptions;
|
|
options.thresholds = prevOptions.thresholds;
|
|
options.maxValue = prevOptions.maxValue;
|
|
options.minValue = prevOptions.minValue;
|
|
}
|
|
|
|
return options;
|
|
});
|