mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { PanelPlugin } from '@grafana/data';
|
|
|
|
import { TextPanel } from './TextPanel';
|
|
import { textPanelMigrationHandler } from './textPanelMigrationHandler';
|
|
import { TextPanelEditor } from './TextPanelEditor';
|
|
import { defaultPanelOptions, PanelOptions, TextMode } from './models.gen';
|
|
|
|
export const plugin = new PanelPlugin<PanelOptions>(TextPanel)
|
|
.setPanelOptions((builder) => {
|
|
builder
|
|
.addRadio({
|
|
path: 'mode',
|
|
name: 'Mode',
|
|
description: 'text mode of the panel',
|
|
settings: {
|
|
options: [
|
|
{ value: TextMode.Markdown, label: 'Markdown' },
|
|
{ value: TextMode.HTML, label: 'HTML' },
|
|
],
|
|
},
|
|
defaultValue: defaultPanelOptions.mode,
|
|
})
|
|
.addCustomEditor({
|
|
id: 'content',
|
|
path: 'content',
|
|
name: 'Content',
|
|
description: 'Content of the panel',
|
|
editor: TextPanelEditor,
|
|
defaultValue: defaultPanelOptions.content,
|
|
});
|
|
})
|
|
.setMigrationHandler(textPanelMigrationHandler);
|