summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-09-25 16:51:38 +0200
committerJo-Philipp Wich <jo@mein.io>2019-10-02 09:47:20 +0200
commit5f2a17938f5f5cde444e398c02d2f67b3f914f95 (patch)
tree50a7567df88d7b34290320faffeebd60ec7d9c82
parent7c108683c6b65007e3ce8ce6db5e0e48aee87e2b (diff)
luci-mod-system: check if it's possible to force sysupgrade
Some validation errors may be critical enough to prevent sysupgrade. Check the "forceable" property and disallow forcing sysupgrade if applicable. It would fail anyway at the "sysupgrade" call. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
index 49bbf2388..a1fcf7cbe 100644
--- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
+++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
@@ -363,6 +363,7 @@ return L.view.extend({
var keep = document.querySelector('[data-name="keep"] input[type="checkbox"]'),
force = E('input', { type: 'checkbox' }),
is_valid = res[1].valid,
+ is_forceable = res[1].forceable,
is_too_big = (storage_size > 0 && res[0].size > storage_size),
body = [];
@@ -390,7 +391,7 @@ return L.view.extend({
_('The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform.')
]));
- if (!is_valid || is_too_big)
+ if ((!is_valid || is_too_big) && is_forceable)
body.push(E('p', {}, E('label', { 'class': 'btn alert-message danger' }, [
force, ' ', _('Force upgrade'),
E('br'), E('br'),