grafana/public/app/plugins/panel/text/module.tsx

37 lines
1007 B
TypeScript
Raw Normal View History

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';
import { TextOptions } from './types';
import { textPanelMigrationHandler } from './textPanelMigrationHandler';
2018-01-02 07:52:30 -06:00
export const plugin = new PanelPlugin<TextOptions>(TextPanel)
.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
For markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)
`,
});
})
.setMigrationHandler(textPanelMigrationHandler);