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-04-08 12:21:26 -05:00
|
|
|
import { TextOptions } from './types';
|
2020-06-10 07:35:30 -05:00
|
|
|
import { textPanelMigrationHandler } from './textPanelMigrationHandler';
|
2018-01-02 07:52:30 -06:00
|
|
|
|
2019-04-26 12:16:38 -05:00
|
|
|
export const plugin = new PanelPlugin<TextOptions>(TextPanel)
|
2020-04-08 12:21:26 -05:00
|
|
|
.setPanelOptions(builder => {
|
|
|
|
builder
|
|
|
|
.addRadio({
|
|
|
|
path: 'mode',
|
|
|
|
name: 'Mode',
|
|
|
|
description: 'text mode of the panel',
|
|
|
|
settings: {
|
|
|
|
options: [
|
|
|
|
{ value: 'markdown', label: 'Markdown' },
|
|
|
|
{ value: 'html', label: 'HTML' },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
defaultValue: 'markdown',
|
|
|
|
})
|
|
|
|
.addTextInput({
|
|
|
|
path: 'content',
|
|
|
|
name: 'Content',
|
|
|
|
description: 'Content of the panel',
|
|
|
|
settings: {
|
|
|
|
useTextarea: true,
|
|
|
|
rows: 5,
|
|
|
|
},
|
|
|
|
defaultValue: `# Title
|
2020-06-10 07:35:30 -05:00
|
|
|
|
2020-04-08 12:21:26 -05:00
|
|
|
For markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)
|
|
|
|
`,
|
|
|
|
});
|
|
|
|
})
|
2020-06-10 07:35:30 -05:00
|
|
|
.setMigrationHandler(textPanelMigrationHandler);
|