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
70071e5d
Commit
70071e5d
authored
Dec 19, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename template variables prop
parent
cf50cf16
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
public/app/plugins/datasource/stackdriver/components/StackdriverPicker.tsx
+8
-8
public/app/plugins/datasource/stackdriver/partials/query.aggregation.html
+3
-3
public/app/plugins/datasource/stackdriver/partials/query.filter.html
+1
-1
public/app/plugins/datasource/stackdriver/query_ctrl.ts
+1
-1
No files found.
public/app/plugins/datasource/stackdriver/components/StackdriverPicker.tsx
View file @
70071e5d
...
...
@@ -10,7 +10,7 @@ export interface Props {
placeholder
?:
string
;
className
?:
string
;
groupName
?:
string
;
templateV
ariables
?:
any
[];
v
ariables
?:
any
[];
}
interface
State
{
...
...
@@ -19,7 +19,7 @@ interface State {
export
class
StackdriverPicker
extends
React
.
Component
<
Props
,
State
>
{
static
defaultProps
=
{
templateV
ariables
:
[],
v
ariables
:
[],
options
:
[],
groupName
:
'Options'
,
};
...
...
@@ -34,7 +34,7 @@ export class StackdriverPicker extends React.Component<Props, State> {
}
componentWillReceiveProps
(
nextProps
:
Props
)
{
if
(
nextProps
.
options
.
length
>
0
||
nextProps
.
templateV
ariables
.
length
)
{
if
(
nextProps
.
options
.
length
>
0
||
nextProps
.
v
ariables
.
length
)
{
this
.
setState
({
options
:
this
.
buildOptions
(
nextProps
)
});
}
}
...
...
@@ -44,10 +44,10 @@ export class StackdriverPicker extends React.Component<Props, State> {
return
nextProps
.
value
!==
this
.
props
.
value
||
!
_
.
isEqual
(
nextOptions
,
this
.
state
.
options
);
}
buildOptions
({
templateV
ariables
=
[],
groupName
=
''
,
options
})
{
return
templateV
ariables
.
length
>
0
buildOptions
({
v
ariables
=
[],
groupName
=
''
,
options
})
{
return
v
ariables
.
length
>
0
?
[
this
.
get
Template
VariablesGroup
(),
this
.
getVariablesGroup
(),
{
label
:
groupName
,
expanded
:
true
,
...
...
@@ -57,10 +57,10 @@ export class StackdriverPicker extends React.Component<Props, State> {
:
options
;
}
get
Template
VariablesGroup
()
{
getVariablesGroup
()
{
return
{
label
:
'Template Variables'
,
options
:
this
.
props
.
templateV
ariables
.
map
(
v
=>
({
options
:
this
.
props
.
v
ariables
.
map
(
v
=>
({
label
:
`$
${
v
.
name
}
`
,
value
:
`$
${
v
.
name
}
`
,
})),
...
...
public/app/plugins/datasource/stackdriver/partials/query.aggregation.html
View file @
70071e5d
...
...
@@ -8,7 +8,7 @@
is-searchable=
"true"
placeholder=
"'Select Aggregation'"
className=
"'width-15'"
template-
variables=
"ctrl.templateSrv.variables"
variables=
"ctrl.templateSrv.variables"
group-name=
"'Aggregations'"
></stackdriver-picker>
</div>
...
...
@@ -31,7 +31,7 @@
is-searchable=
"true"
placeholder=
"'Select Alignment'"
className=
"'width-15'"
template-
variables=
"ctrl.templateSrv.variables"
variables=
"ctrl.templateSrv.variables"
group-name=
"'Alignment Options'"
></stackdriver-picker>
...
...
@@ -48,7 +48,7 @@
is-searchable=
"true"
placeholder=
"'Select Alignment'"
className=
"'width-15'"
template-
variables=
"ctrl.templateSrv.variables"
variables=
"ctrl.templateSrv.variables"
group-name=
"'Alignment Periods'"
></stackdriver-picker>
</div>
...
...
public/app/plugins/datasource/stackdriver/partials/query.filter.html
View file @
70071e5d
...
...
@@ -19,7 +19,7 @@
onChange=
"ctrl.handleMetricTypeChange"
value=
"ctrl.target.metricType"
options=
"ctrl.getMetricsList()"
template-
variables=
"ctrl.templateSrv.variables"
variables=
"ctrl.templateSrv.variables"
group-name=
"'Metric Types'"
is-searchable=
"true"
placeholder=
"'Select Metric'"
...
...
public/app/plugins/datasource/stackdriver/query_ctrl.ts
View file @
70071e5d
...
...
@@ -71,7 +71,7 @@ export class StackdriverQueryCtrl extends QueryCtrl {
'className'
,
'placeholder'
,
'groupName'
,
[
'
templateV
ariables'
,
{
watchDepth
:
'reference'
}],
[
'
v
ariables'
,
{
watchDepth
:
'reference'
}],
]);
}
...
...
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