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
584f40d0
Commit
584f40d0
authored
Jan 06, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:torkelo/grafana-private into pro
parents
72974719
d4c3463f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
40 deletions
+52
-40
CHANGELOG.md
+6
-0
src/app/components/lodash.extended.js
+0
-4
src/app/features/graphite/datasource.js
+4
-1
src/app/features/graphite/gfunc.js
+14
-0
src/app/features/graphite/queryCtrl.js
+1
-1
src/app/features/influxdb/datasource.js
+11
-16
src/app/features/influxdb/queryCtrl.js
+0
-1
src/app/services/alertSrv.js
+16
-17
No files found.
CHANGELOG.md
View file @
584f40d0
# 2.0.0 (unreleased)
**Enhancements**
-
[
Issue #1297
](
https://github.com/grafana/grafana/issues/1297
)
. Graphite: Added cumulative and minimumBelow graphite functions
-
[
Issue #1296
](
https://github.com/grafana/grafana/issues/1296
)
. InfluxDB: Auto escape column names with special characters. Thanks @steven-aerts
# 1.9.1 (2014-12-29)
**Enhancements**
...
...
src/app/components/lodash.extended.js
View file @
584f40d0
...
...
@@ -14,10 +14,6 @@ function () {
array
.
splice
(
toIndex
,
0
,
array
.
splice
(
fromIndex
,
1
)[
0
]);
return
array
;
},
remove
:
function
(
array
,
index
)
{
array
.
splice
(
index
,
1
);
return
array
;
},
// If variable is value, then return alt. If variable is anything else, return value;
toggle
:
function
(
variable
,
value
,
alt
)
{
return
variable
===
value
?
alt
:
value
;
...
...
src/app/features/graphite/datasource.js
View file @
584f40d0
...
...
@@ -232,7 +232,10 @@ function (angular, _, $, config, kbn, moment) {
'#A'
,
'#B'
,
'#C'
,
'#D'
,
'#E'
,
'#F'
,
'#G'
,
'#H'
,
'#I'
,
'#J'
,
'#K'
,
'#L'
,
'#M'
,
'#N'
,
'#O'
'#M'
,
'#N'
,
'#O'
,
'#P'
,
'#Q'
,
'#R'
,
'#S'
,
'#T'
,
'#U'
,
'#V'
,
'#W'
,
'#X'
,
'#Y'
,
'#Z'
];
GraphiteDatasource
.
prototype
.
buildGraphiteParams
=
function
(
options
)
{
...
...
src/app/features/graphite/gfunc.js
View file @
584f40d0
...
...
@@ -224,6 +224,13 @@ function (_, $) {
});
addFuncDef
({
name
:
"cumulative"
,
category
:
categories
.
Special
,
params
:
[],
defaultParams
:
[]
});
addFuncDef
({
name
:
"groupByNode"
,
category
:
categories
.
Special
,
params
:
[
...
...
@@ -468,6 +475,13 @@ function (_, $) {
});
addFuncDef
({
name
:
'minimumBelow'
,
category
:
categories
.
Filter
,
params
:
[{
name
:
"value"
,
type
:
"int"
}],
defaultParams
:
[
0
]
});
addFuncDef
({
name
:
'limit'
,
category
:
categories
.
Filter
,
params
:
[{
name
:
"n"
,
type
:
"int"
}],
...
...
src/app/features/graphite/queryCtrl.js
View file @
584f40d0
...
...
@@ -9,7 +9,7 @@ function (angular, _, config, gfunc, Parser) {
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
var
targetLetters
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'I'
,
'J'
,
'K'
,
'L'
,
'M'
,
'N'
,
'O'
]
;
var
targetLetters
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
;
module
.
controller
(
'GraphiteQueryCtrl'
,
function
(
$scope
,
$sce
,
templateSrv
)
{
...
...
src/app/features/influxdb/datasource.js
View file @
584f40d0
...
...
@@ -74,16 +74,19 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
};
InfluxDatasource
.
prototype
.
listColumns
=
function
(
seriesName
)
{
var
interpolated
=
templateSrv
.
replace
(
seriesName
);
if
(
interpolated
[
0
]
!==
'/'
)
{
interpolated
=
'/'
+
interpolated
+
'/'
;
seriesName
=
templateSrv
.
replace
(
seriesName
);
if
(
!
seriesName
.
match
(
'^/.*/'
)
&&
!
seriesName
.
match
(
/^merge
\(
.*
\)
/
))
{
seriesName
=
'"'
+
seriesName
+
'"'
;
}
return
this
.
_seriesQuery
(
'select * from '
+
interpolated
+
' limit 1'
).
then
(
function
(
data
)
{
return
this
.
_seriesQuery
(
'select * from '
+
seriesName
+
' limit 1'
).
then
(
function
(
data
)
{
if
(
!
data
)
{
return
[];
}
return
data
[
0
].
columns
;
return
data
[
0
].
columns
.
map
(
function
(
item
)
{
return
/^
\w
+$/
.
test
(
item
)
?
item
:
(
'"'
+
item
+
'"'
);
});
});
};
...
...
@@ -97,17 +100,9 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
if
(
!
data
||
data
.
length
===
0
)
{
return
[];
}
// influxdb >= 1.8
if
(
data
[
0
].
points
.
length
>
0
)
{
return
_
.
map
(
data
[
0
].
points
,
function
(
point
)
{
return
point
[
1
];
});
}
else
{
// influxdb <= 1.7
return
_
.
map
(
data
,
function
(
series
)
{
return
series
.
name
;
// influxdb < 1.7
});
}
return
_
.
map
(
data
[
0
].
points
,
function
(
point
)
{
return
point
[
1
];
});
});
};
...
...
src/app/features/influxdb/queryCtrl.js
View file @
584f40d0
...
...
@@ -88,7 +88,6 @@ function (angular, _) {
seriesList
=
[];
$scope
.
datasource
.
listSeries
(
query
).
then
(
function
(
series
)
{
seriesList
=
series
;
console
.
log
(
series
);
callback
(
seriesList
);
});
}
...
...
src/app/services/alertSrv.js
View file @
584f40d0
...
...
@@ -27,28 +27,27 @@ function (angular, _) {
this
.
list
=
[];
this
.
set
=
function
(
title
,
text
,
severity
,
timeout
)
{
var
_a
=
{
title
:
title
||
''
,
text
:
$sce
.
trustAsHtml
(
text
||
''
),
severity
:
severity
||
'info'
,
},
_ca
=
angular
.
toJson
(
_a
),
_clist
=
_
.
map
(
self
.
list
,
function
(
alert
)
{
return
angular
.
toJson
(
alert
);});
// If we already have this alert, remove it and add a new one
// Why do this instead of skipping the add because it resets the timer
if
(
_
.
contains
(
_clist
,
_ca
))
{
_
.
remove
(
self
.
list
,
_
.
indexOf
(
_clist
,
_ca
));
}
var
newAlert
=
{
title
:
title
||
''
,
text
:
$sce
.
trustAsHtml
(
text
||
''
),
severity
:
severity
||
'info'
,
};
var
newAlertJson
=
angular
.
toJson
(
newAlert
);
self
.
list
.
push
(
_a
);
// remove same alert if it already exists
_
.
remove
(
self
.
list
,
function
(
value
)
{
return
angular
.
toJson
(
value
)
===
newAlertJson
;
});
self
.
list
.
push
(
newAlert
);
if
(
timeout
>
0
)
{
$timeout
(
function
()
{
self
.
list
=
_
.
without
(
self
.
list
,
_a
);
self
.
list
=
_
.
without
(
self
.
list
,
newAlert
);
},
timeout
);
}
return
(
_a
);
return
(
newAlert
);
};
this
.
clear
=
function
(
alert
)
{
...
...
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