| Giorgi Lekveishvili | 5c1b06e | 2024-03-28 15:19:44 +0400 | [diff] [blame] | 1 | {{ define "task" }} |
| 2 | {{ range . }} |
| Giorgi Lekveishvili | ab7ff6e | 2024-03-29 13:11:30 +0400 | [diff] [blame^] | 3 | <li aria-busy="{{ eq .Status 1 }}"> |
| Giorgi Lekveishvili | 5c1b06e | 2024-03-28 15:19:44 +0400 | [diff] [blame] | 4 | {{ .Title }}{{ if .Err }} - {{ .Err.Error }} {{ end }} |
| 5 | {{ if .Subtasks }} |
| 6 | <ul> |
| 7 | {{ template "task" .Subtasks }} |
| 8 | </ul> |
| 9 | {{ end }} |
| 10 | </li> |
| 11 | {{ end }} |
| 12 | {{ end }} |
| 13 | |
| 14 | {{ define "main" }} |
| Giorgi Lekveishvili | ab7ff6e | 2024-03-29 13:11:30 +0400 | [diff] [blame^] | 15 | <div class="grid contents-header"> |
| 16 | <div style="border-width: 1px; border-right-style: solid;"> |
| 17 | setup |
| 18 | </div> |
| 19 | <div> |
| 20 | information |
| 21 | </div> |
| Giorgi Lekveishvili | 5c1b06e | 2024-03-28 15:19:44 +0400 | [diff] [blame] | 22 | </div> |
| Giorgi Lekveishvili | ab7ff6e | 2024-03-29 13:11:30 +0400 | [diff] [blame^] | 23 | <div id="contents" class="grid env-status"> |
| 24 | <div> |
| 25 | <ul class="progress"> |
| 26 | {{ template "task" .Root.Subtasks }} |
| 27 | </ul> |
| 28 | </div> |
| 29 | <div id="create-instance-form"> |
| 30 | {{ if .DNSRecords }} |
| 31 | <form action="" method="POST"> |
| 32 | <p>You will have to publish following DNS records via your domain registrar.</p> |
| 33 | <textarea rows="7" disabled>{{ .DNSRecords }}</textarea> |
| 34 | <label for="domain-registrar">Domain Registrar</label> |
| 35 | <select id="domain-registrar" required tabindex="1"> |
| 36 | <option value="" selected>Select registrar</option> |
| 37 | <option value="gandi">Gandi</option> |
| 38 | <option value="namecheap">Namecheap</option> |
| 39 | </select> |
| 40 | <label for="api-token">API Token</label> |
| 41 | <input |
| 42 | type="text" |
| 43 | id="api-token" |
| 44 | name="api-token" |
| 45 | required |
| 46 | autofocus |
| 47 | tabindex="2" |
| 48 | /> |
| 49 | <button type="submit" tabindex="3">Update</button> |
| 50 | </form> |
| 51 | {{ else if .EnvInfo }} |
| 52 | <p>{{ .EnvInfo }}</p> |
| 53 | {{ end }} |
| 54 | </div> |
| 55 | </div> |
| 56 | <script type="text/javascript"> |
| 57 | async function refresh() { |
| 58 | const resp = await fetch(window.location.href); |
| 59 | if (resp.ok) { |
| 60 | var tmp = document.createElement("html"); |
| 61 | tmp.innerHTML = await resp.text(); |
| 62 | document.getElementById("contents").innerHTML = tmp.getElementsByClassName("env-status")[0].innerHTML; |
| 63 | } |
| 64 | setTimeout(refresh, 5000); |
| 65 | } |
| 66 | |
| 67 | setTimeout(refresh, 5000); |
| 68 | </script> |
| Giorgi Lekveishvili | 5c1b06e | 2024-03-28 15:19:44 +0400 | [diff] [blame] | 69 | {{ end }} |