|
|
@ -1,7 +1,9 @@ |
|
|
|
import { PanelPlugin } from '@grafana/data'; |
|
|
|
|
|
|
|
import { PanelOptions, Pod } from './types'; |
|
|
|
import { PanelOptions, Pod } from './types'; |
|
|
|
import { Panel } from './components/Panel'; |
|
|
|
import { Panel } from './components/Panel'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { PanelPlugin } from '@grafana/data'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((builder) => { |
|
|
|
export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((builder) => { |
|
|
|
return builder |
|
|
|
return builder |
|
|
|
.addRadio({ |
|
|
|
.addRadio({ |
|
|
@ -29,25 +31,14 @@ export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((buil |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.addNumberInput({ |
|
|
|
|
|
|
|
name: 'Value', |
|
|
|
|
|
|
|
path: 'gauge.value.value', |
|
|
|
|
|
|
|
category: ['Extremum'], |
|
|
|
|
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE && !config.gauge.value.useMetric, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.addFieldNamePicker({ |
|
|
|
.addFieldNamePicker({ |
|
|
|
name: 'Value', |
|
|
|
name: 'Value', |
|
|
|
path: 'gauge.value.metricName', |
|
|
|
path: 'gauge.value.metricName', |
|
|
|
category: ['Extremum'], |
|
|
|
category: ['Extremum'], |
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE && config.gauge.value.useMetric, |
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE |
|
|
|
}) |
|
|
|
|
|
|
|
.addBooleanSwitch({ |
|
|
|
|
|
|
|
path: 'gauge.value.useMetric', |
|
|
|
|
|
|
|
name: 'Use metric', |
|
|
|
|
|
|
|
defaultValue: false, |
|
|
|
|
|
|
|
category: ['Extremum'], |
|
|
|
|
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE, |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.addNumberInput({ |
|
|
|
.addNumberInput({ |
|
|
|
path: 'gauge.min.value', |
|
|
|
path: 'gauge.min.value', |
|
|
|
name: 'Min', |
|
|
|
name: 'Min', |
|
|
@ -67,6 +58,7 @@ export const plugin = new PanelPlugin<PanelOptions>(Panel).setPanelOptions((buil |
|
|
|
category: ['Extremum'], |
|
|
|
category: ['Extremum'], |
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE, |
|
|
|
showIf: (config) => config.visualizationType === Pod.GAUGE, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.addNumberInput({ |
|
|
|
.addNumberInput({ |
|
|
|
path: 'gauge.max.value', |
|
|
|
path: 'gauge.max.value', |
|
|
|
name: 'Max', |
|
|
|
name: 'Max', |
|
|
|