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
1e7ced2a
Commit
1e7ced2a
authored
Jan 01, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for template targets
parent
cef4349b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
16 deletions
+10
-16
src/app/controllers/graphiteTarget.js
+8
-10
src/app/panels/graphite/module.js
+1
-6
src/test/specs/parser-specs.js
+1
-0
No files found.
src/app/controllers/graphiteTarget.js
View file @
1e7ced2a
...
@@ -81,23 +81,21 @@ function (angular, _, config, graphiteFuncs, Parser) {
...
@@ -81,23 +81,21 @@ function (angular, _, config, graphiteFuncs, Parser) {
}
}
$scope
.
segments
=
_
.
map
(
astNode
.
segments
,
function
(
segment
)
{
$scope
.
segments
=
_
.
map
(
astNode
.
segments
,
function
(
segment
)
{
return
{
var
node
=
{
type
:
segment
.
type
,
type
:
segment
.
type
,
val
:
segment
.
value
,
val
:
segment
.
value
,
html
:
getSegmentHtml
(
segment
)
html
:
segment
.
value
};
};
});
}
}
function
getSegmentHtml
(
segment
)
{
if
(
segment
.
value
===
'*'
)
{
if
(
segment
.
value
===
'*'
)
{
return
'<i class="icon-asterisk"><i>'
;
node
.
html
=
'<i class="icon-asterisk"><i>'
;
}
}
if
(
segment
.
type
===
'template'
)
{
if
(
segment
.
type
===
'template'
)
{
return
"<span style='color: #ECEC09'>[["
+
segment
.
value
+
"]]</span>"
;
node
.
val
=
node
.
html
=
'[['
+
segment
.
value
+
']]'
;
node
.
html
=
"<span style='color: #ECEC09'>"
+
node
.
html
+
"</span>"
;
}
return
node
;
});
}
}
return
segment
.
value
;
}
}
function
getSegmentPathUpTo
(
index
)
{
function
getSegmentPathUpTo
(
index
)
{
...
...
src/app/panels/graphite/module.js
View file @
1e7ced2a
...
@@ -332,7 +332,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
...
@@ -332,7 +332,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
var
data
=
[];
var
data
=
[];
if
(
results
.
length
===
0
)
{
if
(
results
.
length
===
0
)
{
throw
{
message
:
'no data in response from graphite'
}
;
return
[]
;
}
}
var
tsOpts
=
{
var
tsOpts
=
{
...
@@ -662,10 +662,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
...
@@ -662,10 +662,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
});
});
}
}
/* var totalDataPoints = _.reduce(data, function(num, series) { return series.data.length + num; }, 0);
console.log('Datapoints[0] count:', data[0].data.length);
console.log('Datapoints.Total count:', totalDataPoints);*/
plot
=
$
.
plot
(
elem
,
data
,
options
);
plot
=
$
.
plot
(
elem
,
data
,
options
);
if
(
scope
.
panel
.
leftYAxisLabel
)
{
if
(
scope
.
panel
.
leftYAxisLabel
)
{
...
@@ -678,7 +674,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
...
@@ -678,7 +674,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
}
else
if
(
elem
.
css
(
'margin-left'
))
{
}
else
if
(
elem
.
css
(
'margin-left'
))
{
elem
.
css
(
'margin-left'
,
''
);
elem
.
css
(
'margin-left'
,
''
);
}
}
}
}
function
time_format
(
interval
)
{
function
time_format
(
interval
)
{
...
...
src/test/specs/parser-specs.js
View file @
1e7ced2a
...
@@ -61,6 +61,7 @@ define([
...
@@ -61,6 +61,7 @@ define([
expect
(
rootNode
.
message
).
to
.
be
(
undefined
)
expect
(
rootNode
.
message
).
to
.
be
(
undefined
)
expect
(
rootNode
.
params
[
0
].
type
).
to
.
be
(
'metric'
);
expect
(
rootNode
.
params
[
0
].
type
).
to
.
be
(
'metric'
);
expect
(
rootNode
.
params
[
0
].
segments
[
1
].
type
).
to
.
be
(
'template'
);
expect
(
rootNode
.
params
[
0
].
segments
[
1
].
type
).
to
.
be
(
'template'
);
expect
(
rootNode
.
params
[
0
].
segments
[
1
].
value
).
to
.
be
(
'server'
);
});
});
it
(
'invalid metric expression'
,
function
()
{
it
(
'invalid metric expression'
,
function
()
{
...
...
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