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
b9540e4c
Commit
b9540e4c
authored
Aug 09, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ace: minor ace theme tweaks
parent
459a8ed6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
8 deletions
+128
-8
public/app/core/components/code_editor/code_editor.ts
+7
-5
public/app/core/components/code_editor/mode-prometheus.js
+1
-1
public/app/core/components/code_editor/theme-grafana-dark.js
+116
-0
public/sass/components/_code_editor.scss
+0
-1
tasks/options/watch.js
+4
-1
No files found.
public/app/core/components/code_editor/code_editor.ts
View file @
b9540e4c
...
...
@@ -28,12 +28,12 @@ import coreModule from 'app/core/core_module';
import
ace
from
'ace'
;
const
ACE_SRC_BASE
=
"public/vendor/npm/ace-builds/src-noconflict/"
;
const
DEFAULT_THEME
=
"
solarized_
dark"
;
const
DEFAULT_THEME
=
"
grafana-
dark"
;
const
DEFAULT_MODE
=
"text"
;
const
DEFAULT_MAX_LINES
=
10
;
const
DEFAULT_TAB_SIZE
=
2
;
const
GRAFANA_MODULES
=
[
'mode-prometheus'
,
'snippets-prometheus'
];
const
GRAFANA_MODULES
=
[
'mode-prometheus'
,
'snippets-prometheus'
,
'theme-grafana-dark'
];
const
GRAFANA_MODULE_BASE
=
"public/app/core/components/code_editor/"
;
// Trick for loading additional modules
...
...
@@ -46,9 +46,11 @@ function fixModuleUrl(moduleType, name) {
if
(
_
.
includes
(
GRAFANA_MODULES
,
moduleName
))
{
baseUrl
=
GRAFANA_MODULE_BASE
;
}
if
(
moduleType
===
'snippets'
)
{
componentName
=
`
${
moduleType
}
/
${
name
}
.js`
;
}
ace
.
config
.
setModuleUrl
(
aceModeName
,
baseUrl
+
componentName
);
}
...
...
@@ -83,8 +85,9 @@ function link(scope, elem, attrs) {
// disable depreacation warning
codeEditor
.
$blockScrolling
=
Infinity
;
// Padding hacks
codeEditor
.
renderer
.
setScrollMargin
(
1
0
,
10
);
codeEditor
.
renderer
.
setScrollMargin
(
1
5
,
15
);
codeEditor
.
renderer
.
setPadding
(
10
);
setThemeMode
(
theme
);
setLangMode
(
langMode
);
setEditorContent
(
scope
.
content
);
...
...
@@ -158,8 +161,7 @@ function link(scope, elem, attrs) {
function
setThemeMode
(
theme
)
{
fixModuleUrl
(
"theme"
,
theme
);
let
aceThemeName
=
`ace/theme/
${
theme
}
`
;
codeEditor
.
setTheme
(
aceThemeName
);
codeEditor
.
setTheme
(
`ace/theme/
${
theme
}
`
);
}
function
setEditorContent
(
value
)
{
...
...
public/app/core/components/code_editor/mode-prometheus.js
View file @
b9540e4c
...
...
@@ -46,7 +46,7 @@ var PrometheusHighlightRules = function() {
regex
:
"[a-zA-Z_$][a-zA-Z0-9_$]*
\\
b"
},
{
token
:
"keyword.operator"
,
regex
:
"
\\
+|
\\
-|
\\
*|
\\
/|%|
\\
^|=|==|!=|<=|>=|<|>|=
~|!
~"
regex
:
"
\\
+|
\\
-|
\\
*|
\\
/|%|
\\
^|=|==|!=|<=|>=|<|>|=
\\
~|!
\\
~"
},
{
token
:
"paren.lparen"
,
regex
:
"[
\\
(]"
...
...
public/app/core/components/code_editor/theme-grafana-dark.js
0 → 100644
View file @
b9540e4c
/* jshint ignore:start */
ace
.
define
(
"ace/theme/grafana-dark"
,[
"require"
,
"exports"
,
"module"
,
"ace/lib/dom"
],
function
(
require
,
exports
,
module
)
{
"use strict"
;
exports
.
isDark
=
true
;
exports
.
cssClass
=
"gf-code-dark"
;
exports
.
cssText
=
".gf-code-dark .ace_gutter {
\
background: #2f3129;
\
color: #8f908a
\
}
\
.gf-code-dark .ace_print-margin {
\
width: 1px;
\
background: #555651
\
}
\
.gf-code-dark {
\
background-color: #111;
\
color: #e0e0e0
\
}
\
.gf-code-dark .ace_cursor {
\
color: #f8f8f0
\
}
\
.gf-code-dark .ace_marker-layer .ace_selection {
\
background: #49483e
\
}
\
.gf-code-dark.ace_multiselect .ace_selection.ace_start {
\
box-shadow: 0 0 3px 0px #272822;
\
}
\
.gf-code-dark .ace_marker-layer .ace_step {
\
background: rgb(102, 82, 0)
\
}
\
.gf-code-dark .ace_marker-layer .ace_bracket {
\
margin: -1px 0 0 -1px;
\
border: 1px solid #49483e
\
}
\
.gf-code-dark .ace_marker-layer .ace_active-line {
\
background: #202020
\
}
\
.gf-code-dark .ace_gutter-active-line {
\
background-color: #272727
\
}
\
.gf-code-dark .ace_marker-layer .ace_selected-word {
\
border: 1px solid #49483e
\
}
\
.gf-code-dark .ace_invisible {
\
color: #52524d
\
}
\
.gf-code-dark .ace_entity.ace_name.ace_tag,
\
.gf-code-dark .ace_keyword,
\
.gf-code-dark .ace_meta.ace_tag,
\
.gf-code-dark .ace_storage {
\
color: #fae400
\
}
\
.gf-code-dark .ace_punctuation,
\
.gf-code-dark .ace_punctuation.ace_tag {
\
color: #fff
\
}
\
.gf-code-dark .ace_constant.ace_character,
\
.gf-code-dark .ace_constant.ace_language,
\
.gf-code-dark .ace_constant.ace_numeric,
\
.gf-code-dark .ace_constant.ace_other {
\
color: #fe85fc
\
}
\
.gf-code-dark .ace_invalid {
\
color: #f8f8f0;
\
background-color: #f92672
\
}
\
.gf-code-dark .ace_invalid.ace_deprecated {
\
color: #f8f8f0;
\
background-color: #ae81ff
\
}
\
.gf-code-dark .ace_support.ace_constant,
\
.gf-code-dark .ace_support.ace_function {
\
color: #66d9ef
\
}
\
.gf-code-dark .ace_fold {
\
background-color: #a6e22e;
\
border-color: #f8f8f2
\
}
\
.gf-code-dark .ace_storage.ace_type,
\
.gf-code-dark .ace_support.ace_class,
\
.gf-code-dark .ace_support.ace_type {
\
font-style: italic;
\
color: #66d9ef
\
}
\
.gf-code-dark .ace_entity.ace_name.ace_function,
\
.gf-code-dark .ace_entity.ace_other,
\
.gf-code-dark .ace_entity.ace_other.ace_attribute-name,
\
.gf-code-dark .ace_variable {
\
color: #a6e22e
\
}
\
.gf-code-dark .ace_variable.ace_parameter {
\
font-style: italic;
\
color: #fd971f
\
}
\
.gf-code-dark .ace_string {
\
color: #74e680
\
}
\
.gf-code-dark .ace_paren {
\
color: #f0a842
\
}
\
.gf-code-dark .ace_operator {
\
color: #FFF
\
}
\
.gf-code-dark .ace_comment {
\
color: #75715e
\
}
\
.gf-code-dark .ace_indent-guide {
\
background: url(data:image/png;base64,ivborw0kggoaaaansuheugaaaaeaaaaccayaaaczgbynaaaaekleqvqimwpq0fd0zxbzd/wpaajvaoxesgneaaaaaelftksuqmcc) right repeat-y
\
}"
;
var
dom
=
require
(
"../lib/dom"
);
dom
.
importCssString
(
exports
.
cssText
,
exports
.
cssClass
);
});
/* jshint ignore:end */
public/sass/components/_code_editor.scss
View file @
b9540e4c
...
...
@@ -3,7 +3,6 @@
min-width
:
20rem
;
flex-grow
:
1
;
margin-right
:
0
.25rem
;
border
:
1px
solid
#333333
;
&
.ace_editor
{
min-height
:
2
.60rem
;
...
...
tasks/options/watch.js
View file @
b9540e4c
...
...
@@ -21,7 +21,10 @@ module.exports = function(config, grunt) {
return
;
}
gaze
(
config
.
srcDir
+
'/**/*'
,
function
(
err
,
watcher
)
{
gaze
([
config
.
srcDir
+
'/app/**/*'
,
config
.
srcDir
+
'/sass/**/*'
,
],
function
(
err
,
watcher
)
{
console
.
log
(
'Gaze watchers setup'
);
...
...
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