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
1969ad41
Commit
1969ad41
authored
Oct 25, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stackdriver: refactor stackdriver query ctrl
parent
4f7d3fcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
public/app/features/plugins/pluginTemplateQueryComponentLoader.tsx
+2
-2
public/app/plugins/datasource/stackdriver/templateQueryCtrl.tsx
+21
-7
No files found.
public/app/features/plugins/pluginTemplateQueryComponentLoader.tsx
View file @
1969ad41
...
...
@@ -14,13 +14,13 @@ async function loadComponent(module) {
}
/** @ngInject */
function
pluginTemplateQueryComponentLoader
(
datasourceSrv
)
{
function
pluginTemplateQueryComponentLoader
()
{
return
{
restrict
:
'E'
,
link
:
async
(
scope
,
elem
)
=>
{
const
Component
=
await
loadComponent
(
scope
.
currentDatasource
.
meta
.
module
);
const
props
=
{
datasource
Srv
,
datasource
:
scope
.
currentDatasource
,
query
:
scope
.
current
.
query
,
onChange
:
scope
.
onQueryChange
,
};
...
...
public/app/plugins/datasource/stackdriver/templateQueryCtrl.tsx
View file @
1969ad41
import
React
,
{
PureComponent
}
from
'react'
;
import
DatasourceSrv
from
'app/features/plugins/datasource_srv
'
;
import
StackdriverDatasource
from
'./datasource
'
;
interface
Props
{
datasource
:
StackdriverDatasource
;
query
:
string
;
datasourceSrv
:
DatasourceSrv
;
isValid
:
any
;
onChange
:
(
c
:
string
)
=>
void
;
}
export
class
StackdriverTemplateQueryCtrl
extends
PureComponent
<
Props
>
{
export
class
StackdriverTemplateQueryCtrl
extends
PureComponent
<
Props
,
any
>
{
constructor
(
props
)
{
super
(
props
);
}
componentDidMount
()
{
console
.
log
(
'componentDidMount'
);
async
componentDidMount
()
{
const
metricDescriptors
=
await
this
.
props
.
datasource
.
getMetricTypes
(
this
.
props
.
datasource
.
projectName
);
console
.
log
(
metricDescriptors
);
}
render
()
{
return
<
h1
>
Hello Stackdriver Template Query
</
h1
>;
return
(
<
div
className=
"gf-form"
>
<
span
className=
"gf-form-label width-7"
>
Query
</
span
>
<
input
type=
"text"
className=
"gf-form-input"
// value={this.state.value}
// onChange={this.handleChange}
// onBlur={this.handleBlur}
placeholder=
"metric name or tags query"
required
/>
</
div
>
);
}
}
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