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
73af4df9
Commit
73af4df9
authored
Jan 25, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(panels): upgraded text panel
parent
11e35f7b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
public/app/features/panel/panel_ctrl.ts
+13
-2
public/app/plugins/panel/text/module.ts
+6
-11
No files found.
public/app/features/panel/panel_ctrl.ts
View file @
73af4df9
...
...
@@ -25,6 +25,12 @@ export class PanelCtrl {
this
.
icon
=
plugin
.
info
.
icon
;
this
.
editorTabIndex
=
0
;
this
.
publishAppEvent
(
'panel-instantiated'
,
{
scope
:
$scope
});
$scope
.
$on
(
"refresh"
,
()
=>
this
.
refresh
());
}
refresh
()
{
return
;
}
publishAppEvent
(
evtName
,
evt
)
{
...
...
@@ -43,6 +49,8 @@ export class PanelCtrl {
editPanel
()
{
if
(
!
this
.
editorTabs
)
{
this
.
editorTabs
=
[];
this
.
editorTabs
.
push
({
title
:
'General'
,
directiveFn
:
generalOptionsTabEditorTab
});
this
.
initEditorTabs
();
}
...
...
@@ -54,8 +62,11 @@ export class PanelCtrl {
}
initEditorTabs
()
{
this
.
editorTabs
=
[];
this
.
editorTabs
.
push
({
title
:
'General'
,
directiveFn
:
generalOptionsTabEditorTab
});
return
;
}
addEditorTab
(
title
,
directiveFn
)
{
this
.
editorTabs
.
push
({
title
:
title
,
directiveFn
:
directiveFn
});
}
getMenu
()
{
...
...
public/app/plugins/panel/text/module.ts
View file @
73af4df9
...
...
@@ -3,10 +3,6 @@
import
_
from
'lodash'
;
import
{
PanelDirective
,
PanelCtrl
}
from
'../../../features/panel/panel'
;
function
optionsEditorTab
()
{
return
{
templateUrl
:
'public/app/plugins/panel/text/editor.html'
};
}
// Set and populate defaults
var
panelDefaults
=
{
mode
:
"markdown"
,
// 'html', 'markdown', 'text'
...
...
@@ -26,8 +22,9 @@ export class TextPanelCtrl extends PanelCtrl {
}
initEditorTabs
()
{
super
.
initEditorTabs
();
this
.
editorTabs
.
push
({
title
:
'Options'
,
directiveFn
:
optionsEditorTab
});
this
.
addEditorTab
(
'Options'
,
()
=>
{
return
{
templateUrl
:
'public/app/plugins/panel/text/editor.html'
};
});
}
render
()
{
...
...
@@ -41,7 +38,7 @@ export class TextPanelCtrl extends PanelCtrl {
// this.panelRenderingComplete();
}
refresh
Data
()
{
refresh
()
{
this
.
render
();
}
...
...
@@ -65,8 +62,10 @@ export class TextPanelCtrl extends PanelCtrl {
}
else
{
System
.
import
(
'vendor/showdown'
).
then
(
Showdown
=>
{
this
.
converter
=
new
Showdown
.
converter
();
this
.
$scope
.
$apply
(()
=>
{
this
.
updateContent
(
this
.
converter
.
makeHtml
(
text
));
});
});
}
}
...
...
@@ -77,10 +76,6 @@ export class TextPanelCtrl extends PanelCtrl {
console
.
log
(
'Text panel error: '
,
e
);
this
.
content
=
this
.
$sce
.
trustAsHtml
(
html
);
}
if
(
!
this
.
$scope
.
$$phase
)
{
this
.
$scope
.
$digest
();
}
}
}
...
...
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