rozetko 6 years ago committed by Alexey Velikiy
parent
commit
28ae0eca88
  1. 6
      src/panel/graph_panel/graph_ctrl.ts
  2. 2
      src/panel/graph_panel/partials/tab_analytics.html
  3. 2
      src/panel/graph_panel/partials/tab_webhooks.html

6
src/panel/graph_panel/graph_ctrl.ts

@ -197,7 +197,7 @@ class GraphCtrl extends MetricsPanelCtrl {
this.rebindKeys(); this.rebindKeys();
} }
getHasticDatasource(): { url: string, name: string } | undefined { get hasticDatasource(): { url: string, name: string } | undefined {
const hasticDatasourceId = this.panel.hasticDatasource; const hasticDatasourceId = this.panel.hasticDatasource;
if(hasticDatasourceId !== undefined && hasticDatasourceId !== null) { if(hasticDatasourceId !== undefined && hasticDatasourceId !== null) {
const hasticDatasource = _.find(this._hasticDatasources, { id: hasticDatasourceId }); const hasticDatasource = _.find(this._hasticDatasources, { id: hasticDatasourceId });
@ -314,7 +314,7 @@ class GraphCtrl extends MetricsPanelCtrl {
this.processor = new DataProcessor(this.panel); this.processor = new DataProcessor(this.panel);
await this._fetchHasticDatasources(); await this._fetchHasticDatasources();
let hasticDatasource = this.getHasticDatasource(); let hasticDatasource = this.hasticDatasource;
if(hasticDatasource === undefined) { if(hasticDatasource === undefined) {
delete this.analyticService; delete this.analyticService;
} else { } else {
@ -670,7 +670,7 @@ class GraphCtrl extends MetricsPanelCtrl {
datasource = await this._getDatasourceByName(this.panel.datasource); datasource = await this._getDatasourceByName(this.panel.datasource);
} }
const hasticDatasource = this.getHasticDatasource(); const hasticDatasource = this.hasticDatasource;
let grafanaVersion = 'unknown'; let grafanaVersion = 'unknown';
if(_.has(window, 'grafanaBootData.settings.buildInfo.version')) { if(_.has(window, 'grafanaBootData.settings.buildInfo.version')) {

2
src/panel/graph_panel/partials/tab_analytics.html

@ -11,7 +11,7 @@
<div class="gf-form"> <div class="gf-form">
<div class="gf-form-button-row" ng-if="ctrl.analyticsController.serverStatus === false"> <div class="gf-form-button-row" ng-if="ctrl.analyticsController.serverStatus === false">
<h5>Hastic server at "{{ctrl.backendURL}}" is not available</h5> <h5>Hastic server at "{{ctrl.hasticDatasource.url}}" is not available</h5>
<button class="btn btn-inverse" ng-click="ctrl.runDatasourceConnectivityCheck()"> <button class="btn btn-inverse" ng-click="ctrl.runDatasourceConnectivityCheck()">
<i class="fa fa-plug"></i> <i class="fa fa-plug"></i>
Reconnect to Hastic server Reconnect to Hastic server

2
src/panel/graph_panel/partials/tab_webhooks.html

@ -1,5 +1,5 @@
<div class="gf-form-button-row" ng-if="ctrl.analyticsController.serverStatus === false"> <div class="gf-form-button-row" ng-if="ctrl.analyticsController.serverStatus === false">
<h5>Hastic server at "{{ctrl.backendURL}}" is not available</h5> <h5>Hastic server at "{{ctrl.hasticDatasource.url}}" is not available</h5>
<button class="btn btn-inverse" ng-click="ctrl.runBackendConnectivityCheck()"> <button class="btn btn-inverse" ng-click="ctrl.runBackendConnectivityCheck()">
<i class="fa fa-plug"></i> <i class="fa fa-plug"></i>
Reconnect to Hastic server Reconnect to Hastic server

Loading…
Cancel
Save