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
e9645045
Commit
e9645045
authored
Oct 24, 2017
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ace editor for text panel
parent
e1765e36
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
public/app/core/components/code_editor/code_editor.ts
+2
-0
public/app/plugins/panel/text/editor.html
+6
-2
public/app/plugins/panel/text/module.ts
+8
-1
No files found.
public/app/core/components/code_editor/code_editor.ts
View file @
e9645045
...
...
@@ -36,6 +36,8 @@ import 'brace/mode/text';
import
'brace/snippets/text'
;
import
'brace/mode/sql'
;
import
'brace/snippets/sql'
;
import
'brace/mode/markdown'
;
import
'brace/snippets/markdown'
;
const
DEFAULT_THEME_DARK
=
"ace/theme/grafana-dark"
;
const
DEFAULT_THEME_LIGHT
=
"ace/theme/textmate"
;
...
...
public/app/plugins/panel/text/editor.html
View file @
e9645045
...
...
@@ -15,5 +15,9 @@
(This area uses
<a
target=
"_blank"
href=
"http://en.wikipedia.org/wiki/Markdown"
>
Markdown
</a>
. HTML is not supported)
</span>
<textarea
class=
"gf-form-input"
ng-model=
"ctrl.panel.content"
rows=
"20"
style=
"width:95%"
give-focus=
"true"
ng-change=
"ctrl.render()"
ng-model-onblur
>
</textarea>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form gf-form--grow"
>
<code-editor
content=
"ctrl.panel.content"
rows=
"20"
on-change=
"ctrl.render()"
data-mode=
"markdown"
code-editor-focus=
"true"
>
</code-editor>
</div>
</div>
public/app/plugins/panel/text/module.ts
View file @
e9645045
...
...
@@ -23,6 +23,11 @@ export class TextPanelCtrl extends PanelCtrl {
this
.
events
.
on
(
'init-edit-mode'
,
this
.
onInitEditMode
.
bind
(
this
));
this
.
events
.
on
(
'refresh'
,
this
.
onRefresh
.
bind
(
this
));
this
.
events
.
on
(
'render'
,
this
.
onRender
.
bind
(
this
));
$scope
.
$watch
(
'ctrl.panel.content'
,
_
.
throttle
(()
=>
{
this
.
render
();
},
1000
)
);
}
onInitEditMode
()
{
...
...
@@ -66,7 +71,9 @@ export class TextPanelCtrl extends PanelCtrl {
});
}
this
.
updateContent
(
this
.
remarkable
.
render
(
content
));
this
.
$scope
.
$applyAsync
(()
=>
{
this
.
updateContent
(
this
.
remarkable
.
render
(
content
));
});
}
updateContent
(
html
)
{
...
...
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