2019-10-31 04:48:05 -05:00
|
|
|
import { PanelPlugin } from '@grafana/data';
|
2019-02-18 04:41:14 -06:00
|
|
|
import { GaugePanelEditor } from './GaugePanelEditor';
|
2019-01-09 10:00:10 -06:00
|
|
|
import { GaugePanel } from './GaugePanel';
|
2019-02-18 04:41:14 -06:00
|
|
|
import { GaugeOptions, defaults } from './types';
|
2020-03-28 17:11:50 -05:00
|
|
|
import { standardFieldConfig, addStandardDataReduceOptions } from '../stat/types';
|
2019-08-18 17:01:07 -05:00
|
|
|
import { gaugePanelMigrationHandler, gaugePanelChangedHandler } from './GaugeMigrations';
|
2019-02-18 04:41:14 -06:00
|
|
|
|
2019-04-26 12:16:38 -05:00
|
|
|
export const plugin = new PanelPlugin<GaugeOptions>(GaugePanel)
|
2019-03-24 09:56:32 -05:00
|
|
|
.setDefaults(defaults)
|
2020-03-19 05:50:31 -05:00
|
|
|
.setFieldConfigDefaults(standardFieldConfig)
|
2019-03-24 09:56:32 -05:00
|
|
|
.setEditor(GaugePanelEditor)
|
2020-03-28 17:11:50 -05:00
|
|
|
.setPanelOptions(builder => {
|
|
|
|
addStandardDataReduceOptions(builder);
|
|
|
|
|
|
|
|
builder
|
|
|
|
.addBooleanSwitch({
|
|
|
|
id: 'showThresholdLabels',
|
|
|
|
name: 'Show threshold Labels',
|
|
|
|
description: 'Render the threshold values around the gauge bar',
|
|
|
|
})
|
|
|
|
.addBooleanSwitch({
|
|
|
|
id: 'showThresholdMarkers',
|
|
|
|
name: 'Show threshold markers',
|
|
|
|
description: 'Renders the thresholds as an outer bar',
|
|
|
|
});
|
|
|
|
})
|
2019-08-18 17:01:07 -05:00
|
|
|
.setPanelChangeHandler(gaugePanelChangedHandler)
|
|
|
|
.setMigrationHandler(gaugePanelMigrationHandler);
|