-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathstatus.html
More file actions
105 lines (99 loc) · 3.4 KB
/
status.html
File metadata and controls
105 lines (99 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
layout: default
title: Deliverybot | Status
---
<div class="content p-6">
<div class="main-body overflow-x-hidden">
<div class="mb-5 text-center ">
<h1 class="text-gray-light">Deliverybot Status</h1>
</div>
<div id="issues-root">
<p class="text-center text-gray-light">Loading updates...</p>
</div>
</div>
<div class="mt-10 text-center text-light-gray">
Need help? <a href="mailto:{{site.support_email}}">{{site.support_email}}</a>
<br>
Or chat with the community on <a target="_blank" href="{{site.spectrum_url}}">Spectrum</a>
</div>
</div>
{% raw %}
<script id="issues-template" type="text/html">
<div class="Subhead mt-8">
<div class="Subhead-heading">Current incidents</div>
</div>
{{#each active}}
<div class="Toast Toast--error" style="width: 100%; max-width: 95%;">
<span class="Toast-icon">
<svg width="14" height="16" viewBox="0 0 14 16" class="octicon octicon-stop" aria-hidden="true">
<path
fill-rule="evenodd"
d="M10 1H4L0 5v6l4 4h6l4-4V5l-4-4zm3 9.5L9.5 14h-5L1 10.5v-5L4.5 2h5L13 5.5v5zM6 4h2v5H6V4zm0 6h2v2H6v-2z"
/>
</svg>
</span>
<span class="Toast-content">
<strong>{{title}}</strong><br>
{{body}}<br>
<small>{{created_at}}</small>
</span>
</div>
{{else}}
<div class="Toast Toast--success" style="width: 100%; max-width: 95%;">
<span class="Toast-icon">
<svg width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-check" aria-hidden="true">
<path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z" />
</svg>
</span>
<span class="Toast-content">Everything operating normally.</span>
</div>
{{/each}}
<div class="Subhead mt-10">
<div class="Subhead-heading">Past incidents</div>
</div>
{{#each past}}
<div class="Toast Toast--error" style="width: 100%; max-width: 95%;">
<span class="Toast-icon bg-gray-dark">
<svg fill="currentColor" width="14" height="16" viewBox="0 0 14 16" class="octicon octicon-stop" aria-hidden="true">
<path
fill-rule="evenodd"
d="M10 1H4L0 5v6l4 4h6l4-4V5l-4-4zm3 9.5L9.5 14h-5L1 10.5v-5L4.5 2h5L13 5.5v5zM6 4h2v5H6V4zm0 6h2v2H6v-2z"
/>
</svg>
</span>
<span class="Toast-content">
<strong>{{title}}</strong><br>
{{body}}<br>
<small>{{closed_at}}</small>
</span>
</div>
{{/each}}
</script>
{% endraw %}
<script src="https://unpkg.com/handlebars@4.1.2/dist/handlebars.min.js"></script>
<script>
(function () {
var url = "https://api.github.com/repos/deliverybot/deliverybot.github.io/issues?labels=status&state=all";
fetch(url, { cache: "no-cache" })
.then(function (resp) { return resp.json() })
.then(function (issues) {
var active = issues
.filter(function (issue) {
return issue.state !== "closed";
});
var past = issues
.filter(function (issue) {
return issue.state === "closed";
});
var data = {
active: active,
past: past,
};
var source = document.getElementById("issues-template").innerHTML;
var dest = document.getElementById("issues-root");
var template = Handlebars.compile(source);
var html = template(data);
dest.innerHTML = html;
});
})();
</script>