Triggers panel: ignore fetching data if another panel is in fullscreen.

This commit is contained in:
Alexander Zobnin
2017-03-08 16:46:11 +03:00
parent abf979de4b
commit e163b1ccfb
4 changed files with 23 additions and 4 deletions

View File

@@ -117,7 +117,7 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
_inherits(TriggerPanelCtrl, _PanelCtrl);
/** @ngInject */
function TriggerPanelCtrl($scope, $injector, $element, datasourceSrv, templateSrv, contextSrv) {
function TriggerPanelCtrl($scope, $injector, $element, datasourceSrv, templateSrv, contextSrv, dashboardSrv) {
_classCallCheck(this, TriggerPanelCtrl);
var _this = _possibleConstructorReturn(this, (TriggerPanelCtrl.__proto__ || Object.getPrototypeOf(TriggerPanelCtrl)).call(this, $scope, $injector));
@@ -125,6 +125,8 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
_this.datasourceSrv = datasourceSrv;
_this.templateSrv = templateSrv;
_this.contextSrv = contextSrv;
_this.dashboardSrv = dashboardSrv;
_this.triggerStatusMap = triggerStatusMap;
_this.defaultTimeFormat = defaultTimeFormat;
_this.pageIndex = 0;
@@ -151,6 +153,11 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
value: function onRefresh() {
var _this2 = this;
// ignore fetching data if another panel is in fullscreen
if (this.otherPanelInFullscreenMode()) {
return;
}
// clear loading/error state
delete this.error;
this.loading = true;

File diff suppressed because one or more lines are too long

View File

@@ -92,7 +92,7 @@ var TriggerPanelCtrl = function (_PanelCtrl) {
_inherits(TriggerPanelCtrl, _PanelCtrl);
/** @ngInject */
function TriggerPanelCtrl($scope, $injector, $element, datasourceSrv, templateSrv, contextSrv) {
function TriggerPanelCtrl($scope, $injector, $element, datasourceSrv, templateSrv, contextSrv, dashboardSrv) {
_classCallCheck(this, TriggerPanelCtrl);
var _this = _possibleConstructorReturn(this, (TriggerPanelCtrl.__proto__ || Object.getPrototypeOf(TriggerPanelCtrl)).call(this, $scope, $injector));
@@ -100,6 +100,8 @@ var TriggerPanelCtrl = function (_PanelCtrl) {
_this.datasourceSrv = datasourceSrv;
_this.templateSrv = templateSrv;
_this.contextSrv = contextSrv;
_this.dashboardSrv = dashboardSrv;
_this.triggerStatusMap = triggerStatusMap;
_this.defaultTimeFormat = defaultTimeFormat;
_this.pageIndex = 0;
@@ -126,6 +128,11 @@ var TriggerPanelCtrl = function (_PanelCtrl) {
value: function onRefresh() {
var _this2 = this;
// ignore fetching data if another panel is in fullscreen
if (this.otherPanelInFullscreenMode()) {
return;
}
// clear loading/error state
delete this.error;
this.loading = true;

View File

@@ -66,11 +66,13 @@ var defaultTimeFormat = "DD MMM YYYY HH:mm:ss";
class TriggerPanelCtrl extends PanelCtrl {
/** @ngInject */
constructor($scope, $injector, $element, datasourceSrv, templateSrv, contextSrv) {
constructor($scope, $injector, $element, datasourceSrv, templateSrv, contextSrv, dashboardSrv) {
super($scope, $injector);
this.datasourceSrv = datasourceSrv;
this.templateSrv = templateSrv;
this.contextSrv = contextSrv;
this.dashboardSrv = dashboardSrv;
this.triggerStatusMap = triggerStatusMap;
this.defaultTimeFormat = defaultTimeFormat;
this.pageIndex = 0;
@@ -91,6 +93,9 @@ class TriggerPanelCtrl extends PanelCtrl {
}
onRefresh() {
// ignore fetching data if another panel is in fullscreen
if (this.otherPanelInFullscreenMode()) { return; }
// clear loading/error state
delete this.error;
this.loading = true;