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
a950ff97
Commit
a950ff97
authored
Jan 24, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(panel): more panel base infrastructure
parent
4132cf12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
public/app/features/panel/panel.ts
+12
-3
public/app/plugins/panel/test/module.ts
+12
-7
No files found.
public/app/features/panel/panel.ts
View file @
a950ff97
...
...
@@ -14,18 +14,20 @@ export class PanelCtrl {
name
:
string
;
icon
:
string
;
editorTabs
:
any
;
$scope
:
any
;
constructor
(
private
scope
)
{
constructor
(
$
scope
)
{
var
plugin
=
config
.
panels
[
this
.
panel
.
type
];
this
.
$scope
=
$scope
;
this
.
name
=
plugin
.
name
;
this
.
icon
=
plugin
.
info
.
icon
;
this
.
editorTabIndex
=
0
;
this
.
publishAppEvent
(
'panel-instantiated'
,
{
scope
:
scope
});
this
.
publishAppEvent
(
'panel-instantiated'
,
{
scope
:
$
scope
});
}
publishAppEvent
(
evtName
,
evt
)
{
this
.
scope
.
$root
.
appEvent
(
evtName
,
evt
);
this
.
$
scope
.
$root
.
appEvent
(
evtName
,
evt
);
}
changeView
(
fullscreen
,
edit
)
{
...
...
@@ -53,8 +55,11 @@ export class PanelCtrl {
initEditorTabs
()
{
this
.
editorTabs
=
[];
this
.
editorTabs
.
push
({
title
:
'General'
,
directiveFn
:
generalOptionsTabEditorTab
});
this
.
editorTabs
=
this
.
editorTabs
.
concat
(
this
.
getEditorTabs
());
}
getEditorTabs
()
{
return
[];}
getMenu
()
{
let
menu
=
[];
menu
.
push
({
text
:
'View'
,
click
:
'ctrl.viewPanel(); dismiss();'
});
...
...
@@ -74,6 +79,10 @@ export class PanelDirective {
controllerAs
:
string
;
getDirective
()
{
if
(
!
this
.
controller
)
{
this
.
controller
=
PanelCtrl
;
}
return
{
template
:
this
.
template
,
templateUrl
:
this
.
templateUrl
,
...
...
public/app/plugins/panel/test/module.ts
View file @
a950ff97
...
...
@@ -2,20 +2,25 @@
import
{
PanelDirective
,
PanelCtrl
}
from
'../../../features/panel/panel'
;
class
TestPanelCtrl
extends
PanelCtrl
{
function
optionsTab
()
{
return
{
template
:
'<h2>options!</h2>'
};
}
export
class
TestPanelCtrl
extends
PanelCtrl
{
constructor
(
$scope
)
{
super
(
$scope
);
}
}
getEditorTabs
()
{
return
[{
title
:
'Options'
,
directiveFn
:
optionsTab
}];
}
}
class
TestPanel
extends
PanelDirective
{
templateUrl
=
`app/plugins/panel/test/module.html`
;
controller
=
TestPanelCtrl
;
}
export
{
TestPanelCtrl
,
// testPanelDirective as panel,
TestPanel
as
Panel
,
}
export
{
TestPanel
as
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