diff options
Diffstat (limited to 'settings/js/admin.js')
-rw-r--r-- | settings/js/admin.js | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js index 3e17d7cc182..aa228e76be7 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -173,17 +173,36 @@ $(document).ready(function(){ OC.SetupChecks.checkSetup(), OC.SetupChecks.checkGeneric() ).then(function(check1, check2, check3) { - var errors = [].concat(check1, check2, check3); + var messages = [].concat(check1, check2, check3); var $el = $('#postsetupchecks'); - var $errorsEl; $el.find('.loading').addClass('hidden'); - if (errors.length === 0) { + if (messages.length === 0) { } else { - $errorsEl = $el.find('.errors'); - for (var i = 0; i < errors.length; i++ ) { - $errorsEl.append('<li>' + errors[i] + '</li>'); + var $errorsEl = $el.find('.errors'); + var $warningsEl = $el.find('.warnings'); + var $infoEl = $el.find('.info'); + for (var i = 0; i < messages.length; i++ ) { + switch(messages[i].type) { + case OC.SetupChecks.MESSAGE_TYPE_INFO: + $infoEl.append('<li>' + messages[i].msg + '</li>'); + break; + case OC.SetupChecks.MESSAGE_TYPE_WARNING: + $warningsEl.append('<li>' + messages[i].msg + '</li>'); + break; + case OC.SetupChecks.MESSAGE_TYPE_ERROR: + default: + $errorsEl.append('<li>' + messages[i].msg + '</li>'); + } + } + if ($errorsEl.find('li').length > 0) { + $errorsEl.removeClass('hidden'); + } + if ($warningsEl.find('li').length > 0) { + $warningsEl.removeClass('hidden'); + } + if ($infoEl.find('li').length > 0) { + $infoEl.removeClass('hidden'); } - $errorsEl.removeClass('hidden'); $el.find('.hint').removeClass('hidden'); } }); |