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
2953d644
Commit
2953d644
authored
Sep 08, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prometheus: minor update to focus editor PR, #9201
parent
4b851de6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
public/app/core/components/code_editor/code_editor.ts
+4
-3
public/app/features/panel/query_ctrl.ts
+2
-0
public/app/plugins/datasource/prometheus/partials/query.editor.html
+1
-1
public/sass/components/_code_editor.scss
+4
-0
No files found.
public/app/core/components/code_editor/code_editor.ts
View file @
2953d644
...
...
@@ -110,7 +110,8 @@ function link(scope, elem, attrs) {
elem
.
addClass
(
"gf-code-editor"
);
let
textarea
=
elem
.
find
(
"textarea"
);
textarea
.
addClass
(
'gf-form-input'
);
if
(
scope
.
focus
)
{
if
(
scope
.
codeEditorFocus
)
{
setTimeout
(
function
()
{
textarea
.
focus
();
var
domEl
=
textarea
[
0
];
...
...
@@ -118,7 +119,7 @@ function link(scope, elem, attrs) {
var
pos
=
textarea
.
val
().
length
*
2
;
domEl
.
setSelectionRange
(
pos
,
pos
);
}
},
2
00
);
},
1
00
);
}
// Event handlers
...
...
@@ -209,7 +210,7 @@ export function codeEditorDirective() {
template
:
editorTemplate
,
scope
:
{
content
:
"="
,
focus
:
"=
"
,
codeEditorFocus
:
"<
"
,
onChange
:
"&"
,
getCompleter
:
"&"
},
...
...
public/app/features/panel/query_ctrl.ts
View file @
2953d644
...
...
@@ -10,9 +10,11 @@ export class QueryCtrl {
panel
:
any
;
hasRawMode
:
boolean
;
error
:
string
;
isLastQuery
:
boolean
;
constructor
(
public
$scope
,
private
$injector
)
{
this
.
panel
=
this
.
panelCtrl
.
panel
;
this
.
isLastQuery
=
_
.
indexOf
(
this
.
panel
.
targets
,
this
.
target
)
===
(
this
.
panel
.
targets
.
length
-
1
);
}
refresh
()
{
...
...
public/app/plugins/datasource/prometheus/partials/query.editor.html
View file @
2953d644
...
...
@@ -2,7 +2,7 @@
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form gf-form--grow"
>
<code-editor
content=
"ctrl.target.expr"
on-change=
"ctrl.refreshMetricData()"
get-completer=
"ctrl.getCompleter()"
data-mode=
"prometheus"
focus=
"ctrl.target.refId == 'A'
"
>
get-completer=
"ctrl.getCompleter()"
data-mode=
"prometheus"
code-editor-focus=
"ctrl.isLastQuery
"
>
</code-editor>
</div>
</div>
...
...
public/sass/components/_code_editor.scss
View file @
2953d644
...
...
@@ -77,3 +77,7 @@ $doc-font-size: $font-size-sm;
.ace_tooltip
{
border-radius
:
3px
;
}
.ace_hidden-cursors
.ace_cursor
{
opacity
:
0
!
important
;
}
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