mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
Fix container error message, prevent components from being loaded twice
This commit is contained in:
parent
51909ce60c
commit
b616b652bc
@ -48,7 +48,9 @@ define(['jquery', 'logging', 'icinga/componentRegistry'], function ($, log, regi
|
|||||||
function (Cmp) {
|
function (Cmp) {
|
||||||
var cmp;
|
var cmp;
|
||||||
try {
|
try {
|
||||||
cmp = new Cmp(target);
|
if (typeof $(target).attr('id') === 'undefined') {
|
||||||
|
cmp = new Cmp(target);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.emergency('Error in component "' + cmpType + '" : "' + e + '"');
|
log.emergency('Error in component "' + cmpType + '" : "' + e + '"');
|
||||||
err(e);
|
err(e);
|
||||||
|
@ -205,15 +205,17 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe
|
|||||||
}).bind(this)
|
}).bind(this)
|
||||||
).fail(
|
).fail(
|
||||||
(function(response, reason) {
|
(function(response, reason) {
|
||||||
|
if (reason === 'abort') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var errorReason;
|
var errorReason;
|
||||||
if (response.statusCode.toString()[0] === '4') {
|
if (response.statusCode.toString()[0] === '4') {
|
||||||
errorReason = 'The Requested View Couldn\'t Be Found<br/>';
|
errorReason = 'The Requested View Couldn\'t Be Found<br/>';
|
||||||
} else {
|
} else {
|
||||||
errorReason = response.responseText;
|
errorReason = response.responseText;
|
||||||
}
|
}
|
||||||
this.replaceDom(
|
this.replaceDom(response.responseText);
|
||||||
$('<div class="alert alert-danger">').text(errorReason)
|
|
||||||
);
|
|
||||||
}).bind(this)
|
}).bind(this)
|
||||||
).always((function() {
|
).always((function() {
|
||||||
this.containerDom.trigger('hideLoadIndicator');
|
this.containerDom.trigger('hideLoadIndicator');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user