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
7dbe719f
Unverified
Commit
7dbe719f
authored
Apr 29, 2019
by
Ryan McKinley
Committed by
GitHub
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plugins: rename vizPlugin to panelPlugin (#16802)
parent
c5097e2e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
14 deletions
+14
-14
packages/grafana-ui/src/types/panel.ts
+1
-1
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
+2
-2
public/app/features/dashboard/dashgrid/PanelChrome.tsx
+2
-2
public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx
+1
-1
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
+3
-3
public/app/features/dashboard/state/PanelModel.test.ts
+1
-1
public/app/features/dashboard/state/PanelModel.ts
+3
-3
public/app/features/plugins/__mocks__/pluginMocks.ts
+1
-1
No files found.
packages/grafana-ui/src/types/panel.ts
View file @
7dbe719f
...
...
@@ -10,7 +10,7 @@ export interface PanelPluginMeta extends PluginMeta {
hideFromList
?:
boolean
;
sort
:
number
;
angularPlugin
:
AngularPanelPlugin
|
null
;
viz
Plugin
:
PanelPlugin
|
null
;
panel
Plugin
:
PanelPlugin
|
null
;
hasBeenImported
?:
boolean
;
// if length>0 the query tab will show up
...
...
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
View file @
7dbe719f
...
...
@@ -101,7 +101,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
if
(
importedPlugin
instanceof
AngularPanelPlugin
)
{
plugin
.
angularPlugin
=
importedPlugin
as
AngularPanelPlugin
;
}
else
if
(
importedPlugin
instanceof
PanelPlugin
)
{
plugin
.
viz
Plugin
=
importedPlugin
as
PanelPlugin
;
plugin
.
panel
Plugin
=
importedPlugin
as
PanelPlugin
;
}
}
catch
(
e
)
{
plugin
=
getPanelPluginNotFound
(
plugin
.
id
);
...
...
@@ -209,7 +209,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
onMouseLeave=
{
this
.
onMouseLeave
}
style=
{
styles
}
>
{
plugin
.
viz
Plugin
&&
this
.
renderReactPanel
()
}
{
plugin
.
panel
Plugin
&&
this
.
renderReactPanel
()
}
{
plugin
.
angularPlugin
&&
this
.
renderAngularPanel
()
}
</
div
>
)
}
...
...
public/app/features/dashboard/dashgrid/PanelChrome.tsx
View file @
7dbe719f
...
...
@@ -215,7 +215,7 @@ export class PanelChrome extends PureComponent<Props, State> {
renderPanel
(
width
:
number
,
height
:
number
):
JSX
.
Element
{
const
{
panel
,
plugin
}
=
this
.
props
;
const
{
renderCounter
,
data
,
isFirstLoad
}
=
this
.
state
;
const
PanelComponent
=
plugin
.
viz
Plugin
.
panel
;
const
PanelComponent
=
plugin
.
panel
Plugin
.
panel
;
// This is only done to increase a counter that is used by backend
// image rendering (phantomjs/headless chrome) to know when to capture image
...
...
@@ -236,7 +236,7 @@ export class PanelChrome extends PureComponent<Props, State> {
<
PanelComponent
data=
{
data
}
timeRange=
{
data
.
request
?
data
.
request
.
range
:
this
.
timeSrv
.
timeRange
()
}
options=
{
panel
.
getOptions
(
plugin
.
viz
Plugin
.
defaults
)
}
options=
{
panel
.
getOptions
(
plugin
.
panel
Plugin
.
defaults
)
}
width=
{
width
-
2
*
config
.
theme
.
panelPadding
.
horizontal
}
height=
{
height
-
PANEL_HEADER_HEIGHT
-
config
.
theme
.
panelPadding
.
vertical
}
renderCounter=
{
renderCounter
}
...
...
public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx
View file @
7dbe719f
...
...
@@ -63,7 +63,7 @@ export function getPanelPluginNotFound(id: string): PanelPluginMeta {
updated
:
''
,
version
:
''
,
},
viz
Plugin
:
new
PanelPlugin
(
NotFound
),
panel
Plugin
:
new
PanelPlugin
(
NotFound
),
angularPlugin
:
null
,
};
}
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
View file @
7dbe719f
...
...
@@ -54,7 +54,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
getReactPanelOptions
=
()
=>
{
const
{
panel
,
plugin
}
=
this
.
props
;
return
panel
.
getOptions
(
plugin
.
viz
Plugin
.
defaults
);
return
panel
.
getOptions
(
plugin
.
panel
Plugin
.
defaults
);
};
renderPanelOptions
()
{
...
...
@@ -64,8 +64,8 @@ export class VisualizationTab extends PureComponent<Props, State> {
return
<
div
ref=
{
element
=>
(
this
.
element
=
element
)
}
/>;
}
if
(
plugin
.
viz
Plugin
)
{
const
PanelEditor
=
plugin
.
viz
Plugin
.
editor
;
if
(
plugin
.
panel
Plugin
)
{
const
PanelEditor
=
plugin
.
panel
Plugin
.
editor
;
if
(
PanelEditor
)
{
return
<
PanelEditor
options=
{
this
.
getReactPanelOptions
()
}
onOptionsChange=
{
this
.
onPanelOptionsChanged
}
/>;
...
...
public/app/features/dashboard/state/PanelModel.test.ts
View file @
7dbe719f
...
...
@@ -129,7 +129,7 @@ describe('PanelModel', () => {
model
.
changePlugin
(
getPanelPlugin
({
id
:
'react'
,
viz
Plugin
:
reactPlugin
,
panel
Plugin
:
reactPlugin
,
})
);
});
...
...
public/app/features/dashboard/state/PanelModel.ts
View file @
7dbe719f
...
...
@@ -255,10 +255,10 @@ export class PanelModel {
pluginLoaded
(
plugin
:
PanelPluginMeta
)
{
this
.
plugin
=
plugin
;
if
(
plugin
.
vizPlugin
&&
plugin
.
viz
Plugin
.
onPanelMigration
)
{
if
(
plugin
.
panelPlugin
&&
plugin
.
panel
Plugin
.
onPanelMigration
)
{
const
version
=
this
.
getPluginVersion
(
plugin
);
if
(
version
!==
this
.
pluginVersion
)
{
this
.
options
=
plugin
.
viz
Plugin
.
onPanelMigration
(
this
);
this
.
options
=
plugin
.
panel
Plugin
.
onPanelMigration
(
this
);
this
.
pluginVersion
=
version
;
}
}
...
...
@@ -291,7 +291,7 @@ export class PanelModel {
this
.
plugin
=
newPlugin
;
// Let panel plugins inspect options from previous panel and keep any that it can use
const
reactPanel
=
newPlugin
.
viz
Plugin
;
const
reactPanel
=
newPlugin
.
panel
Plugin
;
if
(
reactPanel
)
{
if
(
reactPanel
.
onPanelTypeChanged
)
{
...
...
public/app/features/plugins/__mocks__/pluginMocks.ts
View file @
7dbe719f
...
...
@@ -57,7 +57,7 @@ export const getPanelPlugin = (options: Partial<PanelPluginMeta>): PanelPluginMe
hideFromList
:
options
.
hideFromList
===
true
,
module
:
''
,
baseUrl
:
''
,
vizPlugin
:
options
.
viz
Plugin
,
panelPlugin
:
options
.
panel
Plugin
,
angularPlugin
:
options
.
angularPlugin
,
};
};
...
...
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