grafana/public/app/plugins/panel/live/module.tsx
Torkel Ödegaard 1d689888b0
Prettier: Upgrade to 2 (#30387)
* Updated package json but not updated source files

* Update eslint plugin

* updated files
2021-01-20 07:59:48 +01:00

38 lines
1.1 KiB
TypeScript
Executable File

import { PanelPlugin } from '@grafana/data';
import { LiveChannelEditor } from './LiveChannelEditor';
import { LivePanel } from './LivePanel';
import { LivePanelOptions, MessageDisplayMode } from './types';
export const plugin = new PanelPlugin<LivePanelOptions>(LivePanel).setPanelOptions((builder) => {
builder.addCustomEditor({
category: ['Channel'],
id: 'channel',
path: 'channel',
name: 'Channel',
editor: LiveChannelEditor,
defaultValue: {},
});
builder
.addRadio({
path: 'message',
name: 'Show Message',
description: 'Display the last message received on this channel',
settings: {
options: [
{ value: MessageDisplayMode.Raw, label: 'Raw Text' },
{ value: MessageDisplayMode.JSON, label: 'JSON' },
{ value: MessageDisplayMode.Auto, label: 'Auto' },
{ value: MessageDisplayMode.None, label: 'None' },
],
},
defaultValue: MessageDisplayMode.JSON,
})
.addBooleanSwitch({
path: 'publish',
name: 'Show Publish',
description: 'Display a form to publish values',
defaultValue: false,
});
});