|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
import { ReactPanelPlugin } from '@grafana/ui'; |
|
|
|
|
import { SingleStatOptions, defaults } from './types'; |
|
|
|
|
import { SingleStatOptions, defaults, SingleStatBaseOptions } from './types'; |
|
|
|
|
import { SingleStatPanel } from './SingleStatPanel'; |
|
|
|
|
import cloneDeep from 'lodash/cloneDeep'; |
|
|
|
|
import { SingleStatEditor } from './SingleStatEditor'; |
|
|
|
@ -8,8 +8,8 @@ export const reactPanel = new ReactPanelPlugin<SingleStatOptions>(SingleStatPane |
|
|
|
|
|
|
|
|
|
const optionsToKeep = ['valueOptions', 'stat', 'maxValue', 'maxValue', 'thresholds', 'valueMappings']; |
|
|
|
|
|
|
|
|
|
export const singleStatOptionsCheck = ( |
|
|
|
|
options: Partial<SingleStatOptions>, |
|
|
|
|
export const singleStatBaseOptionsCheck = ( |
|
|
|
|
options: Partial<SingleStatBaseOptions>, |
|
|
|
|
prevPluginId?: string, |
|
|
|
|
prevOptions?: any |
|
|
|
|
) => { |
|
|
|
@ -26,4 +26,4 @@ export const singleStatOptionsCheck = ( |
|
|
|
|
|
|
|
|
|
reactPanel.setEditor(SingleStatEditor); |
|
|
|
|
reactPanel.setDefaults(defaults); |
|
|
|
|
reactPanel.setPanelTypeChangedHook(singleStatOptionsCheck); |
|
|
|
|
reactPanel.setPanelTypeChangedHook(singleStatBaseOptionsCheck); |
|
|
|
|