feat: add pastebin.semilabs.org to list

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
sisungo committed 2026-10-15 18:39:00 +08:00
1 parent f61a7c3950
commit cf3a961f40
2 files changed
+25 -19

No files matched your search

+9
View File
@@ -20,6 +20,10 @@ const SERVICES = [
{
"name": "mirror1.semilabs.org",
"test_url": "https://mirror1.semilabs.org/semios/official/repo.db",
},
{
"name": "pastebin.semilabs.org",
"test_url": "https://pastebin.semilabs.org/",
}
]
@@ -49,6 +53,11 @@ export default {
async scheduled(controller, env, ctx) {
const timestamp = Math.floor(Date.now() / 1000);
if (new Date().getUTCHours() === 0 && new Date().getUTCMinutes() < 15) {
env.DB.prepare("DELETE FROM status WHERE timestamp < ?")
.bind(timestamp - 7 * 24 * 60 * 60)
.run();
}
for (const service of SERVICES) {
try {
const begin = Date.now();
@@ -7,7 +7,6 @@
import { onMount } from "svelte";
import Check from '@lucide/svelte/icons/check';
import X from '@lucide/svelte/icons/x';
import Signal from '@lucide/svelte/icons/signal';
import { Badge } from "#lib/components/ui/badge/index.js";
let recentServices: { [key: string]: { timestamp: number; stat: string }[] } =
@@ -101,25 +100,23 @@
<Card.Action>
<HoverCard.Root>
<HoverCard.Trigger>
{#if data[data.length - 1].stat.includes("up")}
<div class="flex gap-2 items-center text-green-500">
<Signal />
<Label
>{data[data.length - 1].stat.replace("up,latency=", "") +
"ms"}</Label
>
</div>
{:else}
<div class="flex gap-2 items-center text-red-500">
<X />
<Label>timed out</Label>
</div>
{/if}
<Badge variant="outline">
{#if data[data.length - 1].stat.includes("up")}
<div class="flex gap-2 items-center text-green-500 text-sm">
<Label
>{data[data.length - 1].stat.replace("up,latency=", "") +
"ms"}</Label
>
</div>
{:else}
<div class="flex gap-2 items-center text-red-500">
<Label>failed</Label>
</div>
{/if}
</Badge>
</HoverCard.Trigger>
<HoverCard.Content>
The latency shown here represents to an approximate RTT time to
the service from the test service. It is different from the ping
timeout.
The latency shown here represents to an approximate response time of the service.
</HoverCard.Content>
</HoverCard.Root>
</Card.Action>
@@ -155,7 +152,7 @@
</BarChart>
</Chart.Container>
</Card.Content>
<Card.Footer>
<Card.Footer class="flex gap-2 items-center">
<Badge variant="outline">Availability: {availability(data)}%</Badge>
</Card.Footer>
</Card.Root>