2018-12-23 09:15:32 +01:00
|
|
|
// Libraries
|
2018-11-12 17:54:44 +01:00
|
|
|
import _ from 'lodash';
|
|
|
|
|
import React, { PureComponent } from 'react';
|
2018-12-23 09:15:32 +01:00
|
|
|
|
2019-02-15 12:55:35 +01:00
|
|
|
// Components
|
|
|
|
|
import { AlertBox } from 'app/core/components/AlertBox/AlertBox';
|
|
|
|
|
|
2018-12-23 09:15:32 +01:00
|
|
|
// Types
|
2019-04-29 08:17:35 -07:00
|
|
|
import { AppNotificationSeverity } from 'app/types';
|
2019-04-30 22:36:46 -07:00
|
|
|
import { PanelProps, PanelPlugin, PluginType } from '@grafana/ui';
|
2018-11-12 17:54:44 +01:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
pluginId: string;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-13 07:54:02 +01:00
|
|
|
class PanelPluginNotFound extends PureComponent<Props> {
|
2019-04-30 22:36:46 -07:00
|
|
|
constructor(props: Props) {
|
2018-11-12 17:54:44 +01:00
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
2018-11-13 07:54:02 +01:00
|
|
|
const style = {
|
|
|
|
|
display: 'flex',
|
2018-11-13 08:40:42 +01:00
|
|
|
alignItems: 'center',
|
2019-02-15 12:55:35 +01:00
|
|
|
justifyContent: 'center',
|
2018-11-13 07:54:02 +01:00
|
|
|
height: '100%',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div style={style}>
|
2019-02-21 16:07:07 +01:00
|
|
|
<AlertBox severity={AppNotificationSeverity.Error} title={`Panel plugin not found: ${this.props.pluginId}`} />
|
2018-11-13 07:54:02 +01:00
|
|
|
</div>
|
|
|
|
|
);
|
2018-11-12 17:54:44 +01:00
|
|
|
}
|
|
|
|
|
}
|
2018-11-13 07:54:02 +01:00
|
|
|
|
2019-04-30 22:36:46 -07:00
|
|
|
export function getPanelPluginNotFound(id: string): PanelPlugin {
|
2018-11-13 07:54:02 +01:00
|
|
|
const NotFound = class NotFound extends PureComponent<PanelProps> {
|
|
|
|
|
render() {
|
|
|
|
|
return <PanelPluginNotFound pluginId={id} />;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2019-04-30 22:36:46 -07:00
|
|
|
const plugin = new PanelPlugin(NotFound);
|
|
|
|
|
plugin.meta = {
|
2018-11-13 07:54:02 +01:00
|
|
|
id: id,
|
|
|
|
|
name: id,
|
|
|
|
|
sort: 100,
|
2019-04-12 04:46:42 -07:00
|
|
|
type: PluginType.panel,
|
2018-11-13 07:54:02 +01:00
|
|
|
module: '',
|
|
|
|
|
baseUrl: '',
|
2019-02-12 16:05:29 +01:00
|
|
|
dataFormats: [],
|
2018-11-13 08:09:12 +01:00
|
|
|
info: {
|
|
|
|
|
author: {
|
|
|
|
|
name: '',
|
|
|
|
|
},
|
|
|
|
|
description: '',
|
|
|
|
|
links: [],
|
|
|
|
|
logos: {
|
|
|
|
|
large: '',
|
|
|
|
|
small: '',
|
|
|
|
|
},
|
|
|
|
|
screenshots: [],
|
|
|
|
|
updated: '',
|
|
|
|
|
version: '',
|
2018-11-13 07:54:02 +01:00
|
|
|
},
|
|
|
|
|
};
|
2019-04-30 22:36:46 -07:00
|
|
|
return plugin;
|
2018-11-13 07:54:02 +01:00
|
|
|
}
|