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
18abb87c
Commit
18abb87c
authored
Jan 14, 2019
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: small fixes after reactifying
parent
b4a51ad7
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
40 deletions
+35
-40
public/app/core/angular_wrappers.ts
+4
-4
public/app/plugins/datasource/stackdriver/components/Aggregations.tsx
+4
-4
public/app/plugins/datasource/stackdriver/components/AliasBy.tsx
+3
-8
public/app/plugins/datasource/stackdriver/components/AlignmentPeriods.tsx
+1
-1
public/app/plugins/datasource/stackdriver/components/Alignments.tsx
+1
-1
public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx
+3
-3
public/app/plugins/datasource/stackdriver/components/Help.tsx
+6
-6
public/app/plugins/datasource/stackdriver/components/Metrics.tsx
+6
-6
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx
+3
-3
public/app/plugins/datasource/stackdriver/partials/annotations.editor.html
+2
-2
public/app/plugins/datasource/stackdriver/partials/query.editor.html
+2
-2
No files found.
public/app/core/angular_wrappers.ts
View file @
18abb87c
import
{
react2AngularDirective
}
from
'app/core/utils/react2angular'
;
import
{
QueryEditor
}
from
'app/plugins/datasource/stackdriver/components/QueryEditor'
;
import
{
AnnotationQueryEditor
}
from
'app/plugins/datasource/stackdriver/components/AnnotationQueryEditor'
;
import
{
QueryEditor
as
StackdriverQueryEditor
}
from
'app/plugins/datasource/stackdriver/components/QueryEditor'
;
import
{
AnnotationQueryEditor
as
StackdriverAnnotationQueryEditor
}
from
'app/plugins/datasource/stackdriver/components/AnnotationQueryEditor'
;
import
{
PasswordStrength
}
from
'./components/PasswordStrength'
;
import
PageHeader
from
'./components/PageHeader/PageHeader'
;
import
EmptyListCTA
from
'./components/EmptyListCTA/EmptyListCTA'
;
...
...
@@ -41,7 +41,7 @@ export function registerAngularDirectives() {
'placeholder'
,
[
'variables'
,
{
watchDepth
:
'reference'
}],
]);
react2AngularDirective
(
'
queryEditor'
,
QueryEditor
,
[
react2AngularDirective
(
'
stackdriverQueryEditor'
,
Stackdriver
QueryEditor
,
[
'target'
,
'onQueryChange'
,
'onExecuteQuery'
,
...
...
@@ -49,7 +49,7 @@ export function registerAngularDirectives() {
[
'datasource'
,
{
watchDepth
:
'reference'
}],
[
'templateSrv'
,
{
watchDepth
:
'reference'
}],
]);
react2AngularDirective
(
'
annotationQueryEditor'
,
AnnotationQueryEditor
,
[
react2AngularDirective
(
'
stackdriverAnnotationQueryEditor'
,
Stackdriver
AnnotationQueryEditor
,
[
'target'
,
'onQueryChange'
,
'onExecuteQuery'
,
...
...
public/app/plugins/datasource/stackdriver/components/Aggregations.tsx
View file @
18abb87c
...
...
@@ -52,11 +52,11 @@ export class Aggregations extends React.Component<Props, State> {
this
.
setState
({
aggOptions
});
}
onToggleDisplayAdvanced
()
{
onToggleDisplayAdvanced
=
()
=>
{
this
.
setState
(
state
=>
({
displayAdvancedOptions
:
!
state
.
displayAdvancedOptions
,
}));
}
}
;
render
()
{
const
{
displayAdvancedOptions
,
aggOptions
}
=
this
.
state
;
...
...
@@ -68,7 +68,7 @@ export class Aggregations extends React.Component<Props, State> {
<
div
className=
"gf-form"
>
<
label
className=
"gf-form-label query-keyword width-9"
>
Aggregation
</
label
>
<
MetricSelect
onChange=
{
value
=>
onChange
(
value
)
}
onChange=
{
onChange
}
value=
{
crossSeriesReducer
}
variables=
{
templateSrv
.
variables
}
options=
{
aggOptions
}
...
...
@@ -78,7 +78,7 @@ export class Aggregations extends React.Component<Props, State> {
</
div
>
<
div
className=
"gf-form gf-form--grow"
>
<
label
className=
"gf-form-label gf-form-label--grow"
>
<
a
onClick=
{
()
=>
this
.
onToggleDisplayAdvanced
()
}
>
<
a
onClick=
{
this
.
onToggleDisplayAdvanced
}
>
<>
<
i
className=
{
`fa fa-caret-${displayAdvancedOptions ? 'down' : 'right'}`
}
/>
Advanced Options
</>
...
...
public/app/plugins/datasource/stackdriver/components/AliasBy.tsx
View file @
18abb87c
...
...
@@ -29,10 +29,10 @@ export class AliasBy extends Component<Props, State> {
}
}
onChange
(
e
)
{
onChange
=
e
=>
{
this
.
setState
({
value
:
e
.
target
.
value
});
this
.
propagateOnChange
(
e
.
target
.
value
);
}
}
;
render
()
{
return
(
...
...
@@ -40,12 +40,7 @@ export class AliasBy extends Component<Props, State> {
<
div
className=
"gf-form-inline"
>
<
div
className=
"gf-form"
>
<
label
className=
"gf-form-label query-keyword width-9"
>
Alias By
</
label
>
<
input
type=
"text"
className=
"gf-form-input width-24"
value=
{
this
.
state
.
value
}
onChange=
{
e
=>
this
.
onChange
(
e
)
}
/>
<
input
type=
"text"
className=
"gf-form-input width-24"
value=
{
this
.
state
.
value
}
onChange=
{
this
.
onChange
}
/>
</
div
>
<
div
className=
"gf-form gf-form--grow"
>
<
div
className=
"gf-form-label gf-form-label--grow"
/>
...
...
public/app/plugins/datasource/stackdriver/components/AlignmentPeriods.tsx
View file @
18abb87c
...
...
@@ -29,7 +29,7 @@ export const AlignmentPeriods: SFC<Props> = ({
<
div
className=
"gf-form"
>
<
label
className=
"gf-form-label query-keyword width-9"
>
Alignment Period
</
label
>
<
MetricSelect
onChange=
{
value
=>
onChange
(
value
)
}
onChange=
{
onChange
}
value=
{
alignmentPeriod
}
variables=
{
templateSrv
.
variables
}
options=
{
[
...
...
public/app/plugins/datasource/stackdriver/components/Alignments.tsx
View file @
18abb87c
...
...
@@ -17,7 +17,7 @@ export const Alignments: SFC<Props> = ({ perSeriesAligner, templateSrv, onChange
<
div
className=
"gf-form offset-width-9"
>
<
label
className=
"gf-form-label query-keyword width-15"
>
Aligner
</
label
>
<
MetricSelect
onChange=
{
value
=>
onChange
(
value
)
}
onChange=
{
onChange
}
value=
{
perSeriesAligner
}
variables=
{
templateSrv
.
variables
}
options=
{
alignOptions
}
...
...
public/app/plugins/datasource/stackdriver/components/AnnotationQueryEditor.tsx
View file @
18abb87c
...
...
@@ -40,7 +40,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
});
}
onMetricTypeChange
({
valueType
,
metricKind
,
type
,
unit
})
{
onMetricTypeChange
=
({
valueType
,
metricKind
,
type
,
unit
})
=>
{
const
{
onQueryChange
}
=
this
.
props
;
this
.
setState
(
{
...
...
@@ -53,7 +53,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
onQueryChange
(
this
.
state
);
}
);
}
}
;
onChange
(
prop
,
value
)
{
this
.
setState
({
[
prop
]:
value
},
()
=>
{
...
...
@@ -72,7 +72,7 @@ export class AnnotationQueryEditor extends React.Component<Props, State> {
metricType=
{
metricType
}
templateSrv=
{
templateSrv
}
datasource=
{
datasource
}
onChange=
{
value
=>
this
.
onMetricTypeChange
(
value
)
}
onChange=
{
this
.
onMetricTypeChange
}
>
{
metric
=>
(
<>
...
...
public/app/plugins/datasource/stackdriver/components/Help.tsx
View file @
18abb87c
...
...
@@ -19,13 +19,13 @@ export class Help extends React.Component<Props, State> {
displaRawQuery
:
false
,
};
onHelpClicked
()
{
onHelpClicked
=
()
=>
{
this
.
setState
({
displayHelp
:
!
this
.
state
.
displayHelp
});
}
}
;
onRawQueryClicked
()
{
onRawQueryClicked
=
()
=>
{
this
.
setState
({
displaRawQuery
:
!
this
.
state
.
displaRawQuery
});
}
}
;
shouldComponentUpdate
(
nextProps
)
{
return
nextProps
.
metricDescriptor
!==
null
;
...
...
@@ -39,14 +39,14 @@ export class Help extends React.Component<Props, State> {
<>
<
div
className=
"gf-form-inline"
>
<
Project
datasource=
{
datasource
}
/>
<
div
className=
"gf-form"
onClick=
{
()
=>
this
.
onHelpClicked
()
}
>
<
div
className=
"gf-form"
onClick=
{
this
.
onHelpClicked
}
>
<
label
className=
"gf-form-label query-keyword pointer"
>
Show Help
<
i
className=
{
`fa fa-caret-${displayHelp ? 'down' : 'right'}`
}
/>
</
label
>
</
div
>
{
rawQuery
&&
(
<
div
className=
"gf-form"
onClick=
{
()
=>
this
.
onRawQueryClicked
()
}
>
<
div
className=
"gf-form"
onClick=
{
this
.
onRawQueryClicked
}
>
<
label
className=
"gf-form-label query-keyword"
>
Raw Query
<
i
className=
{
`fa fa-caret-${displaRawQuery ? 'down' : 'right'}`
}
ng
-
show=
"ctrl.showHelp"
/>
</
label
>
...
...
public/app/plugins/datasource/stackdriver/components/Metrics.tsx
View file @
18abb87c
...
...
@@ -100,7 +100,7 @@ export class Metrics extends React.Component<Props, State> {
return
metricsByService
;
}
onServiceChange
(
service
)
{
onServiceChange
=
service
=>
{
const
{
metricDescriptors
}
=
this
.
state
;
const
{
templateSrv
,
metricType
}
=
this
.
props
;
...
...
@@ -116,13 +116,13 @@ export class Metrics extends React.Component<Props, State> {
if
(
metrics
.
length
>
0
&&
!
metrics
.
some
(
m
=>
m
.
value
===
templateSrv
.
replace
(
metricType
)))
{
this
.
onMetricTypeChange
(
metrics
[
0
].
value
);
}
}
}
;
onMetricTypeChange
(
value
)
{
onMetricTypeChange
=
value
=>
{
const
metricDescriptor
=
this
.
getSelectedMetricDescriptor
(
value
);
this
.
setState
({
metricDescriptor
});
this
.
props
.
onChange
({
...
metricDescriptor
,
type
:
value
});
}
}
;
getServicesList
(
metricDescriptors
:
MetricDescriptor
[])
{
const
services
=
metricDescriptors
.
map
(
m
=>
({
...
...
@@ -153,7 +153,7 @@ export class Metrics extends React.Component<Props, State> {
<
div
className=
"gf-form"
>
<
span
className=
"gf-form-label width-9 query-keyword"
>
Service
</
span
>
<
MetricSelect
onChange=
{
value
=>
this
.
onServiceChange
(
value
)
}
onChange=
{
this
.
onServiceChange
}
value=
{
service
}
options=
{
services
}
isSearchable=
{
false
}
...
...
@@ -169,7 +169,7 @@ export class Metrics extends React.Component<Props, State> {
<
div
className=
"gf-form"
>
<
span
className=
"gf-form-label width-9 query-keyword"
>
Metric
</
span
>
<
MetricSelect
onChange=
{
value
=>
this
.
onMetricTypeChange
(
value
)
}
onChange=
{
this
.
onMetricTypeChange
}
value=
{
metricType
}
variables=
{
templateSrv
.
variables
}
options=
{
[
...
...
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx
View file @
18abb87c
...
...
@@ -99,7 +99,7 @@ export class QueryEditor extends React.Component<Props, State> {
this
.
setState
({
lastQuery
,
lastQueryError
});
}
onMetricTypeChange
({
valueType
,
metricKind
,
type
,
unit
}:
MetricDescriptor
)
{
onMetricTypeChange
=
({
valueType
,
metricKind
,
type
,
unit
}:
MetricDescriptor
)
=>
{
const
{
templateSrv
,
onQueryChange
,
onExecuteQuery
}
=
this
.
props
;
const
{
perSeriesAligner
,
alignOptions
}
=
getAlignmentPickerData
(
{
valueType
,
metricKind
,
perSeriesAligner
:
this
.
state
.
perSeriesAligner
},
...
...
@@ -119,7 +119,7 @@ export class QueryEditor extends React.Component<Props, State> {
onExecuteQuery
();
}
);
}
}
;
onPropertyChange
(
prop
,
value
)
{
this
.
setState
({
[
prop
]:
value
},
()
=>
{
...
...
@@ -153,7 +153,7 @@ export class QueryEditor extends React.Component<Props, State> {
metricType=
{
metricType
}
templateSrv=
{
templateSrv
}
datasource=
{
datasource
}
onChange=
{
value
=>
this
.
onMetricTypeChange
(
value
)
}
onChange=
{
this
.
onMetricTypeChange
}
>
{
metric
=>
(
<>
...
...
public/app/plugins/datasource/stackdriver/partials/annotations.editor.html
View file @
18abb87c
<annotation-query-editor
<
stackdriver-
annotation-query-editor
target=
"ctrl.annotation.target"
on-query-change=
"(ctrl.onQueryChange)"
datasource=
"ctrl.datasource"
template-srv=
"ctrl.templateSrv"
></annotation-query-editor>
></
stackdriver-
annotation-query-editor>
public/app/plugins/datasource/stackdriver/partials/query.editor.html
View file @
18abb87c
<query-editor-row
query-ctrl=
"ctrl"
has-text-edit-mode=
"false"
>
<query-editor
<
stackdriver-
query-editor
target=
"ctrl.target"
events=
"ctrl.panelCtrl.events"
datasource=
"ctrl.datasource"
template-srv=
"ctrl.templateSrv"
on-query-change=
"(ctrl.onQueryChange)"
on-execute-query=
"(ctrl.onExecuteQuery)"
></query-editor>
></
stackdriver-
query-editor>
</query-editor-row>
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