-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
140 lines (136 loc) · 3.78 KB
/
index.html
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
layout: default
title: Narro Status
---
<meta name="description" content="{{ site.description }}" />
<h1 class="site-title">
<a href="/" title="{{ site.title }}">
{{ site.title }}
</a>
</h1>
{% for tag in site.data.tags %}
{% if tag.scheduled %}
<div class="posts">
{% for post in site.tags[tag.slug] limit:1 %}
{% if post.action contains 'resolve' %}
{% else %}
<div class="post {{ post.action }}">
<div class="tags">
<span class="tag {{ tag.slug }}">
{{ tag.name }}
</span>
</div>
<h3>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h3>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
{% endfor %}
{% for tag in site.data.tags %}
{% if tag.system %}
<div class="index-system">
<div class="index-heading">
<h2>
{{ tag.name }}
</h2>
</div>
<hr/>
{% for post in site.tags[tag.slug] limit:1 %}
<p class="{{ post.action }}">
{% if post.action contains 'incident' %}
<h3 class="{{ post.action }}">
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h3>
{% else %}
<h3 class="resolved">
No known issues at this time.
</h3>
{% endif %}
</p>
{% endfor %}
</div>
{% endif %}
{% endfor %}
<div class="index-heading">
<h2>
Uptime Last {{ site.uptime_days }} Days
</h2>
</div>
<hr/>
<div class="uptime" style="display: none">
{% for post in site.posts limit:100 %}
<span class="{{ post.action }}" data-action="{{ post.action }}" data-url="{{ post.url }}" data-title="{{ post.title }}" data-date="{{ post.date | date_to_xmlschema }}">
</span>
{% endfor %}
</div>
<div class="uptime-scale">
<span>
{{ site.uptime_days }} Days Ago
</span>
<span>
Latest
</span>
</div>
<div class="index-heading">
<h2>
Past Incidents
</h2>
<a href="/archive">
View Archive
</a>
</div>
<hr/>
<div id="posts" class="posts">
{% for post in site.posts limit:3 %}
<div class="post {{ post.action }}">
<h3>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h3>
<span>{{ post.date | date_to_string }}</span>
</div>
{% endfor %}
</div>
<script>
(function() {
var wrapper = document.querySelector('.uptime'),
posts = document.querySelectorAll('.uptime span'),
span = false,
a = false,
dayp = false,
n = new Date(),
day = (1000 * 60 * 60 * 24),
o = new Date(n.getTime() - day * {{ site.uptime_days }}),
diff = Math.floor((n.getTime() - o.getTime()) / day),
i, j = 0;
for (j = diff; j >= 0; j--) {
span = document.createElement('span');
n = (new Date(o.getTime() + day * (diff - j)));
span.title = n.toDateString();
span.setAttribute('data-date', n.toJSON().slice(0, 10));
wrapper.appendChild(span);
}
for (i = 0; i < posts.length; i++) {
a = document.createElement('a');
n = (new Date(posts[i].dataset.date));
a.title = n.toDateString() + ' ' + posts[i].dataset.title;
a.className = posts[i].dataset.action;
a.href = posts[i].dataset.url;
dayp = wrapper.querySelector('[data-date="' + n.toJSON().slice(0, 10) + '"]');
if (dayp) {
dayp.appendChild(a);
}
wrapper.removeChild(posts[i]);
}
wrapper.style.display = '';
})();
</script>