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
61513102
Commit
61513102
authored
Oct 31, 2018
by
Johannes Schill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: panel-header: Start implementing the Toggle legend, but its not taken all the way
parent
79da3dc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
+14
-2
public/app/features/dashboard/utils/panel.ts
+11
-0
No files found.
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderMenu.tsx
View file @
61513102
...
...
@@ -3,7 +3,14 @@ import { DashboardModel } from 'app/features/dashboard/dashboard_model';
import
{
PanelHeaderMenuItem
,
PanelHeaderMenuItemTypes
}
from
'./PanelHeaderMenuItem'
;
import
{
store
}
from
'app/store/configureStore'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
removePanel
,
duplicatePanel
,
copyPanel
,
editPanelJson
,
sharePanel
}
from
'app/features/dashboard/utils/panel'
;
import
{
removePanel
,
duplicatePanel
,
copyPanel
,
editPanelJson
,
sharePanel
,
toggleLegend
,
}
from
'app/features/dashboard/utils/panel'
;
export
interface
PanelHeaderMenuProps
{
panelId
:
number
;
...
...
@@ -73,6 +80,11 @@ export class PanelHeaderMenu extends PureComponent<PanelHeaderMenuProps, any> {
editPanelJson
(
dashboard
,
panel
);
};
onToggleLegend
=
()
=>
{
const
panel
=
this
.
getPanel
();
toggleLegend
(
panel
);
};
render
()
{
return
(
<
div
className=
"panel-menu-container dropdown"
>
...
...
@@ -122,7 +134,7 @@ export class PanelHeaderMenu extends PureComponent<PanelHeaderMenuProps, any> {
<
PanelHeaderMenuItem
type=
{
PanelHeaderMenuItemTypes
.
Link
}
text=
"Toggle legend"
handleClick=
{
()
=>
{}
}
handleClick=
{
this
.
onToggleLegend
}
shortcut=
"p l"
/>
</
ul
>
...
...
public/app/features/dashboard/utils/panel.ts
View file @
61513102
...
...
@@ -73,3 +73,14 @@ export const sharePanel = (dashboard: DashboardModel, panel: PanelModel) => {
},
});
};
export
const
refreshPanel
=
(
panel
:
PanelModel
)
=>
{
panel
.
refresh
();
};
export
const
toggleLegend
=
(
panel
:
PanelModel
)
=>
{
console
.
log
(
'Toggle legend is not implemented yet'
);
// We need to set panel.legend defaults first
// panel.legend.show = !panel.legend.show;
refreshPanel
(
panel
);
};
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