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
7b805bdb
Commit
7b805bdb
authored
Nov 13, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor react panels refafactor
parent
e331d24a
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
24 additions
and
18 deletions
+24
-18
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
+2
-2
public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx
+3
-3
public/app/features/dashboard/dashgrid/VisualizationTab.tsx
+3
-3
public/app/plugins/panel/gauge/GaugeOptions.tsx
+1
-1
public/app/plugins/panel/gauge/module.tsx
+2
-1
public/app/plugins/panel/graph2/img/icn-graph-panel.svg
+0
-0
public/app/plugins/panel/graph2/module.tsx
+1
-1
public/app/plugins/panel/graph2/plugin.json
+2
-2
public/app/plugins/panel/text2/img/icn-text-panel.svg
+0
-0
public/app/plugins/panel/text2/module.tsx
+1
-1
public/app/plugins/panel/text2/plugin.json
+2
-2
public/app/types/panel.ts
+5
-0
public/app/types/plugins.ts
+2
-2
No files found.
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
View file @
7b805bdb
...
@@ -128,7 +128,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
...
@@ -128,7 +128,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
return
(
return
(
<
div
className=
{
containerClass
}
>
<
div
className=
{
containerClass
}
>
<
div
className=
{
panelWrapperClass
}
>
<
div
className=
{
panelWrapperClass
}
>
<
PanelChrome
component=
{
plugin
.
exports
.
Panel
Component
}
panel=
{
panel
}
dashboard=
{
dashboard
}
/>
<
PanelChrome
component=
{
plugin
.
exports
.
Panel
}
panel=
{
panel
}
dashboard=
{
dashboard
}
/>
</
div
>
</
div
>
{
panel
.
isEditing
&&
(
{
panel
.
isEditing
&&
(
<
PanelEditor
panel=
{
panel
}
plugin=
{
plugin
}
dashboard=
{
dashboard
}
onTypeChanged=
{
this
.
onPluginTypeChanged
}
/>
<
PanelEditor
panel=
{
panel
}
plugin=
{
plugin
}
dashboard=
{
dashboard
}
onTypeChanged=
{
this
.
onPluginTypeChanged
}
/>
...
@@ -151,7 +151,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
...
@@ -151,7 +151,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
}
}
// if exporting PanelComponent it must be a react panel
// if exporting PanelComponent it must be a react panel
if
(
plugin
.
exports
.
Panel
Component
)
{
if
(
plugin
.
exports
.
Panel
)
{
return
this
.
renderReactPanel
();
return
this
.
renderReactPanel
();
}
}
...
...
public/app/features/dashboard/dashgrid/PanelPluginNotFound.tsx
View file @
7b805bdb
...
@@ -14,8 +14,8 @@ class PanelPluginNotFound extends PureComponent<Props> {
...
@@ -14,8 +14,8 @@ class PanelPluginNotFound extends PureComponent<Props> {
render
()
{
render
()
{
const
style
=
{
const
style
=
{
display
:
'flex'
,
display
:
'flex'
,
'align-items'
:
'center'
,
alignItems
:
'center'
,
'text-align'
:
'center'
,
textAlign
:
'center'
as
'center'
,
height
:
'100%'
,
height
:
'100%'
,
};
};
...
@@ -58,7 +58,7 @@ export function getPanelPluginNotFound(id: string): PanelPlugin {
...
@@ -58,7 +58,7 @@ export function getPanelPluginNotFound(id: string): PanelPlugin {
},
},
exports
:
{
exports
:
{
Panel
Component
:
NotFound
,
Panel
:
NotFound
,
},
},
};
};
}
}
public/app/features/dashboard/dashgrid/VisualizationTab.tsx
View file @
7b805bdb
...
@@ -21,10 +21,10 @@ export class VisualizationTab extends PureComponent<Props> {
...
@@ -21,10 +21,10 @@ export class VisualizationTab extends PureComponent<Props> {
renderPanelOptions
()
{
renderPanelOptions
()
{
const
{
plugin
,
panel
}
=
this
.
props
;
const
{
plugin
,
panel
}
=
this
.
props
;
const
{
PanelOptions
Component
}
=
plugin
.
exports
;
const
{
PanelOptions
}
=
plugin
.
exports
;
if
(
PanelOptions
Component
)
{
if
(
PanelOptions
)
{
return
<
PanelOptions
Component
options=
{
panel
.
getOptions
()
}
onChange=
{
this
.
onPanelOptionsChanged
}
/>;
return
<
PanelOptions
options=
{
panel
.
getOptions
()
}
onChange=
{
this
.
onPanelOptionsChanged
}
/>;
}
else
{
}
else
{
return
<
p
>
Visualization has no options
</
p
>;
return
<
p
>
Visualization has no options
</
p
>;
}
}
...
...
public/app/
viz
/GaugeOptions.tsx
→
public/app/
plugins/panel/gauge
/GaugeOptions.tsx
View file @
7b805bdb
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
PanelOptionsProps
}
from
'
..
/types'
;
import
{
PanelOptionsProps
}
from
'
app
/types'
;
interface
Props
{}
interface
Props
{}
...
...
public/app/plugins/panel/gauge/module.tsx
View file @
7b805bdb
...
@@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
import
Gauge
from
'app/viz/Gauge'
;
import
Gauge
from
'app/viz/Gauge'
;
import
{
NullValueMode
,
PanelProps
}
from
'app/types'
;
import
{
NullValueMode
,
PanelProps
}
from
'app/types'
;
import
{
getTimeSeriesVMs
}
from
'app/viz/state/timeSeries'
;
import
{
getTimeSeriesVMs
}
from
'app/viz/state/timeSeries'
;
import
{
GaugeOptions
}
from
'./GaugeOptions'
;
export
interface
Options
{}
export
interface
Options
{}
...
@@ -20,4 +21,4 @@ export class GaugePanel extends PureComponent<Props> {
...
@@ -20,4 +21,4 @@ export class GaugePanel extends PureComponent<Props> {
}
}
}
}
export
{
GaugePanel
as
Panel
Component
};
export
{
GaugePanel
as
Panel
,
GaugeOptions
as
PanelOptions
};
public/app/plugins/panel/
text
2/img/icn-graph-panel.svg
→
public/app/plugins/panel/
graph
2/img/icn-graph-panel.svg
View file @
7b805bdb
File moved
public/app/plugins/panel/graph2/module.tsx
View file @
7b805bdb
...
@@ -87,4 +87,4 @@ export class GraphOptions extends PureComponent<PanelOptionsProps<Options>> {
...
@@ -87,4 +87,4 @@ export class GraphOptions extends PureComponent<PanelOptionsProps<Options>> {
}
}
}
}
export
{
Graph2
as
Panel
Component
,
GraphOptions
as
PanelOptionsComponent
};
export
{
Graph2
as
Panel
,
GraphOptions
as
PanelOptions
};
public/app/plugins/panel/graph2/plugin.json
View file @
7b805bdb
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
"url"
:
"https://grafana.com"
"url"
:
"https://grafana.com"
},
},
"logos"
:
{
"logos"
:
{
"small"
:
"img/icn-
text
-panel.svg"
,
"small"
:
"img/icn-
graph
-panel.svg"
,
"large"
:
"img/icn-
text
-panel.svg"
"large"
:
"img/icn-
graph
-panel.svg"
}
}
}
}
}
}
...
...
public/app/plugins/panel/
graph
2/img/icn-text-panel.svg
→
public/app/plugins/panel/
text
2/img/icn-text-panel.svg
View file @
7b805bdb
File moved
public/app/plugins/panel/text2/module.tsx
View file @
7b805bdb
...
@@ -11,4 +11,4 @@ export class Text2 extends PureComponent<PanelProps> {
...
@@ -11,4 +11,4 @@ export class Text2 extends PureComponent<PanelProps> {
}
}
}
}
export
{
Text2
as
Panel
Component
};
export
{
Text2
as
Panel
};
public/app/plugins/panel/text2/plugin.json
View file @
7b805bdb
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
"url"
:
"https://grafana.com"
"url"
:
"https://grafana.com"
},
},
"logos"
:
{
"logos"
:
{
"small"
:
"img/icn-
graph
-panel.svg"
,
"small"
:
"img/icn-
text
-panel.svg"
,
"large"
:
"img/icn-
graph
-panel.svg"
"large"
:
"img/icn-
text
-panel.svg"
}
}
}
}
}
}
...
...
public/app/types/panel.ts
View file @
7b805bdb
...
@@ -13,6 +13,11 @@ export interface PanelOptionsProps<T = any> {
...
@@ -13,6 +13,11 @@ export interface PanelOptionsProps<T = any> {
onChange
:
(
options
:
T
)
=>
void
;
onChange
:
(
options
:
T
)
=>
void
;
}
}
export
interface
PanelSize
{
width
:
number
;
height
:
number
;
}
export
interface
PanelMenuItem
{
export
interface
PanelMenuItem
{
type
?:
'submenu'
|
'divider'
;
type
?:
'submenu'
|
'divider'
;
text
?:
string
;
text
?:
string
;
...
...
public/app/types/plugins.ts
View file @
7b805bdb
...
@@ -11,8 +11,8 @@ export interface PluginExports {
...
@@ -11,8 +11,8 @@ export interface PluginExports {
// Panel plugin
// Panel plugin
PanelCtrl
?;
PanelCtrl
?;
Panel
Component
?:
ComponentClass
<
PanelProps
>
;
Panel
?:
ComponentClass
<
PanelProps
>
;
PanelOptions
Component
?:
ComponentClass
<
PanelOptionsProps
>
;
PanelOptions
?:
ComponentClass
<
PanelOptionsProps
>
;
}
}
export
interface
PanelPlugin
{
export
interface
PanelPlugin
{
...
...
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