| gio | f6ad298 | 2024-08-23 17:42:49 +0400 | [diff] [blame] | 1 | {{ define "content"}} |
| 2 | Installation in progress (feel free to navigate away from this page): |
| 3 | <ul class="progress"> |
| 4 | {{ template "task" .Task.Subtasks }} |
| 5 | </ul> |
| 6 | |
| 7 | <script> |
| 8 | async function refresh() { |
| 9 | try { |
| 10 | const resp = await fetch(window.location.href); |
| 11 | console.log(window.location.href, resp); |
| 12 | if (resp.ok) { |
| 13 | if (window.location.href != resp.url) { |
| 14 | location.assign(resp.url); |
| 15 | } else { |
| 16 | var tmp = document.createElement("html"); |
| 17 | tmp.innerHTML = await resp.text(); |
| 18 | const progress = tmp.getElementsByClassName("progress")[0]; |
| 19 | document.getElementsByClassName("progress")[0].innerHTML = progress.innerHTML; |
| 20 | } |
| 21 | } |
| 22 | } catch (error) { |
| 23 | console.log(error); |
| 24 | } finally { |
| 25 | setTimeout(refresh, 3000); |
| 26 | } |
| 27 | } |
| 28 | setTimeout(refresh, 3000); |
| 29 | </script> |
| 30 | {{ end }} |