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
0302c7af
Commit
0302c7af
authored
Feb 05, 2019
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: add some more typings
parent
6eb69d37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
20 deletions
+25
-20
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx
+4
-4
public/app/plugins/datasource/stackdriver/datasource.ts
+4
-3
public/app/plugins/datasource/stackdriver/query_ctrl.ts
+2
-2
public/app/plugins/datasource/stackdriver/types.ts
+15
-11
No files found.
public/app/plugins/datasource/stackdriver/components/QueryEditor.tsx
View file @
0302c7af
...
...
@@ -10,21 +10,21 @@ import { Alignments } from './Alignments';
import
{
AlignmentPeriods
}
from
'./AlignmentPeriods'
;
import
{
AliasBy
}
from
'./AliasBy'
;
import
{
Help
}
from
'./Help'
;
import
{
Target
,
MetricDescriptor
}
from
'../types'
;
import
{
StackdriverQuery
,
MetricDescriptor
}
from
'../types'
;
import
{
getAlignmentPickerData
}
from
'../functions'
;
import
StackdriverDatasource
from
'../datasource'
;
import
{
SelectOptionItem
}
from
'@grafana/ui'
;
export
interface
Props
{
onQueryChange
:
(
target
:
Target
)
=>
void
;
onQueryChange
:
(
target
:
StackdriverQuery
)
=>
void
;
onExecuteQuery
:
()
=>
void
;
target
:
Target
;
target
:
StackdriverQuery
;
events
:
any
;
datasource
:
StackdriverDatasource
;
templateSrv
:
TemplateSrv
;
}
interface
State
extends
Target
{
interface
State
extends
StackdriverQuery
{
alignOptions
:
SelectOptionItem
[];
lastQuery
:
string
;
lastQueryError
:
string
;
...
...
public/app/plugins/datasource/stackdriver/datasource.ts
View file @
0302c7af
...
...
@@ -2,9 +2,10 @@ import { stackdriverUnitMappings } from './constants';
import
appEvents
from
'app/core/app_events'
;
import
_
from
'lodash'
;
import
StackdriverMetricFindQuery
from
'./StackdriverMetricFindQuery'
;
import
{
MetricDescriptor
}
from
'./types'
;
import
{
StackdriverQuery
,
MetricDescriptor
}
from
'./types'
;
import
{
DataSourceApi
,
DataQueryOptions
}
from
'@grafana/ui/src/types'
;
export
default
class
StackdriverDatasource
{
export
default
class
StackdriverDatasource
implements
DataSourceApi
<
StackdriverQuery
>
{
id
:
number
;
url
:
string
;
baseUrl
:
string
;
...
...
@@ -103,7 +104,7 @@ export default class StackdriverDatasource {
return
unit
;
}
async
query
(
options
)
{
async
query
(
options
:
DataQueryOptions
<
StackdriverQuery
>
)
{
const
result
=
[];
const
data
=
await
this
.
getTimeSeries
(
options
);
if
(
data
.
results
)
{
...
...
public/app/plugins/datasource/stackdriver/query_ctrl.ts
View file @
0302c7af
import
_
from
'lodash'
;
import
{
QueryCtrl
}
from
'app/plugins/sdk'
;
import
{
Target
}
from
'./types'
;
import
{
StackdriverQuery
}
from
'./types'
;
import
{
TemplateSrv
}
from
'app/features/templating/template_srv'
;
export
class
StackdriverQueryCtrl
extends
QueryCtrl
{
...
...
@@ -16,7 +16,7 @@ export class StackdriverQueryCtrl extends QueryCtrl {
this
.
onExecuteQuery
=
this
.
onExecuteQuery
.
bind
(
this
);
}
onQueryChange
(
target
:
Target
)
{
onQueryChange
(
target
:
StackdriverQuery
)
{
Object
.
assign
(
this
.
target
,
target
);
}
...
...
public/app/plugins/datasource/stackdriver/types.ts
View file @
0302c7af
import
{
DataQuery
}
from
'@grafana/ui/src/types'
;
export
enum
MetricFindQueryTypes
{
Services
=
'services'
,
MetricTypes
=
'metricTypes'
,
...
...
@@ -20,20 +22,22 @@ export interface VariableQueryData {
services
:
Array
<
{
value
:
string
;
name
:
string
}
>
;
}
export
interface
Target
{
defaultProject
:
string
;
unit
:
string
;
export
interface
StackdriverQuery
extends
DataQuery
{
defaultProject
?
:
string
;
unit
?
:
string
;
metricType
:
string
;
service
:
string
;
service
?
:
string
;
refId
:
string
;
crossSeriesReducer
:
string
;
alignmentPeriod
:
string
;
perSeriesAligner
:
string
;
groupBys
:
string
[];
filters
:
string
[];
aliasBy
:
string
;
metricKind
:
string
;
valueType
:
string
;
alignmentPeriod
?:
string
;
perSeriesAligner
?:
string
;
groupBys
?:
string
[];
filters
?:
string
[];
aliasBy
?:
string
;
metricKind
?:
string
;
valueType
?:
string
;
datasourceId
:
number
;
view
:
string
;
}
export
interface
AnnotationTarget
{
...
...
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