Files
grafana/public/app/plugins/panel/logs/module.tsx
Dominik Prokop ea792edd3a NewPanelEditor/Panels: refactor setDefault to setPanelOptions (#23404)
* Remove deprecated setDefault usages

* Add simple support for conditinal field config properties

* Use new API in NewsPanel

* Update tests

* Fix check
2020-04-08 19:21:26 +02:00

39 lines
996 B
TypeScript

import { PanelPlugin } from '@grafana/data';
import { Options } from './types';
import { LogsPanel } from './LogsPanel';
import { SortOrder } from '../../../core/utils/explore';
export const plugin = new PanelPlugin<Options>(LogsPanel).setPanelOptions(builder => {
builder
.addBooleanSwitch({
path: 'showTime',
name: 'Time',
description: '',
defaultValue: false,
})
.addBooleanSwitch({
path: 'showLabels',
name: 'Unique labels',
description: '',
defaultValue: false,
})
.addBooleanSwitch({
path: 'wrapLogMessage',
name: 'Wrap lines',
description: '',
defaultValue: false,
})
.addRadio({
path: 'sortOrder',
name: 'Order',
description: '',
settings: {
options: [
{ value: SortOrder.Descending, label: 'Descending' },
{ value: SortOrder.Ascending, label: 'Ascending' },
],
},
defaultValue: SortOrder.Descending,
});
});