diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-29 16:41:22 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-07-30 09:57:08 +0200 |
commit | 5d15051da4a170b5c944ccffe372f1ebe2649924 (patch) | |
tree | ffef7fcc54656f74cdd9df24ba8df4e901451154 /settings/js/admin.js | |
parent | a07254856ce532bfe5c49c1b53247daf88dbdd4a (diff) | |
download | nextcloud-server-5d15051da4a170b5c944ccffe372f1ebe2649924.tar.gz nextcloud-server-5d15051da4a170b5c944ccffe372f1ebe2649924.zip |
Allow setupchecks to specify a warning level
Diffstat (limited to 'settings/js/admin.js')
-rw-r--r-- | settings/js/admin.js | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/settings/js/admin.js b/settings/js/admin.js index 8f705b9048d..752ab44534d 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -166,17 +166,40 @@ $(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++ ) { + if ($.isPlainObject(messages[i])) { + switch(messages[i].type) { + case OC.SetupChecks.MESSAGE_TYPE_INFO: + $tipsEl.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>'); + } + } else { + $errorsEl.append('<li>' + messages[i] + '</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'); } }); |