diff options
author | Paul Spooren <mail@aparcar.org> | 2022-06-07 14:23:59 +0200 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2022-06-24 15:31:43 +0200 |
commit | fd72e1c23ef1569fd8f8ab71bdcb4a94f802435a (patch) | |
tree | 15d97f9efbfe99bfb1777686ade55d037d360378 /applications/luci-app-attendedsysupgrade/htdocs | |
parent | 53a998895b81ac393d1a9d62e4c3ae0e8708515b (diff) |
luci-app-attendedsysugprade: allow to reinstall image
Now it's possible to re-install the currently running version in
advanced mode. This can be useful when installing packages via `opkg`
and then requesting the firmware with the packages stored in squashfs.
FIXES: https://github.com/openwrt/luci/issues/5809
Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'applications/luci-app-attendedsysupgrade/htdocs')
-rw-r--r-- | applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js index e9e937c8d1..8d85f866ba 100644 --- a/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js +++ b/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js @@ -341,6 +341,11 @@ return view.extend({ } } + // allow to re-install running firmware in advanced mode + if (this.data.advanced_mode == 1) { + candidates.unshift([version, revision]) + } + if (candidates.length) { var m, s, o; @@ -357,7 +362,12 @@ return view.extend({ s = map.section(form.NamedSection, 'request', '', '', 'Use defaults for the safest update'); o = s.option(form.ListValue, 'version', 'Select firmware version'); for (let candidate of candidates) { - o.value(candidate[0], candidate[1] ? `${candidate[0]} - ${candidate[1]}` : candidate[0]); + if (candidate[0] == version && candidate[1] == revision) { + o.value(candidate[0], _('[installed] %s') + .format(candidate[1] ? `${candidate[0]} - ${candidate[1]}` : candidate[0])); + } else { + o.value(candidate[0], candidate[1] ? `${candidate[0]} - ${candidate[1]}` : candidate[0]); + } } if (this.data.advanced_mode == 1) { |