mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* 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
31 lines
964 B
TypeScript
31 lines
964 B
TypeScript
import React, { Component } from 'react';
|
|
|
|
import { PanelProps } from '@grafana/data';
|
|
|
|
import { CursorView } from './CursorView';
|
|
import { EventBusLoggerPanel } from './EventBusLogger';
|
|
import { RenderInfoViewer } from './RenderInfoViewer';
|
|
import { StateView } from './StateView';
|
|
import { DebugPanelOptions, DebugMode } from './types';
|
|
|
|
type Props = PanelProps<DebugPanelOptions>;
|
|
|
|
export class DebugPanel extends Component<Props> {
|
|
render() {
|
|
const { options } = this.props;
|
|
|
|
switch (options.mode) {
|
|
case DebugMode.Events:
|
|
return <EventBusLoggerPanel eventBus={this.props.eventBus} />;
|
|
case DebugMode.Cursor:
|
|
return <CursorView eventBus={this.props.eventBus} />;
|
|
case DebugMode.State:
|
|
return <StateView {...this.props} />;
|
|
case DebugMode.ThrowError:
|
|
throw new Error('I failed you and for that i am deeply sorry');
|
|
default:
|
|
return <RenderInfoViewer {...this.props} />;
|
|
}
|
|
}
|
|
}
|