grafana/public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx

72 lines
1.3 KiB
TypeScript
Raw Normal View History

2018-11-12 10:54:44 -06:00
import _ from 'lodash';
import React, { PureComponent } from 'react';
2018-11-13 00:54:02 -06:00
import { PanelPlugin, PanelProps } from 'app/types';
2018-11-12 10:54:44 -06:00
interface Props {
pluginId: string;
}
2018-11-13 00:54:02 -06:00
class PanelPluginNotFound extends PureComponent<Props> {
2018-11-12 10:54:44 -06:00
constructor(props) {
super(props);
}
render() {
2018-11-13 00:54:02 -06:00
const style = {
display: 'flex',
'align-items': 'center',
'text-align': 'center',
height: '100%',
};
return (
<div style={style}>
<div className="alert alert-error" style={{ margin: '0 auto' }}>
Panel plugin with id {this.props.pluginId} could not be found
</div>
</div>
);
2018-11-12 10:54:44 -06:00
}
}
2018-11-13 00:54:02 -06:00
export function getPanelPluginNotFound(id: string): PanelPlugin {
const NotFound = class NotFound extends PureComponent<PanelProps> {
render() {
return <PanelPluginNotFound pluginId={id} />;
}
};
const info = {
author: {
name: '',
},
description: '',
links: [],
logos: {
large: '',
small: '',
},
screenshots: [],
updated: '',
version: '',
};
return {
id: id,
name: id,
sort: 100,
module: '',
baseUrl: '',
meta: {
id: id,
name: id,
info: info,
includes: [],
},
info: info,
exports: {
PanelComponent: NotFound,
},
};
}