-
Notifications
You must be signed in to change notification settings - Fork 154
/
dashboard.html
119 lines (115 loc) · 3.66 KB
/
dashboard.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
<!DOCTYPE html>
<html lang="th">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-N6Z3QPSTBV"
></script>
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag("js", new Date())
gtag("set", "allow_google_signals", false)
gtag("config", "G-N6Z3QPSTBV")
</script>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>webring dashboard</title>
<link rel="icon" href="webring.svg" />
<meta name="robots" content="noindex" />
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin="anonymous"
/>
</head>
<body>
<div class="container px-4 py-5">
<h1 class="h3 pb-2 border-bottom">webring dashboard</h1>
<div x-data="dashboard">
<h2 class="h4 pt-3 pb-2 border-bottom">Site list</h2>
<table class="table table-sm">
<thead>
<tr>
<th scope="col">Number</th>
<th scope="col">Site</th>
<th scope="col">Notes</th>
</tr>
</thead>
<tbody>
<template x-for="{site, id} in sites" :key="id">
<tr>
<th scope="row" x-text="site.number"></th>
<td>
<a :href="site.url" target="_blank" x-text="id"></a>
</td>
<td>
<span x-text="notes(site)"></span>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<script>
document.addEventListener("alpine:init", () => {
Alpine.data("dashboard", () => ({
sites: [],
async init() {
const response = await fetch(
"https://wonderfulsoftware.github.io/webring-site-data/data.json"
)
if (!response.ok) {
throw new Error("Unable to fetch site data")
}
const data = await response.json()
const sites = Object.entries(data)
.map(([id, site]) => ({
id,
site,
}))
.filter(({ site }) => site.number)
.sort((a, b) => a.site.number - b.site.number)
console.log(sites)
this.sites = sites
},
notes(site) {
const issues = []
if (!site.backlink) {
issues.push("unable to detect backlink")
}
if (
Date.parse(site.lastUpdated) <
Date.now() - 1000 * 60 * 60 * 24 * 3
) {
issues.push("not updated in 3 days")
}
return issues.join(", ")
},
}))
})
</script>
<script
defer
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"
></script>
<!-- Cloudflare Web Analytics -->
<script
defer
src="https://static.cloudflareinsights.com/beacon.min.js"
data-cf-beacon='{"token": "4f95ad66bda34896b8c3147ecc0510ca"}'
></script>
<!-- End Cloudflare Web Analytics -->
</body>
</html>