mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 03:43:03 +08:00
Fixes after merging #15468
This commit is contained in:
@ -1,19 +1,10 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { PanelOptionsProps, PanelOptionsGrid } from '@grafana/ui';
|
import { PanelEditorProps, PanelOptionsGrid } from '@grafana/ui';
|
||||||
|
|
||||||
import ValueOptions from './ValueOptions';
|
import ValueOptions from './ValueOptions';
|
||||||
import { PiechartOptions } from './types';
|
import { PiechartOptions } from './types';
|
||||||
|
|
||||||
export const defaultProps = {
|
export default class PiechartPanelOptions extends PureComponent<PanelEditorProps<PiechartOptions>> {
|
||||||
options: {
|
|
||||||
pieType: 'pie',
|
|
||||||
unit: 'short',
|
|
||||||
stat: 'current',
|
|
||||||
strokeWidth: 1,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default class PiechartPanelOptions extends PureComponent<PanelOptionsProps<PiechartOptions>> {
|
|
||||||
static defaultProps = defaultProps;
|
static defaultProps = defaultProps;
|
||||||
|
|
||||||
render() {
|
render() {
|
@ -1,4 +1,10 @@
|
|||||||
import PiechartPanelOptions, { defaultProps } from './PiechartPanelOptions';
|
import { ReactPanelPlugin } from '@grafana/ui';
|
||||||
import { PiechartPanel } from './PiechartPanel';
|
|
||||||
|
|
||||||
export { PiechartPanel as Panel, PiechartPanelOptions as PanelOptions, defaultProps as PanelDefaults };
|
import PiechartPanelEditor from './PiechartPanelEditor';
|
||||||
|
import { PiechartPanel } from './PiechartPanel';
|
||||||
|
import { PiechartOptions, defaults } from './types';
|
||||||
|
|
||||||
|
export const reactPanel = new ReactPanelPlugin<PiechartOptions>(PiechartPanel);
|
||||||
|
|
||||||
|
reactPanel.setEditor(PiechartPanelEditor);
|
||||||
|
reactPanel.setDefaults(defaults);
|
||||||
|
@ -5,3 +5,10 @@ export interface PiechartOptions {
|
|||||||
strokeWidth: number;
|
strokeWidth: number;
|
||||||
// TODO: Options for Legend / Combine components
|
// TODO: Options for Legend / Combine components
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const defaults: PiechartOptions = {
|
||||||
|
pieType: 'pie',
|
||||||
|
unit: 'short',
|
||||||
|
stat: 'current',
|
||||||
|
strokeWidth: 1,
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user