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
c771dd4b
Commit
c771dd4b
authored
Jun 13, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: metrics tab add query feature
parent
9ff4ab12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
35 deletions
+34
-35
public/app/features/panel/metrics_tab.ts
+8
-2
public/app/features/panel/partials/metrics_tab.html
+26
-33
No files found.
public/app/features/panel/metrics_tab.ts
View file @
c771dd4b
...
...
@@ -62,11 +62,17 @@ export class MetricsTabCtrl {
mixedDatasourceChanged
()
{
var
target
:
any
=
{
isNew
:
true
};
var
ds
=
_
.
find
(
this
.
datasources
,
{
name
:
this
.
mixedDsSegment
.
value
});
if
(
ds
)
{
target
.
datasource
=
ds
.
name
;
this
.
panelCtrl
.
addDataQuery
(
target
);
this
.
mixedDsSegment
.
value
=
''
;
this
.
panelCtrl
.
addQuery
(
target
);
}
// metric segments are really bad, requires hacks to update
const
segment
=
this
.
uiSegmentSrv
.
newSegment
({
value
:
'Add Query'
,
selectMode
:
true
,
fake
:
true
});
this
.
mixedDsSegment
.
value
=
segment
.
value
;
this
.
mixedDsSegment
.
html
=
segment
.
html
;
this
.
mixedDsSegment
.
text
=
segment
.
text
;
}
addQuery
()
{
...
...
public/app/features/panel/partials/metrics_tab.html
View file @
c771dd4b
...
...
@@ -14,39 +14,32 @@
</span>
<span
class=
"gf-form-query-letter-cell-letter"
>
{{ctrl.panelCtrl.nextRefId}}
</span>
</label>
<button
class=
"btn btn-inverse
gf-form-btn"
ng-click=
"ctrl.addQuery()"
ng-hide=
"ctrl.current.meta.mixed"
>
Add Query
</button>
<div
class=
"dropdown"
ng-if=
"ctrl.current.meta.mixed"
>
<metric-segment
segment=
"ctrl.mixedDsSegment"
get-options=
"ctrl.getOptions(false)"
on-change=
"ctrl.mixedDatasourceChanged()"
></metric-segment>
</div>
</div>
</div>
<button
class=
"btn btn-secondary
gf-form-btn"
ng-click=
"ctrl.addQuery()"
ng-hide=
"ctrl.current.meta.mixed"
>
Add Query
</button>
<div
class=
"dropdown"
ng-if=
"ctrl.current.meta.mixed"
>
<metric-segment
segment=
"ctrl.mixedDsSegment"
get-options=
"ctrl.getOptions(false)"
on-change=
"ctrl.mixedDatasourceChanged()"
></metric-segment>
</div>
</div>
</div>
</div>
<query-troubleshooter
panel-ctrl=
"ctrl.panelCtrl"
></query-troubleshooter>
<collapse-box
title=
"Data Source: {{ctrl.dsSegment.value}}"
>
<collapse-box-body>
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label"
>
Panel Data Source
</label>
<metric-segment
segment=
"ctrl.dsSegment"
get-options=
"ctrl.getOptions(true)"
on-change=
"ctrl.datasourceChanged()"
></metric-segment>
</div>
</div>
</div>
<rebuild-on-change
property=
"ctrl.panel.datasource"
show-null=
"true"
>
<plugin-component
type=
"query-options-ctrl"
>
</plugin-component>
</rebuild-on-change>
</collapse-box-body>
</collapse-box>
<!-- <query-troubleshooter panel-ctrl="ctrl.panelCtrl"></query-troubleshooter> -->
<div
class=
"gf-form-group"
>
<div
class=
"gf-form-inline"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label"
>
Panel Data Source
</label>
<metric-segment
segment=
"ctrl.dsSegment"
get-options=
"ctrl.getOptions(true)"
on-change=
"ctrl.datasourceChanged()"
></metric-segment>
</div>
</div>
</div>
<div
class=
"clearfix"
></div>
<rebuild-on-change
property=
"ctrl.panel.datasource"
show-null=
"true"
>
<plugin-component
type=
"query-options-ctrl"
>
</plugin-component>
</rebuild-on-change>
</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