From 44bd405b8a2a8867b7e00a525da0dfdbdda6be70 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Sun, 3 Dec 2017 21:34:57 +0000 Subject: add links to status tables and add status description --- generate-html.lua | 6 +++++- index.tpl | 24 ++++++++++++++++++------ 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%; } @@ -88,8 +88,9 @@
-
+
+

Official Alpine Linux mirrors

@@ -97,6 +98,7 @@ + @@ -114,16 +116,26 @@ + {{/mirrors}}
Service urls Location BandwidthStatus
{{bandwidth}} + Status +
-
- {{#status}} +
-

{{url}}

+

Status of Alpine Linux mirrors

+

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.

+ {{#status}} +

{{url}}

  • Generated in {{duration}} seconds.
  • @@ -148,8 +160,8 @@ {{/tbody}} + {{/status}}
- {{/status}}
Last updated: {{last_update}} UTC
-- cgit v1.2.3