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
f1e5238e
Commit
f1e5238e
authored
Aug 21, 2015
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
escape dimension if it is variable name
parent
d75d4a5c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
public/app/plugins/datasource/cloudwatch/partials/query.editor.html
+1
-1
public/app/plugins/datasource/cloudwatch/queryCtrl.js
+16
-0
No files found.
public/app/plugins/datasource/cloudwatch/partials/query.editor.html
View file @
f1e5238e
...
...
@@ -97,7 +97,7 @@
<li
class=
"tight-form-item"
style=
"width: 100px"
>
Dimensions
</li>
<li
ng-repeat=
"(key, value) in target.
d
imensions track by $index"
class=
"tight-form-item"
>
<li
ng-repeat=
"(key, value) in target.
escapedD
imensions track by $index"
class=
"tight-form-item"
>
{{key}}
=
{{value}}
<a
ng-click=
"removeDimension(key)"
>
<i
class=
"fa fa-remove"
></i>
...
...
public/app/plugins/datasource/cloudwatch/queryCtrl.js
View file @
f1e5238e
...
...
@@ -13,6 +13,7 @@ function (angular, _) {
$scope
.
target
.
namespace
=
$scope
.
target
.
namespace
||
''
;
$scope
.
target
.
metricName
=
$scope
.
target
.
metricName
||
''
;
$scope
.
target
.
dimensions
=
$scope
.
target
.
dimensions
||
{};
$scope
.
target
.
escapedDimensions
=
this
.
escapeDimensions
(
$scope
.
target
.
dimensions
);
$scope
.
target
.
statistics
=
$scope
.
target
.
statistics
||
{};
$scope
.
target
.
period
=
$scope
.
target
.
period
||
60
;
$scope
.
target
.
region
=
$scope
.
target
.
region
||
$scope
.
datasource
.
getDefaultRegion
();
...
...
@@ -94,6 +95,7 @@ function (angular, _) {
}
$scope
.
target
.
dimensions
[
$scope
.
target
.
currentDimensionKey
]
=
$scope
.
target
.
currentDimensionValue
;
$scope
.
target
.
escapedDimensions
=
this
.
escapeDimensions
(
$scope
.
target
.
dimensions
);
$scope
.
target
.
currentDimensionKey
=
''
;
$scope
.
target
.
currentDimensionValue
=
''
;
$scope
.
refreshMetricData
();
...
...
@@ -102,10 +104,24 @@ function (angular, _) {
};
$scope
.
removeDimension
=
function
(
key
)
{
key
=
key
.
replace
(
/
\\\$
/g
,
'$'
);
delete
$scope
.
target
.
dimensions
[
key
];
$scope
.
target
.
escapedDimensions
=
this
.
escapeDimensions
(
$scope
.
target
.
dimensions
);
$scope
.
refreshMetricData
();
};
$scope
.
escapeDimensions
=
function
(
d
)
{
var
result
=
{};
_
.
chain
(
d
)
.
keys
(
d
)
.
each
(
function
(
k
)
{
var
v
=
d
[
k
];
result
[
k
.
replace
(
/
\$
/g
,
'
\\
$'
)]
=
v
.
replace
(
/
\$
/g
,
'
\\
$'
);
});
return
result
;
};
$scope
.
statisticsOptionChanged
=
function
()
{
$scope
.
refreshMetricData
();
};
...
...
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