Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 49 insertions, 1 deletion
index.html
@@ -16,6 +16,32 @@ | |||
16 | 16 | li + li { | |
17 | 17 | margin-top: .75em; | |
18 | 18 | } | |
19 | + | a{ | |
20 | + | --color: oklch(40.44% 0.227 255.39); | |
21 | + | @media(prefers-color-scheme: dark){ | |
22 | + | --color: oklch(79.45% 0.105 255.39); | |
23 | + | } | |
24 | + | color: var(--color); | |
25 | + | &::before { font-weight: bold; } | |
26 | + | ||
27 | + | &:link{ color: var(--color); } | |
28 | + | &:visited{ color: oklch(from var(--color) calc(l - 0.1) c h); } | |
29 | + | &:hover{ color: oklch(from var(--color) l calc(c + .25) h); } | |
30 | + | } | |
31 | + | [data-is_live=true]{ | |
32 | + | --color: oklch(50.69% 0.167 149.78); | |
33 | + | @media(prefers-color-scheme: dark){ | |
34 | + | --color: oklch(90.69% 0.167 149.78); | |
35 | + | } | |
36 | + | &::before { content: "✓ " / ""; } | |
37 | + | } | |
38 | + | [data-is_live=false]{ | |
39 | + | --color: oklch(50.37% 0.125 356.965); | |
40 | + | @media(prefers-color-scheme: dark){ | |
41 | + | --color: oklch(80.37% 0.125 356.965); | |
42 | + | } | |
43 | + | &::before { content: "✗ " / ""; } | |
44 | + | } | |
19 | 45 | </style> | |
20 | 46 | </head> | |
21 | 47 | <body> | |
@@ -110,14 +136,36 @@ | |||
110 | 136 | </del></li> | |
111 | 137 | </ul> | |
112 | 138 | ||
139 | + | ||
113 | 140 | <p>Související:</p> | |
114 | 141 | <ul> | |
142 | + | <li><a id="status" href="https://jaandrle-vpsup.web.val.run/">Stav služeb</a></li> | |
115 | 143 | <li> <a href="https://jaandrle.github.io/">Můj blog</a> </li> | |
116 | - | <li> <a href="https://fosstodon.org/@jaandrle">Můj Mastodon účet</a> (<code>@jaandrle@fosstodon.org</code>) </li> | |
144 | + | <li> <a href="https://fosstodon.org/@jaandrle">Můj Mastodon účet</a> (<code>@jaandrle@fosstodon.org</code>)</li> | |
117 | 145 | <li> <a href="https://nolog.cz/services/">nolog služby</a> </li> | |
118 | 146 | <li> <a href="https://wiki.arch-linux.cz/shelves/aplikace-komunity-arch-linux-cz">Aplikace komunity Arch Linux CZ</a> </li> | |
119 | 147 | </ul> | |
120 | 148 | ||
121 | 149 | <p><em><a href="http://nginx.com/">nginx/1.18.0 (Ubuntu)</a></em></p> | |
150 | + | ||
151 | + | ||
152 | + | <script type="module"> | |
153 | + | const { href, parentElement }= document.getElementById('status'); | |
154 | + | /** * @type {[string, { ok: boolean, status: number }][]} */ | |
155 | + | const services= await fetch(href).then(r => r.json()).then(Object.entries); | |
156 | + | const links= Array.from(document.querySelectorAll('a')); | |
157 | + | ||
158 | + | for(const [ url_service, { ok, status } ] of services) { | |
159 | + | for(const link of links) { | |
160 | + | if(url(link.href) !== url(url_service)) continue; | |
161 | + | links.splice(links.indexOf(link), 1); | |
162 | + | Object.assign(link.dataset, { is_live: ok, status }); | |
163 | + | link.title+= ` (${status})`; | |
164 | + | } | |
165 | + | } | |
166 | + | parentElement.parentElement.append(parentElement); | |
167 | + | ||
168 | + | function url(url_service) { return (new URL(url_service)).href; } | |
169 | + | </script> | |
122 | 170 | </body> | |
123 | 171 | </html> |
index.html
@@ -119,16 +119,5 @@ | |||
119 | 119 | </ul> | |
120 | 120 | ||
121 | 121 | <p><em><a href="http://nginx.com/">nginx/1.18.0 (Ubuntu)</a></em></p> | |
122 | - | <script type="module"> | |
123 | - | for(const link of Array.from(document.getElementsByTagName('a'))){ | |
124 | - | if(!link.href.includes("jaandrle.cz")) continue; | |
125 | - | const { parentNode }= link; | |
126 | - | if(parentNode instanceof HTMLModElement) continue; | |
127 | - | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | - | const response= await fetch(link.href, { mode: "cors", redirect: "follow", methos: "HEAD" }) | |
129 | - | .catch(e=> e); | |
130 | - | console.log(link, response); | |
131 | - | } | |
132 | - | </script> | |
133 | 122 | </body> | |
134 | 123 | </html> |
Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 1 insertion, 1 deletion
index.html
@@ -125,7 +125,7 @@ | |||
125 | 125 | const { parentNode }= link; | |
126 | 126 | if(parentNode instanceof HTMLModElement) continue; | |
127 | 127 | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | - | const response= await fetch(link.href, { mode: "no-cors", headers: { "Accept": "text/html", "Access-Control-Allow-Origin": "*" } }) | |
128 | + | const response= await fetch(link.href, { mode: "cors", redirect: "follow", methos: "HEAD" }) | |
129 | 129 | .catch(e=> e); | |
130 | 130 | console.log(link, response); | |
131 | 131 | } |
Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 1 insertion, 1 deletion
index.html
@@ -126,7 +126,7 @@ | |||
126 | 126 | if(parentNode instanceof HTMLModElement) continue; | |
127 | 127 | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | 128 | const response= await fetch(link.href, { mode: "no-cors", headers: { "Accept": "text/html", "Access-Control-Allow-Origin": "*" } }) | |
129 | - | .then(e=> e); | |
129 | + | .catch(e=> e); | |
130 | 130 | console.log(link, response); | |
131 | 131 | } | |
132 | 132 | </script> |
Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 2 insertions, 1 deletion
index.html
@@ -125,7 +125,8 @@ | |||
125 | 125 | const { parentNode }= link; | |
126 | 126 | if(parentNode instanceof HTMLModElement) continue; | |
127 | 127 | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | - | const response= await fetch(link.href, { mode: "no-cors", headers: { "Accept": "text/html", "Access-Control-Allow-Origin": "*" } }); | |
128 | + | const response= await fetch(link.href, { mode: "no-cors", headers: { "Accept": "text/html", "Access-Control-Allow-Origin": "*" } }) | |
129 | + | .then(e=> e); | |
129 | 130 | console.log(link, response); | |
130 | 131 | } | |
131 | 132 | </script> |
Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 1 insertion, 1 deletion
index.html
@@ -125,7 +125,7 @@ | |||
125 | 125 | const { parentNode }= link; | |
126 | 126 | if(parentNode instanceof HTMLModElement) continue; | |
127 | 127 | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | - | const response= await fetch(link.href, { method: "HEAD" }).catch(e=> e); | |
128 | + | const response= await fetch(link.href, { mode: "no-cors", headers: { "Accept": "text/html", "Access-Control-Allow-Origin": "*" } }); | |
129 | 129 | console.log(link, response); | |
130 | 130 | } | |
131 | 131 | </script> |
Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 1 insertion, 1 deletion
index.html
@@ -125,7 +125,7 @@ | |||
125 | 125 | const { parentNode }= link; | |
126 | 126 | if(parentNode instanceof HTMLModElement) continue; | |
127 | 127 | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | - | const response= await fetch(link.href, { method: "HEAD" }); | |
128 | + | const response= await fetch(link.href, { method: "HEAD" }).catch(e=> e); | |
129 | 129 | console.log(link, response); | |
130 | 130 | } | |
131 | 131 | </script> |
Jan Andrle 修订了这个 Gist . 转到此修订
1 file changed, 15 insertions, 5 deletions
index.html
@@ -112,12 +112,22 @@ | |||
112 | 112 | ||
113 | 113 | <p>Související:</p> | |
114 | 114 | <ul> | |
115 | - | <li> <a href="https://jaandrle.github.io/">Můj blog</a> </li> | |
116 | - | <li> <a href="https://fosstodon.org/@jaandrle">Můj Mastodon účet</a> (<code>@jaandrle@fosstodon.org</code>) </li> | |
117 | - | <li> <a href="https://nolog.cz/services/">nolog služby</a> </li> | |
118 | - | <li> <a href="https://wiki.arch-linux.cz/shelves/aplikace-komunity-arch-linux-cz">Aplikace komunity Arch Linux CZ</a> </li> | |
115 | + | <li> <a href="https://jaandrle.github.io/">Můj blog</a> </li> | |
116 | + | <li> <a href="https://fosstodon.org/@jaandrle">Můj Mastodon účet</a> (<code>@jaandrle@fosstodon.org</code>) </li> | |
117 | + | <li> <a href="https://nolog.cz/services/">nolog služby</a> </li> | |
118 | + | <li> <a href="https://wiki.arch-linux.cz/shelves/aplikace-komunity-arch-linux-cz">Aplikace komunity Arch Linux CZ</a> </li> | |
119 | 119 | </ul> | |
120 | 120 | ||
121 | 121 | <p><em><a href="http://nginx.com/">nginx/1.18.0 (Ubuntu)</a></em></p> | |
122 | + | <script type="module"> | |
123 | + | for(const link of Array.from(document.getElementsByTagName('a'))){ | |
124 | + | if(!link.href.includes("jaandrle.cz")) continue; | |
125 | + | const { parentNode }= link; | |
126 | + | if(parentNode instanceof HTMLModElement) continue; | |
127 | + | if(parentNode.dataset.status) continue; // one <li> per service (with multiple links/aliases) | |
128 | + | const response= await fetch(link.href, { method: "HEAD" }); | |
129 | + | console.log(link, response); | |
130 | + | } | |
131 | + | </script> | |
122 | 132 | </body> | |
123 | - | </html> | |
133 | + | </html> |
index.html
@@ -114,6 +114,8 @@ | |||
114 | 114 | <ul> | |
115 | 115 | <li> <a href="https://jaandrle.github.io/">Můj blog</a> </li> | |
116 | 116 | <li> <a href="https://fosstodon.org/@jaandrle">Můj Mastodon účet</a> (<code>@jaandrle@fosstodon.org</code>) </li> | |
117 | + | <li> <a href="https://nolog.cz/services/">nolog služby</a> </li> | |
118 | + | <li> <a href="https://wiki.arch-linux.cz/shelves/aplikace-komunity-arch-linux-cz">Aplikace komunity Arch Linux CZ</a> </li> | |
117 | 119 | </ul> | |
118 | 120 | ||
119 | 121 | <p><em><a href="http://nginx.com/">nginx/1.18.0 (Ubuntu)</a></em></p> |
index.html
@@ -80,7 +80,7 @@ | |||
80 | 80 | </li> | |
81 | 81 | <li> | |
82 | 82 | <a href="https://linkding.jaandrle.cz/" title="Moje instance LinkDing">linkding.jaandrle.cz</a> | |
83 | - | – rss čtečka | |
83 | + | – správce záložek | |
84 | 84 | [stránky projektu <a href="https://github.com/sissbruecker/linkding">LinkDing</a>] | |
85 | 85 | </li> | |
86 | 86 | <li> |