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
8497c854
Commit
8497c854
authored
Dec 12, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding mixed query
parent
87e6f86f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
public/app/features/dashboard/dashgrid/QueriesTab.tsx
+8
-5
public/app/features/dashboard/panel_model.ts
+3
-2
public/app/plugins/datasource/prometheus/partials/query.editor.html
+2
-3
No files found.
public/app/features/dashboard/dashgrid/QueriesTab.tsx
View file @
8497c854
...
...
@@ -236,14 +236,14 @@ export class QueriesTab extends PureComponent<Props, State> {
return
isLoadingHelp
?
<
LoadingPlaceholder
text=
"Loading help..."
/>
:
helpContent
;
};
onAddQuery
=
(
query
?:
DataQuery
)
=>
{
onAddQuery
=
(
query
?:
Partial
<
DataQuery
>
)
=>
{
this
.
props
.
panel
.
addQuery
(
query
);
this
.
forceUpdate
();
};
onAddQueryClick
=
()
=>
{
if
(
this
.
state
.
currentDS
.
meta
.
mixed
)
{
this
.
setState
({
isAddingMixed
:
true
})
this
.
setState
({
isAddingMixed
:
true
})
;
return
;
}
...
...
@@ -284,8 +284,6 @@ export class QueriesTab extends PureComponent<Props, State> {
};
renderMixedPicker
=
()
=>
{
const
{
currentDS
}
=
this
.
state
;
return
(
<
DataSourcePicker
datasources=
{
this
.
datasources
}
...
...
@@ -299,6 +297,7 @@ export class QueriesTab extends PureComponent<Props, State> {
onAddMixedQuery
=
datasource
=>
{
this
.
onAddQuery
({
datasource
:
datasource
.
name
});
this
.
component
.
digest
();
this
.
setState
({
isAddingMixed
:
false
});
};
...
...
@@ -348,7 +347,11 @@ export class QueriesTab extends PureComponent<Props, State> {
</
span
>
<
span
className=
"gf-form-query-letter-cell-letter"
>
{
panel
.
getNextQueryLetter
()
}
</
span
>
</
label
>
{
!
isAddingMixed
&&
<
button
className=
"btn btn-secondary gf-form-btn"
onClick=
{
this
.
onAddQueryClick
}
>
Add Query
</
button
>
}
{
!
isAddingMixed
&&
(
<
button
className=
"btn btn-secondary gf-form-btn"
onClick=
{
this
.
onAddQueryClick
}
>
Add Query
</
button
>
)
}
{
isAddingMixed
&&
this
.
renderMixedPicker
()
}
</
div
>
</
div
>
...
...
public/app/features/dashboard/panel_model.ts
View file @
8497c854
...
...
@@ -238,9 +238,10 @@ export class PanelModel {
this
.
restorePanelOptions
(
pluginId
);
}
addQuery
(
query
?:
DataQuery
)
{
addQuery
(
query
?:
Partial
<
DataQuery
>
)
{
query
=
query
||
{
refId
:
'A'
};
(
query
.
refId
=
this
.
getNextQueryLetter
()),
(
query
.
isNew
=
true
);
query
.
refId
=
this
.
getNextQueryLetter
();
query
.
isNew
=
true
;
this
.
targets
.
push
(
query
);
}
...
...
public/app/plugins/datasource/prometheus/partials/query.editor.html
View file @
8497c854
...
...
@@ -8,7 +8,7 @@
</div>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form
max-width-26
"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-8"
>
Legend format
</label>
<input
type=
"text"
class=
"gf-form-input"
ng-model=
"ctrl.target.legendFormat"
spellcheck=
'false'
placeholder=
"legend format"
data-min-length=
0
data-items=
1000
ng-model-onblur
ng-change=
"ctrl.refreshMetricData()"
>
...
...
@@ -58,4 +58,4 @@
<div
class=
"gf-form-label gf-form-label--grow"
></div>
</div>
</div>
</query-editor-row>
\ No newline at end of file
</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