diff options
author | Paul Spooren <mail@aparcar.org> | 2021-08-15 18:50:49 -1000 |
---|---|---|
committer | Paul Spooren <mail@aparcar.org> | 2021-08-16 14:58:03 -1000 |
commit | 53ff7ca676d10fa253d3ab472b9b5645996527ed (patch) | |
tree | 32e20dda87c506a6616e05503291c49c8ac1253b /applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js | |
parent | dc2570305383a1014b39b44471c0b8c491e23026 (diff) |
luci-app-attendedsysupgrade: show position in queue
The server provides a queue_position argument, show it.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js')
-rw-r--r-- | applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js | 14 |
1 files changed, 6 insertions, 8 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 802868ad0d..5d5d4bd9ba 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 @@ -170,14 +170,12 @@ function request_sysupgrade(server_url, data) { case 202: res = response.json() data.request_hash = res.request_hash; - switch (res.status) { - case "queued": - displayStatus("notice spinning", E('p', _('Request in build queue'))); - break; - case "started": - displayStatus("notice spinning", E('p', _('Building the sysupgrade image'))); - break; - } + + if ("queue_position" in res) + displayStatus("notice spinning", E('p', _('Request in build queue position %d'.format(res.queue_position)))); + else + displayStatus("notice spinning", E('p', _('Building firmware sysupgrade image'))); + setTimeout(function() { request_sysupgrade(server_url, data); }, 5000); |