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
1440d1a1
Commit
1440d1a1
authored
Sep 09, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix when changing templated vars, should update child template vars All value
parent
4b170ca9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
269 additions
and
3 deletions
+269
-3
src/app/dashboards/template_vars.json
+264
-0
src/app/services/templateValuesSrv.js
+5
-3
No files found.
src/app/dashboards/template_vars.json
0 → 100644
View file @
1440d1a1
{
"id"
:
null
,
"title"
:
"Templated Graphs Nested"
,
"originalTitle"
:
"Templated Graphs Nested"
,
"tags"
:
[
"showcase"
,
"templated"
],
"style"
:
"dark"
,
"timezone"
:
"browser"
,
"editable"
:
true
,
"hideControls"
:
false
,
"rows"
:
[
{
"title"
:
"Row1"
,
"height"
:
"350px"
,
"editable"
:
true
,
"collapse"
:
false
,
"collapsable"
:
true
,
"panels"
:
[
{
"span"
:
12
,
"editable"
:
true
,
"type"
:
"graph"
,
"loadingEditor"
:
false
,
"datasource"
:
null
,
"renderer"
:
"flot"
,
"x-axis"
:
true
,
"y-axis"
:
true
,
"scale"
:
1
,
"y_formats"
:
[
"short"
,
"short"
],
"grid"
:
{
"max"
:
null
,
"min"
:
0
,
"threshold1"
:
null
,
"threshold2"
:
null
,
"threshold1Color"
:
"rgba(216, 200, 27, 0.27)"
,
"threshold2Color"
:
"rgba(234, 112, 112, 0.22)"
,
"leftMax"
:
null
,
"rightMax"
:
null
,
"leftMin"
:
null
,
"rightMin"
:
null
},
"annotate"
:
{
"enable"
:
false
},
"resolution"
:
100
,
"lines"
:
true
,
"fill"
:
1
,
"linewidth"
:
1
,
"points"
:
false
,
"pointradius"
:
5
,
"bars"
:
false
,
"stack"
:
true
,
"legend"
:
{
"show"
:
true
,
"values"
:
false
,
"min"
:
false
,
"max"
:
false
,
"current"
:
false
,
"total"
:
false
,
"avg"
:
false
},
"percentage"
:
false
,
"zerofill"
:
true
,
"nullPointMode"
:
"connected"
,
"steppedLine"
:
false
,
"tooltip"
:
{
"value_type"
:
"cumulative"
,
"query_as_alias"
:
true
},
"targets"
:
[
{
"target"
:
"aliasByNode(apps.$app.$server.counters.requests.count, 2)"
,
"function"
:
"mean"
,
"column"
:
"value"
}
],
"aliasColors"
:
{
"highres.test"
:
"#1F78C1"
,
"scale(highres.test,3)"
:
"#6ED0E0"
,
"mobile"
:
"#6ED0E0"
,
"tablet"
:
"#EAB839"
},
"title"
:
"Traffic [[period]]"
,
"id"
:
1
,
"seriesOverrides"
:
[]
}
],
"notice"
:
false
},
{
"title"
:
"Row1"
,
"height"
:
"350px"
,
"editable"
:
true
,
"collapse"
:
false
,
"collapsable"
:
true
,
"panels"
:
[
{
"span"
:
12
,
"editable"
:
true
,
"type"
:
"graph"
,
"loadingEditor"
:
false
,
"datasource"
:
null
,
"renderer"
:
"flot"
,
"x-axis"
:
true
,
"y-axis"
:
true
,
"scale"
:
1
,
"y_formats"
:
[
"short"
,
"short"
],
"grid"
:
{
"max"
:
null
,
"min"
:
0
,
"threshold1"
:
null
,
"threshold2"
:
null
,
"threshold1Color"
:
"rgba(216, 200, 27, 0.27)"
,
"threshold2Color"
:
"rgba(234, 112, 112, 0.22)"
,
"leftMax"
:
null
,
"rightMax"
:
null
,
"leftMin"
:
null
,
"rightMin"
:
null
},
"annotate"
:
{
"enable"
:
false
},
"resolution"
:
100
,
"lines"
:
true
,
"fill"
:
1
,
"linewidth"
:
1
,
"points"
:
false
,
"pointradius"
:
5
,
"bars"
:
false
,
"stack"
:
true
,
"legend"
:
{
"show"
:
true
,
"values"
:
false
,
"min"
:
false
,
"max"
:
false
,
"current"
:
false
,
"total"
:
false
,
"avg"
:
false
},
"percentage"
:
false
,
"zerofill"
:
true
,
"nullPointMode"
:
"connected"
,
"steppedLine"
:
false
,
"tooltip"
:
{
"value_type"
:
"cumulative"
,
"query_as_alias"
:
true
},
"targets"
:
[
{
"target"
:
"aliasByNode(apps.$app.$server.counters.requests.count, 2)"
}
],
"aliasColors"
:
{
"highres.test"
:
"#1F78C1"
,
"scale(highres.test,3)"
:
"#6ED0E0"
,
"mobile"
:
"#6ED0E0"
,
"tablet"
:
"#EAB839"
},
"title"
:
"Second pannel"
,
"id"
:
2
,
"seriesOverrides"
:
[]
}
],
"notice"
:
false
}
],
"nav"
:
[
{
"type"
:
"timepicker"
,
"collapse"
:
false
,
"notice"
:
false
,
"enable"
:
true
,
"status"
:
"Stable"
,
"time_options"
:
[
"5m"
,
"15m"
,
"1h"
,
"6h"
,
"12h"
,
"24h"
,
"2d"
,
"7d"
,
"30d"
],
"refresh_intervals"
:
[
"5s"
,
"10s"
,
"30s"
,
"1m"
,
"5m"
,
"15m"
,
"30m"
,
"1h"
,
"2h"
,
"1d"
],
"now"
:
true
}
],
"time"
:
{
"from"
:
"now-15m"
,
"to"
:
"now"
},
"templating"
:
{
"list"
:
[
{
"type"
:
"query"
,
"name"
:
"app"
,
"query"
:
"apps.*"
,
"includeAll"
:
true
,
"options"
:
[],
"current"
:
{
"text"
:
"All"
,
"value"
:
"*"
},
"datasource"
:
null
,
"allFormat"
:
"wildcard"
,
"refresh"
:
true
},
{
"type"
:
"query"
,
"name"
:
"server"
,
"query"
:
"apps.$app.*"
,
"includeAll"
:
true
,
"options"
:
[],
"current"
:
{
"text"
:
"All"
,
"value"
:
"*"
},
"datasource"
:
null
,
"allFormat"
:
"Glob"
,
"refresh"
:
false
},
{
"type"
:
"query"
,
"datasource"
:
null
,
"refresh_on_load"
:
false
,
"name"
:
"metric"
,
"options"
:
[],
"includeAll"
:
true
,
"allFormat"
:
"glob"
,
"query"
:
"apps.$app.$server.*"
,
"current"
:
{
"text"
:
"counters"
,
"value"
:
"counters"
}
}
],
"enable"
:
true
},
"annotations"
:
{
"enable"
:
false
},
"refresh"
:
false
,
"version"
:
6
}
src/app/services/templateValuesSrv.js
View file @
1440d1a1
...
@@ -70,7 +70,9 @@ function (angular, _, kbn) {
...
@@ -70,7 +70,9 @@ function (angular, _, kbn) {
if
(
otherVariable
===
updatedVariable
)
{
if
(
otherVariable
===
updatedVariable
)
{
return
;
return
;
}
}
console
.
log
(
"value"
);
if
(
templateSrv
.
containsVariable
(
otherVariable
.
query
,
updatedVariable
.
name
))
{
if
(
templateSrv
.
containsVariable
(
otherVariable
.
query
,
updatedVariable
.
name
))
{
console
.
log
(
"valuei2"
);
return
self
.
updateOptions
(
otherVariable
);
return
self
.
updateOptions
(
otherVariable
);
}
}
});
});
...
@@ -108,9 +110,9 @@ function (angular, _, kbn) {
...
@@ -108,9 +110,9 @@ function (angular, _, kbn) {
// if parameter has current value
// if parameter has current value
// if it exists in options array keep value
// if it exists in options array keep value
if
(
variable
.
current
)
{
if
(
variable
.
current
)
{
var
current
Exists
=
_
.
findWhere
(
variable
.
options
,
{
text
:
variable
.
current
.
text
});
var
current
Option
=
_
.
findWhere
(
variable
.
options
,
{
text
:
variable
.
current
.
text
});
if
(
current
Exists
)
{
if
(
current
Option
)
{
return
self
.
setVariableValue
(
variable
,
variable
.
current
,
true
);
return
self
.
setVariableValue
(
variable
,
currentOption
,
true
);
}
}
}
}
...
...
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