diff options
author | Daniel Nilsson <daniel.nilsson94@outlook.com> | 2024-02-29 22:10:43 +0100 |
---|---|---|
committer | Paul Donald <itsascambutmailmeanyway@gmail.com> | 2024-03-19 17:22:44 +0100 |
commit | ae4e305b0d860df4366b913b92b7e468a0f7fecf (patch) | |
tree | 3496a3adbb8dba1fea473566a662e08863462500 /applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources | |
parent | c608a15a9c53a19654f5a36ba2056a7a1eb561da (diff) |
luci-app-attendedsysupgrade: move init of rpc data into load function
Signed-off-by: Daniel Nilsson <daniel.nilsson94@outlook.com>
Diffstat (limited to 'applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources')
-rw-r--r-- | applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js | 32 |
1 files changed, 17 insertions, 15 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 36b7c852cb..f3767cb235 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 @@ -567,34 +567,36 @@ return view.extend({ }); }, - load: function () { - return Promise.all([ + load: async function () { + const promises = await Promise.all([ L.resolveDefault(callPackagelist(), {}), L.resolveDefault(callSystemBoard(), {}), L.resolveDefault(fs.stat('/sys/firmware/efi'), null), uci.load('attendedsysupgrade'), ]); - }, - - render: function (response) { const data = { url: uci.get_first('attendedsysupgrade', 'server', 'url'), - branch: get_branch(response[1].release.version), - revision: response[1].release.revision, - efi: response[2], + branch: get_branch(promises[1].release.version), + revision: promises[1].release.revision, + efi: promises[2], advanced_mode: uci.get_first('attendedsysupgrade', 'client', 'advanced_mode') || 0, rebuilder: uci.get_first('attendedsysupgrade', 'server', 'rebuilder') }; - const firmware = { - client: 'luci/' + response[0].packages['luci-app-attendedsysupgrade'], - packages: response[0].packages, - profile: response[1].board_name, - target: response[1].release.target, - version: response[1].release.version, + client: 'luci/' + promises[0].packages['luci-app-attendedsysupgrade'], + packages: promises[0].packages, + profile: promises[1].board_name, + target: promises[1].release.target, + version: promises[1].release.version, diff_packages: true, - filesystem: response[1].rootfs_type + filesystem: promises[1].rootfs_type }; + return [data, firmware]; + }, + + render: function (response) { + const data = response[0]; + const firmware = response[1]; return E('p', [ E('h2', _('Attended Sysupgrade')), |