Something went wrong. Try again.
Periodic backups of ATProto repos and blobs safekeeper.dummy.cafe
atproto backup
Something went wrong. Try again.
2.9 kB · 104 lines
TSX
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105import { Html } from '@elysiajs/html';import type { Children } from '@kitajs/html';
export default function RootLayout({ title, authed, wide, children}: { title?: string; authed: boolean; // Bumps the main column to 6xl for pages with wide data tables // (e.g. accounts). Defaults to the standard 4xl reading column. wide?: boolean; children: Children;}) { const mainClass = wide ? 'max-w-6xl w-full px-6 py-8 flex flex-col gap-6' : 'max-w-4xl w-full px-6 py-8 flex flex-col gap-6'; const navInnerClass = wide ? 'max-w-6xl mx-auto w-full px-6 py-4 flex flex-row items-center gap-6' : 'max-w-4xl mx-auto w-full px-6 py-4 flex flex-row items-center gap-6'; return ( <html lang="en"> <head> <title>{title ? `${title} · safekeeper` : 'safekeeper'}</title>
<link rel="stylesheet" href="/tailwind.css" />
<meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> </head> <body class="w-full min-h-screen flex flex-col items-center bg-neutral-50 text-neutral-900"> <nav class="w-full border-b border-neutral-200 bg-white"> <div class={navInnerClass}> <a href="/" class="font-bold text-lg"> safekeeper </a> <a href="/" class="text-sm text-neutral-700 hover:text-black"> dashboard </a> <a href="/pdses" class="text-sm text-neutral-700 hover:text-black" > PDSes </a> <a href="/tracked" class="text-sm text-neutral-700 hover:text-black" > tracked accounts </a> <a href="/accounts" class="text-sm text-neutral-700 hover:text-black" > accounts </a> <div class="grow flex flex-row gap-2 justify-end items-center"> <span class={ 'text-xs px-2 py-0.5 rounded ' + (authed ? 'bg-emerald-100 text-emerald-800' : 'bg-neutral-200 text-neutral-700') } > {authed ? 'admin' : 'read-only'} </span> {!authed && ( <a href="/login" class="text-sm px-2 py-0.5 rounded bg-neutral-900 text-white hover:bg-neutral-700" > log in </a> )} </div> </div> </nav> <main class={mainClass}>{children}</main> </body> </html> );}
export function fmtBytes(bytes: number | null | undefined): string { if (bytes == null) return '—'; const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB']; let n = bytes; let u = 0; while (n >= 1024 && u < units.length - 1) { n /= 1024; u += 1; } return `${n.toFixed(u === 0 ? 0 : 2)} ${units[u]}`;}
export function fmtDate(d: Date | null | undefined): string { if (!d) return 'never'; return d.toISOString().replace('T', ' ').slice(0, 19) + ' UTC';}