Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
119e94f7
Commit
119e94f7
authored
Nov 12, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: panel plugin not found
parent
7a30220d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
6 deletions
+40
-6
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
+19
-2
public/app/features/dashboard/dashgrid/EditorTabBody.tsx
+1
-1
public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx
+16
-0
public/app/types/index.ts
+2
-1
public/app/types/plugins.ts
+2
-2
No files found.
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
View file @
119e94f7
...
@@ -5,13 +5,14 @@ import { getAngularLoader, AngularComponent } from 'app/core/services/AngularLoa
...
@@ -5,13 +5,14 @@ import { getAngularLoader, AngularComponent } from 'app/core/services/AngularLoa
import
{
importPluginModule
}
from
'app/features/plugins/plugin_loader'
;
import
{
importPluginModule
}
from
'app/features/plugins/plugin_loader'
;
import
{
AddPanelPanel
}
from
'./AddPanelPanel'
;
import
{
AddPanelPanel
}
from
'./AddPanelPanel'
;
import
{
PanelPluginNotFound
}
from
'./PanelPluginNotFound'
;
import
{
DashboardRow
}
from
'./DashboardRow'
;
import
{
DashboardRow
}
from
'./DashboardRow'
;
import
{
PanelPlugin
}
from
'app/types/plugins'
;
import
{
PanelChrome
}
from
'./PanelChrome'
;
import
{
PanelChrome
}
from
'./PanelChrome'
;
import
{
PanelEditor
}
from
'./PanelEditor'
;
import
{
PanelEditor
}
from
'./PanelEditor'
;
import
{
PanelModel
}
from
'../panel_model'
;
import
{
PanelModel
}
from
'../panel_model'
;
import
{
DashboardModel
}
from
'../dashboard_model'
;
import
{
DashboardModel
}
from
'../dashboard_model'
;
import
{
PanelPlugin
,
PanelProps
}
from
'app/types'
;
export
interface
Props
{
export
interface
Props
{
panel
:
PanelModel
;
panel
:
PanelModel
;
...
@@ -70,7 +71,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
...
@@ -70,7 +71,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
// handle plugin loading & changing of plugin type
// handle plugin loading & changing of plugin type
if
(
!
this
.
state
.
plugin
||
this
.
state
.
plugin
.
id
!==
panel
.
type
)
{
if
(
!
this
.
state
.
plugin
||
this
.
state
.
plugin
.
id
!==
panel
.
type
)
{
const
plugin
=
config
.
panels
[
panel
.
type
];
const
plugin
=
config
.
panels
[
panel
.
type
]
||
this
.
getPanelPluginNotFound
(
panel
.
type
)
;
if
(
plugin
.
exports
)
{
if
(
plugin
.
exports
)
{
this
.
cleanUpAngularPanel
();
this
.
cleanUpAngularPanel
();
...
@@ -87,6 +88,22 @@ export class DashboardPanel extends PureComponent<Props, State> {
...
@@ -87,6 +88,22 @@ export class DashboardPanel extends PureComponent<Props, State> {
}
}
}
}
getPanelPluginNotFound
(
id
:
string
):
PanelPlugin
{
const
NotFound
=
class
NotFound
extends
PureComponent
<
PanelProps
>
{
render
()
{
return
<
PanelPluginNotFound
pluginId=
{
id
}
/>;
}
};
return
{
id
:
id
,
name
:
id
,
exports
:
{
PanelComponent
:
NotFound
,
},
};
}
componentDidMount
()
{
componentDidMount
()
{
this
.
loadPlugin
();
this
.
loadPlugin
();
}
}
...
...
public/app/features/dashboard/dashgrid/EditorTabBody.tsx
View file @
119e94f7
...
@@ -81,7 +81,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
...
@@ -81,7 +81,7 @@ export class EditorTabBody extends PureComponent<Props, State> {
{
toolbarItems
.
map
(
item
=>
this
.
renderButton
(
item
))
}
{
toolbarItems
.
map
(
item
=>
this
.
renderButton
(
item
))
}
</
div
>
</
div
>
<
div
className=
"panel-editor__scroll"
>
<
div
className=
"panel-editor__scroll"
>
<
CustomScrollbar
>
<
CustomScrollbar
autoHide=
{
false
}
>
<
div
className=
"panel-editor__content"
>
<
div
className=
"panel-editor__content"
>
<
FadeIn
in=
{
openView
!==
null
}
duration=
{
200
}
>
<
FadeIn
in=
{
openView
!==
null
}
duration=
{
200
}
>
{
openView
&&
this
.
renderOpenView
(
openView
)
}
{
openView
&&
this
.
renderOpenView
(
openView
)
}
...
...
public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx
0 → 100644
View file @
119e94f7
import
_
from
'lodash'
;
import
React
,
{
PureComponent
}
from
'react'
;
interface
Props
{
pluginId
:
string
;
}
export
class
PanelPluginNotFound
extends
PureComponent
<
Props
>
{
constructor
(
props
)
{
super
(
props
);
}
render
()
{
return
<
h2
>
Panel plugin with id
{
this
.
props
.
id
}
could not be found
</
h2
>;
}
}
public/app/types/index.ts
View file @
119e94f7
...
@@ -21,7 +21,7 @@ import {
...
@@ -21,7 +21,7 @@ import {
DataQueryOptions
,
DataQueryOptions
,
}
from
'./series'
;
}
from
'./series'
;
import
{
PanelProps
,
PanelOptionsProps
}
from
'./panel'
;
import
{
PanelProps
,
PanelOptionsProps
}
from
'./panel'
;
import
{
PluginDashboard
,
PluginMeta
,
Plugin
,
PluginsState
}
from
'./plugins'
;
import
{
PluginDashboard
,
PluginMeta
,
Plugin
,
P
anelPlugin
,
P
luginsState
}
from
'./plugins'
;
import
{
Organization
,
OrganizationPreferences
,
OrganizationState
}
from
'./organization'
;
import
{
Organization
,
OrganizationPreferences
,
OrganizationState
}
from
'./organization'
;
import
{
import
{
AppNotification
,
AppNotification
,
...
@@ -69,6 +69,7 @@ export {
...
@@ -69,6 +69,7 @@ export {
UsersState
,
UsersState
,
TimeRange
,
TimeRange
,
LoadingState
,
LoadingState
,
PanelPlugin
,
PanelProps
,
PanelProps
,
PanelOptionsProps
,
PanelOptionsProps
,
TimeSeries
,
TimeSeries
,
...
...
public/app/types/plugins.ts
View file @
119e94f7
...
@@ -12,13 +12,13 @@ export interface PluginExports {
...
@@ -12,13 +12,13 @@ export interface PluginExports {
// Panel plugin
// Panel plugin
PanelCtrl
?;
PanelCtrl
?;
PanelComponent
?:
ComponentClass
<
PanelProps
>
;
PanelComponent
?:
ComponentClass
<
PanelProps
>
;
PanelOptionsComponent
:
ComponentClass
<
PanelOptionsProps
>
;
PanelOptionsComponent
?
:
ComponentClass
<
PanelOptionsProps
>
;
}
}
export
interface
PanelPlugin
{
export
interface
PanelPlugin
{
id
:
string
;
id
:
string
;
name
:
string
;
name
:
string
;
meta
:
any
;
meta
:
PluginMeta
;
hideFromList
:
boolean
;
hideFromList
:
boolean
;
module
:
string
;
module
:
string
;
baseUrl
:
string
;
baseUrl
:
string
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment