2016-02-08 15:41:00 +01:00
|
|
|
/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
|
2015-11-16 14:19:33 +01:00
|
|
|
|
2017-01-12 12:28:40 +01:00
|
|
|
// @TODO(el): https://dev.icinga.com/issues/10646
|
2015-11-16 14:19:33 +01:00
|
|
|
(function(Icinga, $) {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
Icinga.Behaviors = Icinga.Behaviors || {};
|
|
|
|
|
|
|
|
var ApplicationState = function (icinga) {
|
|
|
|
Icinga.EventListener.call(this, icinga);
|
|
|
|
this.on('rendered', this.onRendered, this);
|
2018-07-09 15:33:20 +02:00
|
|
|
this.on('rendered', '#application-state-summary', this.onSummaryRendered, this);
|
2015-11-16 14:19:33 +01:00
|
|
|
this.icinga = icinga;
|
|
|
|
};
|
|
|
|
|
|
|
|
ApplicationState.prototype = new Icinga.EventListener();
|
|
|
|
|
|
|
|
ApplicationState.prototype.onRendered = function(e) {
|
2015-12-21 13:03:58 +01:00
|
|
|
if (! $('#application-state').length
|
|
|
|
&& ! $('#login').length
|
|
|
|
&& ! $('#guest-error').length
|
|
|
|
&& ! $('#setup').length
|
|
|
|
) {
|
2015-12-16 12:55:41 +01:00
|
|
|
var _this = e.data.self;
|
|
|
|
|
2015-11-16 14:19:33 +01:00
|
|
|
$('#layout').append(
|
|
|
|
'<div id="application-state" class="container" style="display: none" data-icinga-url="'
|
|
|
|
+ _this.icinga.loader.baseUrl
|
|
|
|
+ '/application-state" data-icinga-refresh="60"></div>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-07-09 15:33:20 +02:00
|
|
|
ApplicationState.prototype.onSummaryRendered = function(e) {
|
|
|
|
var height = $(this).height();
|
|
|
|
|
|
|
|
$('#sidebar').css('bottom', height);
|
|
|
|
$('#main').css('bottom', height);
|
|
|
|
};
|
|
|
|
|
2015-11-16 14:19:33 +01:00
|
|
|
Icinga.Behaviors.ApplicationState = ApplicationState;
|
|
|
|
|
|
|
|
})(Icinga, jQuery);
|