aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2017-12-03 21:34:57 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2017-12-03 21:34:57 +0000
commit44bd405b8a2a8867b7e00a525da0dfdbdda6be70 (patch)
tree263effe851c47ff808bb016afaca3c1db7f89092
parentd08df21ec13a372ce8fbb04423d6e3a62b897303 (diff)
downloadalpine-mirror-status-44bd405b8a2a8867b7e00a525da0dfdbdda6be70.tar.bz2
alpine-mirror-status-44bd405b8a2a8867b7e00a525da0dfdbdda6be70.tar.xz
add links to status tables and add status description
-rwxr-xr-xgenerate-html.lua6
-rw-r--r--index.tpl24
2 files changed, 23 insertions, 7 deletions
diff --git a/generate-html.lua b/generate-html.lua
index f6d3f63..19f4756 100755
--- a/generate-html.lua
+++ b/generate-html.lua
@@ -135,6 +135,10 @@ function get_mirrors()
for a,mirror in pairs(mirrors) do
mirrors[a].location = mirror.location or "Unknown"
mirrors[a].bandwidth = mirror.bandwidth or "Unknown"
+ mirrors[a].num = a
+ if mirror.name:len() > 32 then
+ mirrors[a].name = ("%s..."):format(mirror.name:sub(1,32))
+ end
for b,url in pairs(mirror.urls) do
local scheme = url:match("(.*)://*.")
mirrors[a].urls[b] = {url = url, scheme = scheme}
@@ -164,7 +168,7 @@ function build_status_tables(indexes)
table.insert(rows, { row = row })
end
res[idx] = {
- url = mirror.url, thead = thead, tbody = rows,
+ url = mirror.url, thead = thead, tbody = rows, num = idx,
duration = mirror.duration, count = mirror.count
}
end
diff --git a/index.tpl b/index.tpl
index aff5ea7..296b28b 100644
--- a/index.tpl
+++ b/index.tpl
@@ -72,7 +72,7 @@
color: #8B0000;
font-weight: bold;
}
- .mirrors table {
+ .mirrors table, .status table {
width: 100%;
}
</style>
@@ -88,8 +88,9 @@
</div>
</header>
<div id="content">
- <div class="pure-g">
+ <div class="pure-g mirrors">
<div class="pure-u-1">
+ <h1>Official Alpine Linux mirrors</h1>
<table class="pure-table pure-table-striped">
<thead>
<tr>
@@ -97,6 +98,7 @@
<th>Service urls</th>
<th>Location</th>
<th>Bandwidth</th>
+ <th>Status</th>
</tr>
</thead>
<tbody>
@@ -114,16 +116,26 @@
<td>
<span>{{bandwidth}}</span>
</td>
+ <td>
+ <a href="#mirror{{num}}">Status</a>
+ </td>
</tr>
{{/mirrors}}
</tbody>
</table>
</div>
</div>
- <div class="pure-g mirrors">
- {{#status}}
+ <div class="pure-g status">
<div class="pure-u-1">
- <h3>{{url}}</h3>
+ <h1>Status of Alpine Linux mirrors</h1>
+ <p>The status of each mirrors apkindex is checked via http
+ "Last modified" header tag which is compared with the master
+ mirror. If the apkindex is found the difference is displayed in
+ the table. If the date of the index is the same (or less than one hour)
+ the status will be displayed as OK. If an http error code is
+ returned it will be displayed in the table instead.</p>
+ {{#status}}
+ <h2 id="mirror{{num}}">{{url}} </h2>
<div class="mirror-meta">
<ul class="mirror-meta">
<li>Generated in {{duration}} seconds.</li>
@@ -148,8 +160,8 @@
{{/tbody}}
</tbody>
</table>
+ {{/status}}
</div>
- {{/status}}
</div>
<div class="last-updated">Last updated: <span>{{last_update}}</span> UTC</div>
</div>