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
10f05803
Commit
10f05803
authored
Sep 13, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
parents
73248d66
b349b3ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
public/app/core/components/code_editor/code_editor.ts
+9
-4
public/app/plugins/datasource/prometheus/mode-prometheus.js
+0
-0
public/app/plugins/datasource/prometheus/partials/query.editor.html
+1
-1
public/app/plugins/datasource/prometheus/snippets/prometheus.js
+0
-0
No files found.
public/app/core/components/code_editor/code_editor.ts
View file @
10f05803
...
...
@@ -40,11 +40,11 @@ const DEFAULT_MAX_LINES = 10;
const
DEFAULT_TAB_SIZE
=
2
;
const
DEFAULT_BEHAVIOURS
=
true
;
const
GRAFANA_MODULES
=
[
'
mode-prometheus'
,
'snippets-prometheus'
,
'
theme-grafana-dark'
];
const
GRAFANA_MODULES
=
[
'theme-grafana-dark'
];
const
GRAFANA_MODULE_BASE
=
"public/app/core/components/code_editor/"
;
// Trick for loading additional modules
function
setModuleUrl
(
moduleType
,
name
)
{
function
setModuleUrl
(
moduleType
,
name
,
pluginBaseUrl
=
null
)
{
let
baseUrl
=
ACE_SRC_BASE
;
let
aceModeName
=
`ace/
${
moduleType
}
/
${
name
}
`
;
let
moduleName
=
`
${
moduleType
}
-
${
name
}
`
;
...
...
@@ -54,6 +54,10 @@ function setModuleUrl(moduleType, name) {
baseUrl
=
GRAFANA_MODULE_BASE
;
}
if
(
pluginBaseUrl
)
{
baseUrl
=
pluginBaseUrl
+
'/'
;
}
if
(
moduleType
===
'snippets'
)
{
componentName
=
`
${
moduleType
}
/
${
name
}
.js`
;
}
...
...
@@ -159,8 +163,8 @@ function link(scope, elem, attrs) {
function
setLangMode
(
lang
)
{
let
aceModeName
=
`ace/mode/
${
lang
}
`
;
setModuleUrl
(
"mode"
,
lang
);
setModuleUrl
(
"snippets"
,
lang
);
setModuleUrl
(
"mode"
,
lang
,
scope
.
datasource
.
meta
.
baseUrl
||
null
);
setModuleUrl
(
"snippets"
,
lang
,
scope
.
datasource
.
meta
.
baseUrl
||
null
);
editorSession
.
setMode
(
aceModeName
);
ace
.
config
.
loadModule
(
"ace/ext/language_tools"
,
(
language_tools
)
=>
{
...
...
@@ -210,6 +214,7 @@ export function codeEditorDirective() {
template
:
editorTemplate
,
scope
:
{
content
:
"="
,
datasource
:
"="
,
codeEditorFocus
:
"<"
,
onChange
:
"&"
,
getCompleter
:
"&"
...
...
public/app/
core/components/code_editor
/mode-prometheus.js
→
public/app/
plugins/datasource/prometheus
/mode-prometheus.js
View file @
10f05803
File moved
public/app/plugins/datasource/prometheus/partials/query.editor.html
View file @
10f05803
<query-editor-row
query-ctrl=
"ctrl"
can-collapse=
"true"
has-text-edit-mode=
"false"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form gf-form--grow"
>
<code-editor
content=
"ctrl.target.expr"
on-change=
"ctrl.refreshMetricData()"
<code-editor
content=
"ctrl.target.expr"
datasource=
"ctrl.datasource"
on-change=
"ctrl.refreshMetricData()"
get-completer=
"ctrl.getCompleter()"
data-mode=
"prometheus"
code-editor-focus=
"ctrl.isLastQuery"
>
</code-editor>
</div>
...
...
public/app/
core/components/code_editor
/snippets/prometheus.js
→
public/app/
plugins/datasource/prometheus
/snippets/prometheus.js
View file @
10f05803
File moved
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