3import { renderToString } from "npm:react-dom/server";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7
17const guests: Record<string, Guest> = {};
18
19export function addGuest(name: string, email: string): string {
20 // Check if guest already exists with this email
21 const existingGuest = Object.values(guests).find(g => g.email === email);
36}
37
38export function getNextEventStatus(): EventStatus {
39 const now = new Date();
40 const nextSaturday = new Date(now);
60export type SignupData = z.infer<typeof SignupSchema>;
61
62export function getEventDateMessage(date: Date | null): string {
63 if (!date) return "Most Saturday Mornings";
64
9// };
10
11export async function getImages(type: string, count: number): Promise<string[]> {
12 // Query to select random rows of the specified type
13 const result = await sqlite.execute(
4let linkClass = "text-sky-600 hover:text-sky-500";
5
6export default function FAQ(c) {
7 return c.html(
8 <Layout activeTab={new URL(c.req.url).pathname}>
4import Layout from "./layout";
5
6function absoluteURL(url) {
7 if (url.startsWith("http://") || url.startsWith("https://"))
8 return url;
24let linkClass = "text-sky-600 hover:text-sky-500";
25
26function httpsIfy(url: string) {
27 if (!url.startsWith("http://") && !url.startsWith("https://")) {
28 return `https://${url}`;
31}
32
33function renderCell(header, row) {
34 let data = row[header];
35 if (header === "Name") {
45}
46
47export default async function Browse(c) {
48 const url = new URL(c.req.url);
49 const search = {
3import { zip } from "npm:lodash-es";
4
5export async function rss(req: Request) {
6 let { columns, rows } = await sqlite.execute(`select * from datemedocs order by LastUpdated desc limit 20`);
7 const profiles = rows.map(row =>
9// };
10
11export async function getImages(type: string, count: number): Promise<string[]> {
12 // Query to select random rows of the specified type
13 const result = await sqlite.execute(
4import { DATABASE_TABLENAME } from "./constants";
5
6function App() {
7 const [uploadStatus, setUploadStatus] = useState<string>("Drag and drop files here");
8 const [fileUrl, setFileUrl] = useState<string | null>(null);
155}
156
157function client() {
158 createRoot(document.getElementById("root")).render(<App />);
159}
160if (typeof document !== "undefined") { client(); }
161
162export default async function server(request: Request): Promise<Response> {
163 if (request.method === "POST" && new URL(request.url).pathname === "/upload") {
164 const { blob } = await import("https://esm.town/v/std/blob");
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;
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",