Dashboard: Render exceptions on failing requests

refs #5507
This commit is contained in:
Eric Lippmann 2014-01-22 14:58:23 +01:00
parent 4473008d65
commit bbe018567f
1 changed files with 19 additions and 15 deletions

View File

@ -44,22 +44,26 @@ define(['jquery', 'logging', 'URIjs/URI', 'icinga/componentLoader'], function($,
/**
* Refresh the container content and layout
*/
this.refresh = function() {
this.refresh = function () {
$.ajax({
url: this.dashboardUrl
}).done((function(response) {
this.container.empty();
this.container.html(response);
dashboardContainer.freetile('layout');
$(window).on('layoutchange', function() {
url: this.dashboardUrl,
context: this
})
.done(function (response) {
this.container.empty();
this.container.html(response);
components.load();
})
.fail(function (response, reason) {
this.container.html(response.responseText);
})
.always(function () {
dashboardContainer.freetile('layout');
});
this.triggerRefresh();
components.load();
}).bind(this)).fail((function(response, reason) {
this.container.html(response);
}).bind(this));
$(window).on('layoutchange', function() {
dashboardContainer.freetile('layout');
});
this.triggerRefresh();
})
};
this.triggerRefresh = function() {
@ -70,4 +74,4 @@ define(['jquery', 'logging', 'URIjs/URI', 'icinga/componentLoader'], function($,
};
this.refresh();
};
});
});