blob: 87ed86df50756ae1a9e18329cbbe43d52bd248d0 [file] [log] [blame]
Giorgi Lekveishvili5c1b06e2024-03-28 15:19:44 +04001{{ define "task" }}
2{{ range . }}
Giorgi Lekveishviliab7ff6e2024-03-29 13:11:30 +04003<li aria-busy="{{ eq .Status 1 }}">
gio18d5c682024-05-02 10:30:57 +04004 {{ if eq .Status 3 }}<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="black" d="M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"/></svg>{{ end }}{{ .Title }}{{ if .Err }} - {{ .Err.Error }} {{ end }}
Giorgi Lekveishvili5c1b06e2024-03-28 15:19:44 +04005 {{ if .Subtasks }}
6 <ul>
7 {{ template "task" .Subtasks }}
8 </ul>
9 {{ end }}
10</li>
11{{ end }}
12{{ end }}
13
14{{ define "main" }}
Giorgi Lekveishviliab7ff6e2024-03-29 13:11:30 +040015<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 Lekveishvili5c1b06e2024-03-28 15:19:44 +040022</div>
Giorgi Lekveishviliab7ff6e2024-03-29 13:11:30 +040023<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>
gio18d5c682024-05-02 10:30:57 +040033 <textarea rows="7">{{ .DNSRecords }}</textarea>
Giorgi Lekveishviliab7ff6e2024-03-29 13:11:30 +040034 <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>
Giorgi Lekveishviliab7ff6e2024-03-29 13:11:30 +040038 </select>
39 <label for="api-token">API Token</label>
40 <input
41 type="text"
42 id="api-token"
43 name="api-token"
44 required
45 autofocus
46 tabindex="2"
47 />
48 <button type="submit" tabindex="3">Update</button>
49 </form>
50 {{ else if .EnvInfo }}
51 <p>{{ .EnvInfo }}</p>
52 {{ end }}
53 </div>
54</div>
55<script type="text/javascript">
56 async function refresh() {
57 const resp = await fetch(window.location.href);
58 if (resp.ok) {
59 var tmp = document.createElement("html");
60 tmp.innerHTML = await resp.text();
gio18d5c682024-05-02 10:30:57 +040061 if (document.getElementsByTagName("form").length === 0) {
62 document.getElementById("contents").innerHTML = tmp.getElementsByClassName("env-status")[0].innerHTML;
63 } else {
64 document.getElementsByClassName("progress")[0].innerHTML = tmp.getElementsByClassName("progress")[0].innerHTML;
65 }
Giorgi Lekveishviliab7ff6e2024-03-29 13:11:30 +040066 }
67 setTimeout(refresh, 5000);
68 }
69
70 setTimeout(refresh, 5000);
71</script>
Giorgi Lekveishvili5c1b06e2024-03-28 15:19:44 +040072{{ end }}