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
73248d66
Commit
73248d66
authored
Sep 13, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for metrics tab when data source was not found
parent
dd67c9d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
public/app/features/panel/metrics_tab.ts
+10
-7
public/app/features/panel/partials/metrics_tab.html
+3
-3
public/sass/components/_alerts.scss
+2
-2
No files found.
public/app/features/panel/metrics_tab.ts
View file @
73248d66
...
...
@@ -9,7 +9,7 @@ export class MetricsTabCtrl {
panel
:
any
;
panelCtrl
:
any
;
datasources
:
any
[];
current
:
any
;
datasourceInstance
:
any
;
nextRefId
:
string
;
dashboard
:
DashboardModel
;
panelDsValue
:
any
;
...
...
@@ -29,23 +29,26 @@ export class MetricsTabCtrl {
this
.
panel
=
this
.
panelCtrl
.
panel
;
this
.
dashboard
=
this
.
panelCtrl
.
dashboard
;
this
.
datasources
=
datasourceSrv
.
getMetricSources
();
this
.
panelDsValue
=
this
.
panelCtrl
.
panel
.
datasource
||
null
;
this
.
panelDsValue
=
this
.
panelCtrl
.
panel
.
datasource
;
for
(
let
ds
of
this
.
datasources
)
{
if
(
ds
.
value
===
this
.
panelDsValue
)
{
this
.
current
=
ds
;
this
.
datasourceInstance
=
ds
;
}
}
this
.
addQueryDropdown
=
{
text
:
'Add Query'
,
value
:
null
,
fake
:
true
};
// update next ref id
this
.
panelCtrl
.
nextRefId
=
this
.
dashboard
.
getNextQueryLetter
(
this
.
panel
);
this
.
updateDatasourceOptions
();
}
updateDatasourceOptions
()
{
this
.
hasQueryHelp
=
this
.
current
.
meta
.
hasQueryHelp
;
this
.
queryOptions
=
this
.
current
.
meta
.
queryOptions
;
if
(
this
.
datasourceInstance
)
{
this
.
hasQueryHelp
=
this
.
datasourceInstance
.
meta
.
hasQueryHelp
;
this
.
queryOptions
=
this
.
datasourceInstance
.
meta
.
queryOptions
;
}
}
getOptions
(
includeBuiltin
)
{
...
...
@@ -61,7 +64,7 @@ export class MetricsTabCtrl {
return
;
}
this
.
current
=
option
.
datasource
;
this
.
datasourceInstance
=
option
.
datasource
;
this
.
panelCtrl
.
setDatasource
(
option
.
datasource
);
this
.
updateDatasourceOptions
();
}
...
...
@@ -85,7 +88,7 @@ export class MetricsTabCtrl {
this
.
queryTroubleshooterOpen
=
false
;
this
.
helpOpen
=
!
this
.
helpOpen
;
this
.
backendSrv
.
get
(
`/api/plugins/
${
this
.
current
.
meta
.
id
}
/markdown/query_help`
).
then
(
res
=>
{
this
.
backendSrv
.
get
(
`/api/plugins/
${
this
.
datasourceInstance
.
meta
.
id
}
/markdown/query_help`
).
then
(
res
=>
{
var
md
=
new
Remarkable
();
this
.
helpHtml
=
this
.
$sce
.
trustAsHtml
(
md
.
render
(
res
));
});
...
...
public/app/features/panel/partials/metrics_tab.html
View file @
73248d66
...
...
@@ -73,7 +73,7 @@
</div>
</div>
<div
class=
"query-editor-rows gf-form-group"
>
<div
class=
"query-editor-rows gf-form-group"
ng-if=
"ctrl.datasourceInstance"
>
<div
ng-repeat=
"target in ctrl.panel.targets"
ng-class=
"{'gf-form-disabled': target.hide}"
>
<rebuild-on-change
property=
"ctrl.panel.datasource || target.datasource"
show-null=
"true"
>
<plugin-component
type=
"query-ctrl"
>
...
...
@@ -89,11 +89,11 @@
</span>
<span
class=
"gf-form-query-letter-cell-letter"
>
{{ctrl.panelCtrl.nextRefId}}
</span>
</label>
<button
class=
"btn btn-secondary gf-form-btn"
ng-click=
"ctrl.addQuery()"
ng-hide=
"ctrl.
current
.meta.mixed"
>
<button
class=
"btn btn-secondary gf-form-btn"
ng-click=
"ctrl.addQuery()"
ng-hide=
"ctrl.
datasourceInstance
.meta.mixed"
>
Add Query
</button>
<div
class=
"dropdown"
ng-if=
"ctrl.
current
.meta.mixed"
>
<div
class=
"dropdown"
ng-if=
"ctrl.
datasourceInstance
.meta.mixed"
>
<gf-form-dropdown
model=
"ctrl.addQueryDropdown"
get-options=
"ctrl.getOptions(false)"
on-change=
"ctrl.addMixedQuery($option)"
>
</gf-form-dropdown>
</div>
...
...
public/sass/components/_alerts.scss
View file @
73248d66
...
...
@@ -44,8 +44,8 @@
min-width
:
400px
;
max-width
:
600px
;
position
:
fixed
;
right
:
2
0px
;
top
:
56
px
;
right
:
1
0px
;
top
:
60
px
;
}
.alert-close
{
...
...
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