1export default async function (req: Request): Promise<Response> {
2 return Response.json({ ok: true })
3}
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 `
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 `
4import React, { useState } from "https://esm.sh/react@18.2.0";
5
6function App() {
7 const [numberOfPlayers, setNumberOfPlayers] = useState(25);
8 const [courts, setCourts] = useState(5);
81}
82
83function client() {
84 createRoot(document.getElementById("root")).render(<App />);
85}
89}
90
91function shuffleArray<T>(array: T[]): T[] {
92 for (let i = array.length - 1; i > 0; i--) {
93 const j = Math.floor(Math.random() * (i + 1));
97}
98
99function generateRoundRobin(numberOfPlayers: number, courts: number, rounds: number) {
100 const players = Array.from({ length: numberOfPlayers }, (_, i) => `P${String(i + 1).padStart(3, "0")}`);
101 const schedule: { pairings: string[][]; byes: string[] }[] = [];
186}
187
188async function generateExcelFile(numberOfPlayers: number, schedule: { pairings: string[][]; byes: string[] }[]) {
189 const workbook = new ExcelJS.Workbook();
190
350}
351
352export default async function server(request: Request): Promise<Response> {
353 if (request.method === "POST" && new URL(request.url).pathname === "/generate") {
354 const { numberOfPlayers, courts, rounds } = await request.json();
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [messages, setMessages] = useState([]);
7 const [input, setInput] = useState("");
71}
72
73function client() {
74 createRoot(document.getElementById("root")).render(<App />);
75}
79}
80
81export default async function server(request: Request): Promise<Response> {
82 if (request.method === "POST" && new URL(request.url).pathname === "/chat") {
83 const { messages } = await request.json();
8);
9
10async function notifySlack(message: string) {
11 try {
12 await fetch(WEBHOOK_URL, {
24}
25
26export async function uptimeCheck(url: string) {
27 let reason: string, status: number, end: number;
28 let ok = true;
3import process from "node:process";
4
5export async function set(key: string, value: any) {
6 let resp = await fetch(
7 `${API_URL}/v1/vals`,
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;
5const DAYS_OF_WEEK = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
6
7function App() {
8 const [endDate, setEndDate] = useState('');
9 const [excludedDays, setExcludedDays] = useState({});
66}
67
68function client() {
69 createRoot(document.getElementById("root")).render(<App />);
70}
74}
75
76export default async function server(request: Request): Promise<Response> {
77 const url = new URL(request.url);
78 const endDateStr = url.searchParams.get('end');