diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2015-08-18 13:38:08 +0200 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2015-08-18 13:38:08 +0200 |
commit | 12eec397e321feb1e35712627b77d9f9db42015e (patch) | |
tree | cbbbe11070df746f7e176cdd2f2dfe33cbcdb072 /settings/js/admin.js | |
parent | ffff156965beaf52a22a024e240bf56a9f8d2b44 (diff) | |
parent | 01607c09b841e9c18d551e4a5c8207114dde62be (diff) | |
download | nextcloud-server-12eec397e321feb1e35712627b77d9f9db42015e.tar.gz nextcloud-server-12eec397e321feb1e35712627b77d9f9db42015e.zip |
Merge pull request #17975 from owncloud/settings_admin_warning_levels
Settings admin warning levels
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'); } }); |