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
2ff4b867
Commit
2ff4b867
authored
Oct 16, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: add panel progress
parent
772ab781
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
+21
-11
public/sass/components/_panel_add_panel.scss
+1
-1
No files found.
public/app/features/dashboard/dashgrid/AddPanelPanel.tsx
View file @
2ff4b867
import
React
from
'react'
;
import
_
from
'lodash'
;
import
config
from
'app/core/config'
;
import
{
PanelModel
}
from
'../panel_model'
;
import
{
PanelContainer
}
from
'./PanelContainer'
;
import
_
from
'lodash
'
;
import
{
GRID_COLUMN_COUNT
}
from
'app/core/constants
'
;
export
interface
AddPanelPanelProps
{
panel
:
PanelModel
;
...
...
@@ -27,30 +29,38 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
}
getPanelPlugins
()
{
return
_
.
chain
(
config
.
panels
)
let
panels
=
_
.
chain
(
config
.
panels
)
.
filter
({
hideFromList
:
false
})
.
map
(
item
=>
item
)
.
orderBy
(
'sort'
)
.
value
();
// add special row type
panels
.
push
({
id
:
'row'
,
name
:
'Row'
,
sort
:
8
,
info
:
{
logos
:
{
small
:
'public/img/icn-panel.svg'
}}});
// add sort by sort property
return
_
.
sortBy
(
panels
,
'sort'
);
}
onPanelSelected
(
panelPluginInfo
)
{
const
panelContainer
=
this
.
props
.
getPanelContainer
();
const
dashboard
=
panelContainer
.
getDashboard
();
const
{
gridPos
}
=
this
.
props
.
panel
;
// remove add-panel panel
dashboard
.
removePanel
(
this
.
props
.
panel
);
dashboard
.
addPanel
(
{
var
newPanel
:
any
=
{
type
:
panelPluginInfo
.
id
,
title
:
'Panel Title'
,
gridPos
:
{
x
:
this
.
props
.
panel
.
gridPos
.
x
,
y
:
this
.
props
.
panel
.
gridPos
.
y
,
w
:
this
.
props
.
panel
.
gridPos
.
w
,
h
:
this
.
props
.
panel
.
gridPos
.
h
}
});
gridPos
:
{
x
:
gridPos
.
x
,
y
:
gridPos
.
y
,
w
:
gridPos
.
w
,
h
:
gridPos
.
h
}
};
if
(
panelPluginInfo
.
id
===
'row'
)
{
newPanel
.
title
=
'Row title'
;
newPanel
.
gridPos
=
{
x
:
0
,
y
:
0
,
w
:
GRID_COLUMN_COUNT
,
h
:
1
,
static
:
true
};
}
dashboard
.
addPanel
(
newPanel
);
}
renderPanelItem
(
panel
)
{
...
...
public/sass/components/_panel_add_panel.scss
View file @
2ff4b867
...
...
@@ -3,7 +3,7 @@
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
overflow
:
hidden
;
overflow
:
auto
;
height
:
100%
;
align-content
:
flex-start
;
justify-content
:
space-around
;
...
...
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