diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-08-18 11:42:30 +0200 |
---|---|---|
committer | Hannu Nyman <hannu.nyman@iki.fi> | 2021-08-18 13:44:37 +0300 |
commit | 82035eec6150fef1319e6fcec324124f82ada754 (patch) | |
tree | b4b95d9a755470276c35b0ee99d009195b385096 /modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | |
parent | 7f5751c16f9c883728ab67cab8b3c717aaf6a590 (diff) |
luci-mod-system: hide unsupported option on flash.js
Hide unsupported option when /rom is not used in flash.js
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js | 12 |
1 files changed, 7 insertions, 5 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 82ab28e03d..8661181781 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 @@ -187,7 +187,7 @@ return view.extend({ form.parentNode.removeChild(form); }, - handleSysupgrade: function(storage_size, ev) { + handleSysupgrade: function(storage_size, has_rootfs_data, ev) { return ui.uploadFile('/tmp/firmware.bin', ev.target.firstChild) .then(L.bind(function(btn, reply) { btn.firstChild.data = _('Checking imageā¦'); @@ -252,9 +252,11 @@ return view.extend({ } else { opts.keep[0].checked = true; - body.push(E('p', {}, E('label', { 'class': 'btn' }, [ - opts.skip_orig[0], ' ', _('Skip from backup files that are equal to those in /rom') - ]))); + if (has_rootfs_data) { + body.push(E('p', {}, E('label', { 'class': 'btn' }, [ + opts.skip_orig[0], ' ', _('Skip from backup files that are equal to those in /rom') + ]))); + } body.push(E('p', {}, E('label', { 'class': 'btn' }, [ opts.backup_pkgs[0], ' ', _('Include in backup a list of current installed packages at /etc/backup/installed_packages.txt') @@ -445,7 +447,7 @@ return view.extend({ o = ss.option(form.Button, 'sysupgrade', _('Image')); o.inputstyle = 'action important'; o.inputtitle = _('Flash image...'); - o.onclick = L.bind(this.handleSysupgrade, this, storage_size); + o.onclick = L.bind(this.handleSysupgrade, this, storage_size, has_rootfs_data); } |