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
dc7f98de
Commit
dc7f98de
authored
Jan 08, 2019
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use correct event handler name convention. register directive on startup
parent
f9f51d68
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
52 additions
and
55 deletions
+52
-55
public/app/core/angular_wrappers.ts
+8
-0
public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts
+2
-2
public/app/plugins/datasource/stackdriver/components/Aggregations.tsx
+2
-2
public/app/plugins/datasource/stackdriver/components/AliasBy.tsx
+7
-8
public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx
+6
-6
public/app/plugins/datasource/stackdriver/components/Help.tsx
+4
-4
public/app/plugins/datasource/stackdriver/components/Metrics.tsx
+5
-5
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx
+9
-9
public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx
+2
-2
public/app/plugins/datasource/stackdriver/partials/annotations.editor.html
+1
-1
public/app/plugins/datasource/stackdriver/partials/query.editor.html
+2
-2
public/app/plugins/datasource/stackdriver/query_ctrl.ts
+4
-14
No files found.
public/app/core/angular_wrappers.ts
View file @
dc7f98de
import
{
react2AngularDirective
}
from
'app/core/utils/react2angular'
;
import
{
react2AngularDirective
}
from
'app/core/utils/react2angular'
;
import
{
QueryEditor
}
from
'app/plugins/datasource/stackdriver/components/QueryEditor'
;
import
{
PasswordStrength
}
from
'./components/PasswordStrength'
;
import
{
PasswordStrength
}
from
'./components/PasswordStrength'
;
import
PageHeader
from
'./components/PageHeader/PageHeader'
;
import
PageHeader
from
'./components/PageHeader/PageHeader'
;
import
EmptyListCTA
from
'./components/EmptyListCTA/EmptyListCTA'
;
import
EmptyListCTA
from
'./components/EmptyListCTA/EmptyListCTA'
;
...
@@ -29,4 +30,11 @@ export function registerAngularDirectives() {
...
@@ -29,4 +30,11 @@ export function registerAngularDirectives() {
'placeholder'
,
'placeholder'
,
[
'variables'
,
{
watchDepth
:
'reference'
}],
[
'variables'
,
{
watchDepth
:
'reference'
}],
]);
]);
react2AngularDirective
(
'queryEditor'
,
QueryEditor
,
[
'target'
,
'onQueryChange'
,
'onExecuteQuery'
,
[
'events'
,
{
watchDepth
:
'reference'
}],
[
'datasource'
,
{
watchDepth
:
'reference'
}],
]);
}
}
public/app/plugins/datasource/stackdriver/annotations_query_ctrl.ts
View file @
dc7f98de
...
@@ -7,7 +7,7 @@ export class StackdriverAnnotationsQueryCtrl {
...
@@ -7,7 +7,7 @@ export class StackdriverAnnotationsQueryCtrl {
constructor
()
{
constructor
()
{
this
.
annotation
.
target
=
this
.
annotation
.
target
||
{};
this
.
annotation
.
target
=
this
.
annotation
.
target
||
{};
this
.
handleQueryChange
=
this
.
handle
QueryChange
.
bind
(
this
);
this
.
onQueryChange
=
this
.
on
QueryChange
.
bind
(
this
);
react2AngularDirective
(
'annotationQueryEditor'
,
AnnotationQueryEditor
,
[
react2AngularDirective
(
'annotationQueryEditor'
,
AnnotationQueryEditor
,
[
'target'
,
'target'
,
...
@@ -17,7 +17,7 @@ export class StackdriverAnnotationsQueryCtrl {
...
@@ -17,7 +17,7 @@ export class StackdriverAnnotationsQueryCtrl {
]);
]);
}
}
handle
QueryChange
(
target
)
{
on
QueryChange
(
target
)
{
Object
.
assign
(
this
.
annotation
.
target
,
target
);
Object
.
assign
(
this
.
annotation
.
target
,
target
);
}
}
}
}
public/app/plugins/datasource/stackdriver/components/Aggregations.tsx
View file @
dc7f98de
...
@@ -52,7 +52,7 @@ export class Aggregations extends React.Component<Props, State> {
...
@@ -52,7 +52,7 @@ export class Aggregations extends React.Component<Props, State> {
this
.
setState
({
aggOptions
});
this
.
setState
({
aggOptions
});
}
}
handle
ToggleDisplayAdvanced
()
{
on
ToggleDisplayAdvanced
()
{
this
.
setState
(
state
=>
({
this
.
setState
(
state
=>
({
displayAdvancedOptions
:
!
state
.
displayAdvancedOptions
,
displayAdvancedOptions
:
!
state
.
displayAdvancedOptions
,
}));
}));
...
@@ -78,7 +78,7 @@ export class Aggregations extends React.Component<Props, State> {
...
@@ -78,7 +78,7 @@ export class Aggregations extends React.Component<Props, State> {
</
div
>
</
div
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form gf-form--grow"
>
<
label
className=
"gf-form-label gf-form-label--grow"
>
<
label
className=
"gf-form-label gf-form-label--grow"
>
<
a
onClick=
{
()
=>
this
.
handle
ToggleDisplayAdvanced
()
}
>
<
a
onClick=
{
()
=>
this
.
on
ToggleDisplayAdvanced
()
}
>
<>
<>
<
i
className=
{
`fa fa-caret-${displayAdvancedOptions ? 'down' : 'right'}`
}
/>
Advanced Options
<
i
className=
{
`fa fa-caret-${displayAdvancedOptions ? 'down' : 'right'}`
}
/>
Advanced Options
</>
</>
...
...
public/app/plugins/datasource/stackdriver/components/AliasBy.tsx
View file @
dc7f98de
...
@@ -13,8 +13,7 @@ export interface State {
...
@@ -13,8 +13,7 @@ export interface State {
export
class
AliasBy
extends
Component
<
Props
,
State
>
{
export
class
AliasBy
extends
Component
<
Props
,
State
>
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
this
.
updateQuery
=
debounce
(
this
.
updateQuery
.
bind
(
this
),
500
);
this
.
onChange
=
debounce
(
this
.
onChange
.
bind
(
this
),
500
);
this
.
state
=
{
value
:
''
};
this
.
state
=
{
value
:
''
};
}
}
...
@@ -28,18 +27,18 @@ export class AliasBy extends Component<Props, State> {
...
@@ -28,18 +27,18 @@ export class AliasBy extends Component<Props, State> {
}
}
}
}
handle
Change
(
e
)
{
on
Change
(
e
)
{
this
.
setState
({
value
:
e
.
target
.
value
});
this
.
setState
({
value
:
e
.
target
.
value
});
this
.
onChange
(
e
.
target
.
value
);
this
.
updateQuery
(
e
.
target
.
value
);
}
}
onChange
(
value
)
{
updateQuery
(
value
)
{
this
.
props
.
onChange
(
value
);
this
.
props
.
onChange
(
value
);
}
}
render
()
{
render
()
{
return
(
return
(
<>
<
React
.
Fragment
>
<
div
className=
"gf-form-inline"
>
<
div
className=
"gf-form-inline"
>
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
<
label
className=
"gf-form-label query-keyword width-9"
>
Alias By
</
label
>
<
label
className=
"gf-form-label query-keyword width-9"
>
Alias By
</
label
>
...
@@ -47,14 +46,14 @@ export class AliasBy extends Component<Props, State> {
...
@@ -47,14 +46,14 @@ export class AliasBy extends Component<Props, State> {
type=
"text"
type=
"text"
className=
"gf-form-input width-24"
className=
"gf-form-input width-24"
value=
{
this
.
state
.
value
}
value=
{
this
.
state
.
value
}
onChange=
{
this
.
handleChange
}
onChange=
{
e
=>
this
.
onChange
(
e
)
}
/>
/>
</
div
>
</
div
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form-label gf-form-label--grow"
/>
<
div
className=
"gf-form-label gf-form-label--grow"
/>
</
div
>
</
div
>
</
div
>
</
div
>
</>
</
React
.
Fragment
>
);
);
}
}
}
}
public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx
View file @
dc7f98de
...
@@ -36,7 +36,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
...
@@ -36,7 +36,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
});
});
}
}
handle
MetricTypeChange
({
valueType
,
metricKind
,
type
,
unit
})
{
on
MetricTypeChange
({
valueType
,
metricKind
,
type
,
unit
})
{
const
{
onQueryChange
}
=
this
.
props
;
const
{
onQueryChange
}
=
this
.
props
;
this
.
setState
(
this
.
setState
(
{
{
...
@@ -51,7 +51,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
...
@@ -51,7 +51,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
);
);
}
}
handle
Change
(
prop
,
value
)
{
on
Change
(
prop
,
value
)
{
this
.
setState
({
[
prop
]:
value
},
()
=>
{
this
.
setState
({
[
prop
]:
value
},
()
=>
{
this
.
props
.
onQueryChange
(
this
.
state
);
this
.
props
.
onQueryChange
(
this
.
state
);
});
});
...
@@ -68,12 +68,12 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
...
@@ -68,12 +68,12 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
metricType=
{
metricType
}
metricType=
{
metricType
}
templateSrv=
{
datasource
.
templateSrv
}
templateSrv=
{
datasource
.
templateSrv
}
datasource=
{
datasource
}
datasource=
{
datasource
}
onChange=
{
value
=>
this
.
handle
MetricTypeChange
(
value
)
}
onChange=
{
value
=>
this
.
on
MetricTypeChange
(
value
)
}
>
>
{
metric
=>
(
{
metric
=>
(
<>
<>
<
Filter
<
Filter
filtersChanged=
{
value
=>
this
.
handle
Change
(
'filters'
,
value
)
}
filtersChanged=
{
value
=>
this
.
on
Change
(
'filters'
,
value
)
}
filters=
{
filters
}
filters=
{
filters
}
refId=
{
refId
}
refId=
{
refId
}
hideGroupBys=
{
true
}
hideGroupBys=
{
true
}
...
@@ -91,7 +91,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
...
@@ -91,7 +91,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
type=
"text"
type=
"text"
className=
"gf-form-input width-20"
className=
"gf-form-input width-20"
value=
{
title
}
value=
{
title
}
onChange=
{
e
=>
this
.
handle
Change
(
'title'
,
e
.
target
.
value
)
}
onChange=
{
e
=>
this
.
on
Change
(
'title'
,
e
.
target
.
value
)
}
/>
/>
</
div
>
</
div
>
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
...
@@ -100,7 +100,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
...
@@ -100,7 +100,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
type=
"text"
type=
"text"
className=
"gf-form-input width-20"
className=
"gf-form-input width-20"
value=
{
text
}
value=
{
text
}
onChange=
{
e
=>
this
.
handle
Change
(
'text'
,
e
.
target
.
value
)
}
onChange=
{
e
=>
this
.
on
Change
(
'text'
,
e
.
target
.
value
)
}
/>
/>
</
div
>
</
div
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form gf-form--grow"
>
...
...
public/app/plugins/datasource/stackdriver/components/Help.tsx
View file @
dc7f98de
...
@@ -18,11 +18,11 @@ export class Help extends React.Component<Props, State> {
...
@@ -18,11 +18,11 @@ export class Help extends React.Component<Props, State> {
displaRawQuery
:
false
,
displaRawQuery
:
false
,
};
};
handle
HelpClicked
()
{
on
HelpClicked
()
{
this
.
setState
({
displayHelp
:
!
this
.
state
.
displayHelp
});
this
.
setState
({
displayHelp
:
!
this
.
state
.
displayHelp
});
}
}
handle
RawQueryClicked
()
{
on
RawQueryClicked
()
{
this
.
setState
({
displaRawQuery
:
!
this
.
state
.
displaRawQuery
});
this
.
setState
({
displaRawQuery
:
!
this
.
state
.
displaRawQuery
});
}
}
...
@@ -38,7 +38,7 @@ export class Help extends React.Component<Props, State> {
...
@@ -38,7 +38,7 @@ export class Help extends React.Component<Props, State> {
<>
<>
<
div
className=
"gf-form-inline"
>
<
div
className=
"gf-form-inline"
>
<
Project
datasource=
{
datasource
}
/>
<
Project
datasource=
{
datasource
}
/>
<
div
className=
"gf-form"
onClick=
{
()
=>
this
.
handle
HelpClicked
()
}
>
<
div
className=
"gf-form"
onClick=
{
()
=>
this
.
on
HelpClicked
()
}
>
<
label
className=
"gf-form-label query-keyword"
>
<
label
className=
"gf-form-label query-keyword"
>
Show Help
Show Help
<
i
className=
{
`fa fa-caret-${displayHelp ? 'down' : 'right'}`
}
/>
<
i
className=
{
`fa fa-caret-${displayHelp ? 'down' : 'right'}`
}
/>
...
@@ -46,7 +46,7 @@ export class Help extends React.Component<Props, State> {
...
@@ -46,7 +46,7 @@ export class Help extends React.Component<Props, State> {
</
div
>
</
div
>
{
rawQuery
&&
(
{
rawQuery
&&
(
<
div
className=
"gf-form"
onClick=
{
()
=>
this
.
handle
RawQueryClicked
()
}
>
<
div
className=
"gf-form"
onClick=
{
()
=>
this
.
on
RawQueryClicked
()
}
>
<
label
className=
"gf-form-label query-keyword"
>
<
label
className=
"gf-form-label query-keyword"
>
Raw Query
Raw Query
<
i
className=
{
`fa fa-caret-${displaRawQuery ? 'down' : 'right'}`
}
ng
-
show=
"ctrl.showHelp"
/>
<
i
className=
{
`fa fa-caret-${displaRawQuery ? 'down' : 'right'}`
}
ng
-
show=
"ctrl.showHelp"
/>
...
...
public/app/plugins/datasource/stackdriver/components/Metrics.tsx
View file @
dc7f98de
...
@@ -98,7 +98,7 @@ export class Metrics extends React.Component<Props, State> {
...
@@ -98,7 +98,7 @@ export class Metrics extends React.Component<Props, State> {
return
metricsByService
;
return
metricsByService
;
}
}
handle
ServiceChange
(
service
)
{
on
ServiceChange
(
service
)
{
const
{
metricDescriptors
}
=
this
.
state
;
const
{
metricDescriptors
}
=
this
.
state
;
const
{
templateSrv
,
metricType
}
=
this
.
props
;
const
{
templateSrv
,
metricType
}
=
this
.
props
;
...
@@ -112,11 +112,11 @@ export class Metrics extends React.Component<Props, State> {
...
@@ -112,11 +112,11 @@ export class Metrics extends React.Component<Props, State> {
this
.
setState
({
service
,
metrics
});
this
.
setState
({
service
,
metrics
});
if
(
metrics
.
length
>
0
&&
!
metrics
.
some
(
m
=>
m
.
value
===
templateSrv
.
replace
(
metricType
)))
{
if
(
metrics
.
length
>
0
&&
!
metrics
.
some
(
m
=>
m
.
value
===
templateSrv
.
replace
(
metricType
)))
{
this
.
handle
MetricTypeChange
(
metrics
[
0
].
value
);
this
.
on
MetricTypeChange
(
metrics
[
0
].
value
);
}
}
}
}
handle
MetricTypeChange
(
value
)
{
on
MetricTypeChange
(
value
)
{
const
metricDescriptor
=
this
.
getSelectedMetricDescriptor
(
value
);
const
metricDescriptor
=
this
.
getSelectedMetricDescriptor
(
value
);
this
.
setState
({
metricDescriptor
});
this
.
setState
({
metricDescriptor
});
this
.
props
.
onChange
({
...
metricDescriptor
,
type
:
value
});
this
.
props
.
onChange
({
...
metricDescriptor
,
type
:
value
});
...
@@ -151,7 +151,7 @@ export class Metrics extends React.Component<Props, State> {
...
@@ -151,7 +151,7 @@ export class Metrics extends React.Component<Props, State> {
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
<
span
className=
"gf-form-label width-9 query-keyword"
>
Service
</
span
>
<
span
className=
"gf-form-label width-9 query-keyword"
>
Service
</
span
>
<
MetricSelect
<
MetricSelect
onChange=
{
value
=>
this
.
handle
ServiceChange
(
value
)
}
onChange=
{
value
=>
this
.
on
ServiceChange
(
value
)
}
value=
{
service
}
value=
{
service
}
options=
{
services
}
options=
{
services
}
isSearchable=
{
false
}
isSearchable=
{
false
}
...
@@ -167,7 +167,7 @@ export class Metrics extends React.Component<Props, State> {
...
@@ -167,7 +167,7 @@ export class Metrics extends React.Component<Props, State> {
<
div
className=
"gf-form"
>
<
div
className=
"gf-form"
>
<
span
className=
"gf-form-label width-9 query-keyword"
>
Metric
</
span
>
<
span
className=
"gf-form-label width-9 query-keyword"
>
Metric
</
span
>
<
MetricSelect
<
MetricSelect
onChange=
{
value
=>
this
.
handle
MetricTypeChange
(
value
)
}
onChange=
{
value
=>
this
.
on
MetricTypeChange
(
value
)
}
value=
{
metricType
}
value=
{
metricType
}
variables=
{
templateSrv
.
variables
}
variables=
{
templateSrv
.
variables
}
options=
{
[
options=
{
[
...
...
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx
View file @
dc7f98de
...
@@ -91,7 +91,7 @@ export class QueryEditor extends React.Component<Props, State> {
...
@@ -91,7 +91,7 @@ export class QueryEditor extends React.Component<Props, State> {
this
.
setState
({
lastQuery
,
lastQueryError
});
this
.
setState
({
lastQuery
,
lastQueryError
});
}
}
handle
MetricTypeChange
({
valueType
,
metricKind
,
type
,
unit
})
{
on
MetricTypeChange
({
valueType
,
metricKind
,
type
,
unit
})
{
const
{
datasource
,
onQueryChange
,
onExecuteQuery
}
=
this
.
props
;
const
{
datasource
,
onQueryChange
,
onExecuteQuery
}
=
this
.
props
;
const
{
perSeriesAligner
,
alignOptions
}
=
getAlignmentPickerData
(
const
{
perSeriesAligner
,
alignOptions
}
=
getAlignmentPickerData
(
{
valueType
,
metricKind
,
perSeriesAligner
:
this
.
state
.
perSeriesAligner
},
{
valueType
,
metricKind
,
perSeriesAligner
:
this
.
state
.
perSeriesAligner
},
...
@@ -113,7 +113,7 @@ export class QueryEditor extends React.Component<Props, State> {
...
@@ -113,7 +113,7 @@ export class QueryEditor extends React.Component<Props, State> {
);
);
}
}
handle
Change
(
prop
,
value
)
{
onProperty
Change
(
prop
,
value
)
{
this
.
setState
({
[
prop
]:
value
},
()
=>
{
this
.
setState
({
[
prop
]:
value
},
()
=>
{
this
.
props
.
onQueryChange
(
this
.
state
);
this
.
props
.
onQueryChange
(
this
.
state
);
this
.
props
.
onExecuteQuery
();
this
.
props
.
onExecuteQuery
();
...
@@ -144,13 +144,13 @@ export class QueryEditor extends React.Component<Props, State> {
...
@@ -144,13 +144,13 @@ export class QueryEditor extends React.Component<Props, State> {
metricType=
{
metricType
}
metricType=
{
metricType
}
templateSrv=
{
datasource
.
templateSrv
}
templateSrv=
{
datasource
.
templateSrv
}
datasource=
{
datasource
}
datasource=
{
datasource
}
onChange=
{
value
=>
this
.
handle
MetricTypeChange
(
value
)
}
onChange=
{
value
=>
this
.
on
MetricTypeChange
(
value
)
}
>
>
{
metric
=>
(
{
metric
=>
(
<>
<>
<
Filter
<
Filter
filtersChanged=
{
value
=>
this
.
handle
Change
(
'filters'
,
value
)
}
filtersChanged=
{
value
=>
this
.
onProperty
Change
(
'filters'
,
value
)
}
groupBysChanged=
{
value
=>
this
.
handle
Change
(
'groupBys'
,
value
)
}
groupBysChanged=
{
value
=>
this
.
onProperty
Change
(
'groupBys'
,
value
)
}
filters=
{
filters
}
filters=
{
filters
}
groupBys=
{
groupBys
}
groupBys=
{
groupBys
}
refId=
{
refId
}
refId=
{
refId
}
...
@@ -164,7 +164,7 @@ export class QueryEditor extends React.Component<Props, State> {
...
@@ -164,7 +164,7 @@ export class QueryEditor extends React.Component<Props, State> {
templateSrv=
{
datasource
.
templateSrv
}
templateSrv=
{
datasource
.
templateSrv
}
crossSeriesReducer=
{
crossSeriesReducer
}
crossSeriesReducer=
{
crossSeriesReducer
}
groupBys=
{
groupBys
}
groupBys=
{
groupBys
}
onChange=
{
value
=>
this
.
handle
Change
(
'crossSeriesReducer'
,
value
)
}
onChange=
{
value
=>
this
.
onProperty
Change
(
'crossSeriesReducer'
,
value
)
}
>
>
{
displayAdvancedOptions
=>
{
displayAdvancedOptions
=>
displayAdvancedOptions
&&
(
displayAdvancedOptions
&&
(
...
@@ -172,16 +172,16 @@ export class QueryEditor extends React.Component<Props, State> {
...
@@ -172,16 +172,16 @@ export class QueryEditor extends React.Component<Props, State> {
alignOptions=
{
alignOptions
}
alignOptions=
{
alignOptions
}
templateSrv=
{
datasource
.
templateSrv
}
templateSrv=
{
datasource
.
templateSrv
}
perSeriesAligner=
{
perSeriesAligner
}
perSeriesAligner=
{
perSeriesAligner
}
onChange=
{
value
=>
this
.
handle
Change
(
'perSeriesAligner'
,
value
)
}
onChange=
{
value
=>
this
.
onProperty
Change
(
'perSeriesAligner'
,
value
)
}
/>
/>
)
)
}
}
</
Aggregations
>
</
Aggregations
>
<
AliasBy
value=
{
aliasBy
}
onChange=
{
value
=>
this
.
handle
Change
(
'aliasBy'
,
value
)
}
/>
<
AliasBy
value=
{
aliasBy
}
onChange=
{
value
=>
this
.
onProperty
Change
(
'aliasBy'
,
value
)
}
/>
<
AlignmentPeriods
<
AlignmentPeriods
templateSrv=
{
datasource
.
templateSrv
}
templateSrv=
{
datasource
.
templateSrv
}
alignmentPeriod=
{
alignmentPeriod
}
alignmentPeriod=
{
alignmentPeriod
}
onChange=
{
value
=>
this
.
handle
Change
(
'alignmentPeriod'
,
value
)
}
onChange=
{
value
=>
this
.
onProperty
Change
(
'alignmentPeriod'
,
value
)
}
/>
/>
<
Help
datasource=
{
datasource
}
rawQuery=
{
lastQuery
}
lastQueryError=
{
lastQueryError
}
/>
<
Help
datasource=
{
datasource
}
rawQuery=
{
lastQuery
}
lastQueryError=
{
lastQueryError
}
/>
</>
</>
...
...
public/app/plugins/datasource/stackdriver/components/VariableQueryEditor.tsx
View file @
dc7f98de
...
@@ -63,7 +63,7 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
...
@@ -63,7 +63,7 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
this
.
setState
(
state
);
this
.
setState
(
state
);
}
}
async
handle
QueryTypeChange
(
event
)
{
async
on
QueryTypeChange
(
event
)
{
const
state
:
any
=
{
const
state
:
any
=
{
selectedQueryType
:
event
.
target
.
value
,
selectedQueryType
:
event
.
target
.
value
,
...
await
this
.
getLabels
(
this
.
state
.
selectedMetricType
,
event
.
target
.
value
),
...
await
this
.
getLabels
(
this
.
state
.
selectedMetricType
,
event
.
target
.
value
),
...
@@ -186,7 +186,7 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
...
@@ -186,7 +186,7 @@ export class StackdriverVariableQueryEditor extends PureComponent<VariableQueryP
<
SimpleSelect
<
SimpleSelect
value=
{
this
.
state
.
selectedQueryType
}
value=
{
this
.
state
.
selectedQueryType
}
options=
{
this
.
queryTypes
}
options=
{
this
.
queryTypes
}
onValueChange=
{
e
=>
this
.
handle
QueryTypeChange
(
e
)
}
onValueChange=
{
e
=>
this
.
on
QueryTypeChange
(
e
)
}
label=
"Query Type"
label=
"Query Type"
/>
/>
{
this
.
renderQueryTypeSwitch
(
this
.
state
.
selectedQueryType
)
}
{
this
.
renderQueryTypeSwitch
(
this
.
state
.
selectedQueryType
)
}
...
...
public/app/plugins/datasource/stackdriver/partials/annotations.editor.html
View file @
dc7f98de
<annotation-query-editor
<annotation-query-editor
target=
"ctrl.annotation.target"
target=
"ctrl.annotation.target"
on-query-change=
"(ctrl.
handle
QueryChange)"
on-query-change=
"(ctrl.
on
QueryChange)"
datasource=
"ctrl.datasource"
datasource=
"ctrl.datasource"
></annotation-query-editor>
></annotation-query-editor>
public/app/plugins/datasource/stackdriver/partials/query.editor.html
View file @
dc7f98de
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
target=
"ctrl.target"
target=
"ctrl.target"
events=
"ctrl.panelCtrl.events"
events=
"ctrl.panelCtrl.events"
datasource=
"ctrl.datasource"
datasource=
"ctrl.datasource"
on-query-change=
"(ctrl.
handle
QueryChange)"
on-query-change=
"(ctrl.
on
QueryChange)"
on-execute-query=
"(ctrl.
handle
ExecuteQuery)"
on-execute-query=
"(ctrl.
on
ExecuteQuery)"
></query-editor>
></query-editor>
</query-editor-row>
</query-editor-row>
public/app/plugins/datasource/stackdriver/query_ctrl.ts
View file @
dc7f98de
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
{
QueryCtrl
}
from
'app/plugins/sdk'
;
import
{
QueryCtrl
}
from
'app/plugins/sdk'
;
import
{
react2AngularDirective
}
from
'app/core/utils/react2angular'
;
import
{
QueryEditor
}
from
'./components/QueryEditor'
;
import
{
Target
}
from
'./types'
;
import
{
Target
}
from
'./types'
;
export
class
StackdriverQueryCtrl
extends
QueryCtrl
{
export
class
StackdriverQueryCtrl
extends
QueryCtrl
{
...
@@ -12,22 +9,15 @@ export class StackdriverQueryCtrl extends QueryCtrl {
...
@@ -12,22 +9,15 @@ export class StackdriverQueryCtrl extends QueryCtrl {
/** @ngInject */
/** @ngInject */
constructor
(
$scope
,
$injector
)
{
constructor
(
$scope
,
$injector
)
{
super
(
$scope
,
$injector
);
super
(
$scope
,
$injector
);
this
.
handleQueryChange
=
this
.
handleQueryChange
.
bind
(
this
);
this
.
onQueryChange
=
this
.
onQueryChange
.
bind
(
this
);
this
.
handleExecuteQuery
=
this
.
handleExecuteQuery
.
bind
(
this
);
this
.
onExecuteQuery
=
this
.
onExecuteQuery
.
bind
(
this
);
react2AngularDirective
(
'queryEditor'
,
QueryEditor
,
[
'target'
,
'onQueryChange'
,
'onExecuteQuery'
,
[
'events'
,
{
watchDepth
:
'reference'
}],
[
'datasource'
,
{
watchDepth
:
'reference'
}],
]);
}
}
handle
QueryChange
(
target
:
Target
)
{
on
QueryChange
(
target
:
Target
)
{
Object
.
assign
(
this
.
target
,
target
);
Object
.
assign
(
this
.
target
,
target
);
}
}
handle
ExecuteQuery
()
{
on
ExecuteQuery
()
{
this
.
$scope
.
ctrl
.
refresh
();
this
.
$scope
.
ctrl
.
refresh
();
}
}
}
}
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