status.nixos.org: add a noscript indicator, and a loading indicator
Graham Christensen committed
Jan 1, 2020 at 13:08 UTC
79f772ee21c41e654c9012308b8a45d00f64d94b
3 files changed
+18
-1
delft/eris/status-page/index.html
+5
-1
@@ -75,7 +75,11 @@
75
<th>Channel Status</th>
76
</tr>
77
</thead>
78
- <tbody id="channel-status"></tbody>
78
+ <tbody id="channel-status">
79
+ <noscript>
80
+ <tr><td class="jsfallback" colspan="5">This page requires Javascript.</td></tr>
81
+ </noscript>
82
+ </tbody>
83
</table>
84
</div>
85
</div>
delft/eris/status-page/status.css
+7
@@ -27,3 +27,10 @@
27
max-width: 100%;
28
}
29
30
+td.jsfallback {
31
+ font-weight: bold;
32
+ font-style: italics;
33
+ text-align: center;
34
+ padding-top: 3em;
35
+ padding-bottom: 3em;
36
+}
delft/eris/status-page/status.js
+6
@@ -1,3 +1,8 @@
1
+window.onload = (_) => {
2
+ var tbody = document.getElementById("channel-status");
3
+ tbody.innerHTML = "<tr><td class='jsfallback' colspan='5'>Loading data from Prometheus...</td></tr>";
4
+};
5
+
6
function aggregateByChannel(result) {
7
return result.reduce((acc, {
8
channel,
@@ -183,6 +188,7 @@ Promise.all([revisionData, updateTimeData, jobsetData])
188
})
189
.then(rows => {
190
var tbody = document.getElementById("channel-status");
191
+ tbody.innerHTML = "";
192
rows.forEach(row => {
193
tbody.appendChild(row);
194
});