2020-06-10 07:35:30 -05:00
|
|
|
import { PanelPlugin } from '@grafana/data';
|
2018-01-02 07:52:30 -06:00
|
|
|
|
2019-02-23 23:53:20 -06:00
|
|
|
import { TextPanel } from './TextPanel';
|
2020-06-10 07:35:30 -05:00
|
|
|
import { textPanelMigrationHandler } from './textPanelMigrationHandler';
|
2020-06-29 14:17:31 -05:00
|
|
|
import { TextPanelEditor } from './TextPanelEditor';
|
2021-04-29 22:12:37 -05:00
|
|
|
import { defaultPanelOptions, PanelOptions, TextMode } from './models.gen';
|
2018-01-02 07:52:30 -06:00
|
|
|
|
2021-04-29 22:12:37 -05:00
|
|
|
export const plugin = new PanelPlugin<PanelOptions>(TextPanel)
|
2021-01-20 00:59:48 -06:00
|
|
|
.setPanelOptions((builder) => {
|
2020-04-08 12:21:26 -05:00
|
|
|
builder
|
|
|
|
.addRadio({
|
|
|
|
path: 'mode',
|
|
|
|
name: 'Mode',
|
|
|
|
description: 'text mode of the panel',
|
|
|
|
settings: {
|
|
|
|
options: [
|
2021-04-29 22:12:37 -05:00
|
|
|
{ value: TextMode.Markdown, label: 'Markdown' },
|
|
|
|
{ value: TextMode.HTML, label: 'HTML' },
|
2020-04-08 12:21:26 -05:00
|
|
|
],
|
|
|
|
},
|
2021-04-29 22:12:37 -05:00
|
|
|
defaultValue: defaultPanelOptions.mode,
|
2020-04-08 12:21:26 -05:00
|
|
|
})
|
2020-06-29 14:17:31 -05:00
|
|
|
.addCustomEditor({
|
|
|
|
id: 'content',
|
2020-04-08 12:21:26 -05:00
|
|
|
path: 'content',
|
|
|
|
name: 'Content',
|
|
|
|
description: 'Content of the panel',
|
2020-06-29 14:17:31 -05:00
|
|
|
editor: TextPanelEditor,
|
2021-04-29 22:12:37 -05:00
|
|
|
defaultValue: defaultPanelOptions.content,
|
2020-04-08 12:21:26 -05:00
|
|
|
});
|
|
|
|
})
|
2021-11-25 03:52:01 -06:00
|
|
|
.setMigrationHandler(textPanelMigrationHandler);
|