diff --git a/packages/grafana-ui/src/types/plugin.ts b/packages/grafana-ui/src/types/plugin.ts index c84c2366617..f47591e2f11 100644 --- a/packages/grafana-ui/src/types/plugin.ts +++ b/packages/grafana-ui/src/types/plugin.ts @@ -124,6 +124,9 @@ export class GrafanaPlugin { // Meta is filled in by the plugin loading system meta?: T; + // This is set if the plugin system had errors loading the plugin + loadError?: boolean; + // Config control (app/datasource) angularConfigCtrl?: any; diff --git a/public/app/features/dashboard/dashgrid/PanelPluginError.tsx b/public/app/features/dashboard/dashgrid/PanelPluginError.tsx index 5bec4191873..3f88dcca1c9 100644 --- a/public/app/features/dashboard/dashgrid/PanelPluginError.tsx +++ b/public/app/features/dashboard/dashgrid/PanelPluginError.tsx @@ -36,7 +36,7 @@ class PanelPluginError extends PureComponent { } export function getPanelPluginLoadError(meta: PanelPluginMeta, err: any): PanelPlugin { - const NotFound = class NotFound extends PureComponent { + const LoadError = class LoadError extends PureComponent { render() { const text = ( <> @@ -47,8 +47,9 @@ export function getPanelPluginLoadError(meta: PanelPluginMeta, err: any): PanelP return ; } }; - const plugin = new PanelPlugin(NotFound); + const plugin = new PanelPlugin(LoadError); plugin.meta = meta; + plugin.loadError = true; return plugin; } diff --git a/public/app/features/plugins/PluginPage.tsx b/public/app/features/plugins/PluginPage.tsx index 43a65ffe6ec..b2dd42058a2 100644 --- a/public/app/features/plugins/PluginPage.tsx +++ b/public/app/features/plugins/PluginPage.tsx @@ -6,7 +6,7 @@ import find from 'lodash/find'; // Types import { UrlQueryMap } from '@grafana/runtime'; -import { StoreState } from 'app/types'; +import { StoreState, AppNotificationSeverity } from 'app/types'; import { PluginType, GrafanaPlugin, @@ -30,6 +30,7 @@ import { PluginDashboards } from './PluginDashboards'; import { appEvents } from 'app/core/core'; import { config } from 'app/core/config'; import { ContextSrv } from '../../core/services/context_srv'; +import { AlertBox } from 'app/core/components/AlertBox/AlertBox'; export function getLoadingNav(): NavModel { const node = { @@ -140,7 +141,7 @@ class PluginPage extends PureComponent { const { plugin, nav } = this.state; if (!plugin) { - return
Plugin not found.
; + return ; } const active = nav.main.children.find(tab => tab.active); @@ -297,7 +298,21 @@ class PluginPage extends PureComponent { {!loading && (
-
{this.renderBody()}
+
+ {plugin.loadError && ( + + Check the server startup logs for more information.
+ If this plugin was loaded from git, make sure it was compiled. + + } + /> + )} + {this.renderBody()} +