grafana/public/app/plugins/panel/debug/module.tsx
Josh Hunt 3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00

59 lines
1.7 KiB
TypeScript

import { PanelPlugin } from '@grafana/data';
import { DebugPanel } from './DebugPanel';
import { StateViewEditor } from './StateView';
import { DebugMode, DebugPanelOptions } from './types';
export const plugin = new PanelPlugin<DebugPanelOptions>(DebugPanel).useFieldConfig().setPanelOptions((builder) => {
builder
.addSelect({
path: 'mode',
name: 'Mode',
defaultValue: DebugMode.Render,
settings: {
options: [
{ label: 'Render', value: DebugMode.Render },
{ label: 'Events', value: DebugMode.Events },
{ label: 'Cursor', value: DebugMode.Cursor },
{ label: 'Cursor', value: DebugMode.Cursor },
{ label: 'Share state', value: DebugMode.State },
{ label: 'Throw error', value: DebugMode.ThrowError },
],
},
})
.addCustomEditor({
id: 'stateView',
path: 'stateView',
name: 'State view',
defaultValue: '',
showIf: ({ mode }) => mode === DebugMode.State,
editor: StateViewEditor,
})
.addBooleanSwitch({
path: 'counters.render',
name: 'Render Count',
defaultValue: true,
showIf: ({ mode }) => mode === DebugMode.Render,
})
.addBooleanSwitch({
path: 'counters.dataChanged',
name: 'Data Changed Count',
defaultValue: true,
showIf: ({ mode }) => mode === DebugMode.Render,
})
.addBooleanSwitch({
path: 'counters.schemaChanged',
name: 'Schema Changed Count',
defaultValue: true,
showIf: ({ mode }) => mode === DebugMode.Render,
})
.addDashboardPicker({
path: 'dashboardUID',
name: 'Dashboard',
settings: {
placeholder: 'Select dashboard',
isClearable: true,
},
});
});