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
f98f4d50
Commit
f98f4d50
authored
Oct 17, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added color stepping functions
parent
d9a2b28b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
9 deletions
+45
-9
.jshintrc
+3
-1
src/app/app.js
+0
-1
src/app/components/kbn.js
+17
-1
src/app/components/require.config.js
+1
-1
src/app/directives/esVersion.js
+0
-1
src/app/panels/table/module.html
+1
-0
src/app/services/dashboard.js
+1
-0
src/app/services/querySrv.js
+22
-4
No files found.
.jshintrc
View file @
f98f4d50
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
"globals": {
"globals": {
"define": true,
"define": true,
"require": true
"require": true,
"Chromath": false
}
}
}
}
\ No newline at end of file
src/app/app.js
View file @
f98f4d50
...
@@ -6,7 +6,6 @@ define([
...
@@ -6,7 +6,6 @@ define([
'jquery'
,
'jquery'
,
'underscore'
,
'underscore'
,
'require'
,
'require'
,
'elasticjs'
,
'elasticjs'
,
'bootstrap'
,
'bootstrap'
,
'angular-sanitize'
,
'angular-sanitize'
,
...
...
src/app/components/kbn.js
View file @
f98f4d50
define
([
'jquery'
,
'underscore'
,
'moment
'
],
define
([
'jquery'
,
'underscore'
,
'moment'
,
'chromath
'
],
function
(
$
,
_
,
moment
)
{
function
(
$
,
_
,
moment
)
{
'use strict'
;
'use strict'
;
...
@@ -459,5 +459,20 @@ function($, _, moment) {
...
@@ -459,5 +459,20 @@ function($, _, moment) {
].
join
(
';'
)
+
'"></div>'
;
].
join
(
';'
)
+
'"></div>'
;
};
};
kbn
.
colorSteps
=
function
(
col
,
steps
)
{
var
_d
=
1.6
/
steps
,
// distance between steps
_p
=
[];
// adjustment percentage
// Create a range of numbers between -0.8 and 0.8
for
(
var
i
=
1
;
i
<
steps
+
1
;
i
+=
1
)
{
_p
.
push
(
i
%
2
?
((
i
-
1
)
*
_d
*-
1
)
/
2
:
i
*
_d
/
2
);
}
// Create the color range
return
_
.
map
(
_p
.
sort
(
function
(
a
,
b
){
return
a
-
b
;}),
function
(
v
)
{
return
v
<
0
?
Chromath
.
darken
(
col
,
v
*-
1
).
toString
()
:
Chromath
.
lighten
(
col
,
v
).
toString
();
});
};
return
kbn
;
return
kbn
;
});
});
\ No newline at end of file
src/app/components/require.config.js
View file @
f98f4d50
...
@@ -13,7 +13,7 @@ require.config({
...
@@ -13,7 +13,7 @@ require.config({
text
:
'../vendor/require/text'
,
text
:
'../vendor/require/text'
,
moment
:
'../vendor/moment'
,
moment
:
'../vendor/moment'
,
filesaver
:
'../vendor/filesaver'
,
filesaver
:
'../vendor/filesaver'
,
chromath
:
'../vendor/chromath'
,
angular
:
'../vendor/angular/angular'
,
angular
:
'../vendor/angular/angular'
,
'angular-dragdrop'
:
'../vendor/angular/angular-dragdrop'
,
'angular-dragdrop'
:
'../vendor/angular/angular-dragdrop'
,
'angular-strap'
:
'../vendor/angular/angular-strap'
,
'angular-strap'
:
'../vendor/angular/angular-strap'
,
...
...
src/app/directives/esVersion.js
View file @
f98f4d50
...
@@ -16,7 +16,6 @@ function (angular) {
...
@@ -16,7 +16,6 @@ function (angular) {
restrict
:
'A'
,
restrict
:
'A'
,
link
:
function
(
scope
,
elem
,
attr
)
{
link
:
function
(
scope
,
elem
,
attr
)
{
if
(
!
esVersion
.
is
(
attr
.
esVersion
))
{
if
(
!
esVersion
.
is
(
attr
.
esVersion
))
{
console
.
log
(
'hiding'
);
elem
.
hide
();
elem
.
hide
();
}
}
}
}
...
...
src/app/panels/table/module.html
View file @
f98f4d50
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
overflow-x
:
scroll
;
overflow-x
:
scroll
;
}
}
</style>
</style>
<div
class=
"row-fluid"
>
<div
class=
"row-fluid"
>
<div
ng-class=
"{'span3':panel.field_list}"
ng-show=
"panel.field_list"
>
<div
ng-class=
"{'span3':panel.field_list}"
ng-show=
"panel.field_list"
>
<div
class=
"sidebar-nav"
>
<div
class=
"sidebar-nav"
>
...
...
src/app/services/dashboard.js
View file @
f98f4d50
...
@@ -123,6 +123,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
...
@@ -123,6 +123,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
// Since the dashboard is responsible for index computation, we can compute and assign the indices
// Since the dashboard is responsible for index computation, we can compute and assign the indices
// here before telling the panels to refresh
// here before telling the panels to refresh
this
.
refresh
=
function
()
{
this
.
refresh
=
function
()
{
if
(
self
.
current
.
index
.
interval
!==
'none'
)
{
if
(
self
.
current
.
index
.
interval
!==
'none'
)
{
if
(
filterSrv
.
idsByType
(
'time'
).
length
>
0
)
{
if
(
filterSrv
.
idsByType
(
'time'
).
length
>
0
)
{
var
_range
=
filterSrv
.
timeRange
(
'last'
);
var
_range
=
filterSrv
.
timeRange
(
'last'
);
...
...
src/app/services/querySrv.js
View file @
f98f4d50
...
@@ -17,14 +17,28 @@ function (angular, _, config) {
...
@@ -17,14 +17,28 @@ function (angular, _, config) {
ids
:
[],
ids
:
[],
});
});
// Defaults for
query objects
// Defaults for
generic query object
var
_query
=
{
var
_query
=
{
query
:
'*'
,
alias
:
''
,
alias
:
''
,
pin
:
false
,
pin
:
false
,
type
:
'lucene'
type
:
'lucene'
};
};
// Defaults for specific query types
var
_dTypes
=
{
"lucene"
:
{
query
:
"*"
},
"regex"
:
{
query
:
".*"
},
"derive"
:
{
query
:
"*"
,
field
:
"_type"
,
size
:
"5"
}
};
// For convenience
// For convenience
var
ejs
=
ejsResource
(
config
.
elasticsearch
);
var
ejs
=
ejsResource
(
config
.
elasticsearch
);
var
_q
=
dashboard
.
current
.
services
.
query
;
var
_q
=
dashboard
.
current
.
services
.
query
;
...
@@ -80,6 +94,7 @@ function (angular, _, config) {
...
@@ -80,6 +94,7 @@ function (angular, _, config) {
query
.
id
=
_id
;
query
.
id
=
_id
;
query
.
color
=
query
.
color
||
colorAt
(
_id
);
query
.
color
=
query
.
color
||
colorAt
(
_id
);
_
.
defaults
(
query
,
_query
);
_
.
defaults
(
query
,
_query
);
_
.
defaults
(
query
,
_dTypes
[
query
.
type
]);
self
.
list
[
_id
]
=
query
;
self
.
list
[
_id
]
=
query
;
self
.
ids
.
push
(
_id
);
self
.
ids
.
push
(
_id
);
...
@@ -102,10 +117,13 @@ function (angular, _, config) {
...
@@ -102,10 +117,13 @@ function (angular, _, config) {
}
}
};
};
this
.
getEjsObj
=
function
(
id
)
{
// This must return an array to correctly resolve compound query types, eg derived
return
self
.
toEjsObj
(
self
.
list
[
id
]);
this
.
getEjsObj
=
function
(
ids
)
{
return
self
.
toEjsObj
(
self
.
list
[
ids
]);
};
};
// In the case of a compound query, such as a derived query, we'd need to
// return an array of elasticJS objects. Not sure if that is appropriate?
this
.
toEjsObj
=
function
(
q
)
{
this
.
toEjsObj
=
function
(
q
)
{
switch
(
q
.
type
)
switch
(
q
.
type
)
{
{
...
...
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