13];
14
15function App() {
16 const [noClicks, setNoClicks] = useState(0);
17 const [isValentine, setIsValentine] = useState(false);
98}
99
100function client() {
101 createRoot(document.getElementById("root")).render(<App />);
102}
103if (typeof document !== "undefined") { client(); }
104
105export default async function server(request: Request): Promise<Response> {
106 return new Response(
107 `
116];
117
118function App() {
119 const [cart, setCart] = useState([]);
120 const [filter, setFilter] = useState("all");
430};
431
432function client() {
433 createRoot(document.getElementById("root")).render(<App />);
434}
435if (typeof document !== "undefined") { client(); }
436
437export default async function server(request: Request): Promise<Response> {
438 return new Response(
439 `
9const thisURL = parseProject(import.meta.url).links.self.project;
10
11function StatusRow({ rows }) {
12 return (
13 <div className="w-full flex flex-col space-y-2">
31}
32
33function StatusSection({ url, rows }) {
34 const sectionRows = rows.filter(row => row[0] === url);
35 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
47}
48
49export default async function(req: Request): Promise<Response> {
50 const { rows } = await sqlite.execute(
51 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2export function SparklineSVG({ strokeWidth = 2, data = [], fill = "none", stroke = "black" }) {
3 const padding = 2;
4 const xMargin = 25;
4const thisURL = parseProject(import.meta.url).links.self.latest;
5
6export async function notify(message: string) {
7 await email({ subject: message, text: `Email sent from ${thisURL}` });
8}
7);
8
9export async function uptimeCheck(url: string, attempt = 1) {
10 let reason: string = "";
11 let status: number | null = null;
106];
107
108function App() {
109 const [cart, setCart] = useState([]);
110 const [filter, setFilter] = useState("all");
420};
421
422function client() {
423 createRoot(document.getElementById("root")).render(<App />);
424}
425if (typeof document !== "undefined") { client(); }
426
427export default async function server(request: Request): Promise<Response> {
428 return new Response(
429 `
1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}
3const js = await memoizeByVersion(async () => {
4 const url =
5 "https://deno.bundlejs.com/?file&text=export%20%7Bdefault%20as%20toIt%7D%20from%20%22browser-readablestream-to-it%22;%0Aexport%20%7Bdefault%20as%20jsonpatch%7D%20from%20%22fast-json-patch@3.1.1%22;%0Aexport%20%7B%20TextLineStream%20%7D%20from%20%22https://esm.sh/jsr/@std/streams@1.0.9/text_line_stream%22;%0Aimport%20*%20as%20preact%20from%20%22preact@10%22;%0Aimport%20*%20as%20preactHooks%20from%20%22preact@10/hooks%22;%0Aimport%20%7Bjsx%20as%20jsx_,%20jsxs%20as%20jsxs_,%20Fragment%20as%20Fragment_%7D%20from%20%22preact@10/jsx-runtime%22;%0Aexport%20const%20React%20=%20%7B...preact,%20...preactHooks%7D%0Aexport%20let%20jsx%20=%20jsx_,%20jsxs%20=%20jsxs_,%20Fragment%20=%20Fragment_%0Aexport%20function%20setJsx(jsx_,%20jsxs_,%20Fragment_)%20%7B%0A%20%20jsx%20=%20jsx_,%20jsxs%20=%20jsxs_,%20Fragment%20=%20Fragment_%0A%7D";
6 return `/*\nbundled version of this:\n\`\`\`js\n${new URL(url).searchParams.get("text")}\n\`\`\`\n*/\n\n`
7 + await (await fetch(url)).text();
8}, import.meta.url);
9export default httpCache(async function(req: Request): Promise<Response> {
10 return new Response(
11 js,
7
8/**
9 * Memoize an async function's result using blob storage, keyed by the val's version
10 * @param fn The async function to memoize
11 * @param metaUrl The import.meta.url of the current val
12 * @returns The result of the memoized function
13 */
14export default async function memoizeByVersion<T>(
15 fn: () => Promise<T>,
16 metaUrl: string,