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
b30d3fb5
Commit
b30d3fb5
authored
Sep 14, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: makes sure filter dropdown doesnt crash if clicked before values are loaded
parent
fa6e31c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
public/app/plugins/datasource/stackdriver/query_ctrl.ts
+10
-4
No files found.
public/app/plugins/datasource/stackdriver/query_ctrl.ts
View file @
b30d3fb5
import
_
from
'lodash'
;
import
{
QueryCtrl
}
from
'app/plugins/sdk'
;
import
appEvents
from
'app/core/app_events'
;
import
{
primitiveSymbol
}
from
'mobx/lib/utils/utils'
;
export
interface
QueryMeta
{
rawQuery
:
string
;
...
...
@@ -30,6 +31,7 @@ export class StackdriverQueryCtrl extends QueryCtrl {
defaultFilterValue
=
'select value'
;
defaultRemoveGroupByValue
=
'-- remove group by --'
;
defaultRemoveFilterValue
=
'-- remove filter --'
;
initPromise
:
Promise
<
any
>
;
defaults
=
{
project
:
{
...
...
@@ -79,9 +81,12 @@ export class StackdriverQueryCtrl extends QueryCtrl {
this
.
panelCtrl
.
events
.
on
(
'data-received'
,
this
.
onDataReceived
.
bind
(
this
),
$scope
);
this
.
panelCtrl
.
events
.
on
(
'data-error'
,
this
.
onDataError
.
bind
(
this
),
$scope
);
this
.
getCurrentProject
()
.
then
(
this
.
getMetricTypes
.
bind
(
this
))
.
then
(
this
.
getLabels
.
bind
(
this
));
this
.
initPromise
=
new
Promise
(
async
resolve
=>
{
this
.
getCurrentProject
()
.
then
(
this
.
getMetricTypes
.
bind
(
this
))
.
then
(
this
.
getLabels
.
bind
(
this
))
.
then
(
resolve
);
});
this
.
initSegments
();
}
...
...
@@ -178,7 +183,8 @@ export class StackdriverQueryCtrl extends QueryCtrl {
this
.
getLabels
();
}
getGroupBys
(
segment
,
index
,
removeText
?:
string
,
removeUsed
=
true
)
{
async
getGroupBys
(
segment
,
index
,
removeText
?:
string
,
removeUsed
=
true
)
{
await
this
.
initPromise
;
const
metricLabels
=
Object
.
keys
(
this
.
metricLabels
)
.
filter
(
ml
=>
{
if
(
!
removeUsed
)
{
...
...
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