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
443d381d
Commit
443d381d
authored
Oct 31, 2018
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: panel-header: Add possibility to add custom actions to the menu by passing them in as props
parent
f124b9de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
public/app/features/dashboard/utils/panel_menu.ts
+13
-1
No files found.
public/app/features/dashboard/utils/panel_menu.ts
View file @
443d381d
...
...
@@ -5,7 +5,12 @@ import { PanelModel } from 'app/features/dashboard/panel_model';
import
{
DashboardModel
}
from
'app/features/dashboard/dashboard_model'
;
import
{
removePanel
,
duplicatePanel
,
copyPanel
,
editPanelJson
,
sharePanel
}
from
'app/features/dashboard/utils/panel'
;
export
const
getPanelMenu
=
(
dashboard
:
DashboardModel
,
panel
:
PanelModel
)
=>
{
export
const
getPanelMenu
=
(
dashboard
:
DashboardModel
,
panel
:
PanelModel
,
extraMenuItems
:
PanelHeaderMenuItemProps
[]
=
[],
extraSubMenuItems
:
PanelHeaderMenuItemProps
[]
=
[]
)
=>
{
const
onViewPanel
=
()
=>
{
store
.
dispatch
(
updateLocation
({
...
...
@@ -77,6 +82,9 @@ export const getPanelMenu = (dashboard: DashboardModel, panel: PanelModel) => {
// TODO: Handle this somehow
// this.events.emit('init-panel-actions', menu);
extraSubMenuItems
.
forEach
(
item
=>
{
menu
.
push
(
item
);
});
return
menu
;
};
...
...
@@ -109,6 +117,10 @@ export const getPanelMenu = (dashboard: DashboardModel, panel: PanelModel) => {
shortcut
:
'p s'
,
});
extraMenuItems
.
forEach
(
item
=>
{
menu
.
push
(
item
);
});
const
subMenu
:
PanelHeaderMenuItemProps
[]
=
getSubMenu
();
menu
.
push
({
...
...
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