|
|
|
import { PanelPlugin } from '@grafana/data';
|
|
|
|
import { PanelOptions, Pod } from './types';
|
|
|
|
import { Panel } from './components/Panel';
|
|
|
|
|
|
|
|
export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((builder) => {
|
|
|
|
return builder
|
|
|
|
.addRadio({
|
|
|
|
path: 'visualizationType',
|
|
|
|
name: 'Visualization type',
|
|
|
|
defaultValue: Pod.GAUGE,
|
|
|
|
settings: {
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: 'Gauge',
|
|
|
|
value: Pod.GAUGE,
|
|
|
|
description: 'Enable gauge pod',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Line',
|
|
|
|
value: Pod.LINE,
|
|
|
|
description: 'Enable line pod',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Bar',
|
|
|
|
value: Pod.BAR,
|
|
|
|
description: 'Enable bar pod',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.addTextInput({
|
|
|
|
path: 'text',
|
|
|
|
name: 'Simple text option',
|
|
|
|
description: 'Description of panel option',
|
|
|
|
defaultValue: 'Default value of text input option',
|
|
|
|
})
|
|
|
|
.addBooleanSwitch({
|
|
|
|
path: 'showSeriesCount',
|
|
|
|
name: 'Show series counter',
|
|
|
|
defaultValue: false,
|
|
|
|
})
|
|
|
|
.addRadio({
|
|
|
|
path: 'seriesCountSize',
|
|
|
|
defaultValue: 'sm',
|
|
|
|
name: 'Series counter size',
|
|
|
|
settings: {
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
value: 'sm',
|
|
|
|
label: 'Small',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 'md',
|
|
|
|
label: 'Medium',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 'lg',
|
|
|
|
label: 'Large',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE,
|
|
|
|
});
|
|
|
|
});
|