6import { SparklineSVG } from "./sparklineSVG";
7
8function StatusRow({ rows }) {
9 return (
10 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function Counter() {
6 const [count, setCount] = useState(4);
7
15}
16
17function client() {
18 createRoot(document.getElementById("root")).render(<Counter />);
19}
23}
24
25export default function server(request: Request): Response {
26 return new Response(
27 `
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}
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
6 const [count, setCount] = useState(4);
7 return (
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;
7);
8
9export async function uptimeCheck(url: string) {
10 let reason: string, status: number, end: number;
11 let ok = true;
1/** @jsxImportSource npm:react */
2import { renderToString } from "npm:react-dom/server";
3export default async function(req: Request): Promise<Response> {
4 return new Response(
5 renderToString(
1export default async function(req: Request): Promise<Response> {
2 return new Response(
3 `
7type Handler = (r: Request) => Promise<Response> | Response;
8
9export async function logMeInMiddleware(
10 importMetaUrl: string,
11 handle: Handler,
34}
35
36function htmlTemplateResponse(body: JSX.Element, options?: Partial<ResponseInit>): Response {
37 const headers = { "content-type": "text/html charset=utf-8" };
38 return new Response(
1import { logMeInMiddleware, LOGOUT_URL, RESET_URL } from "https://esm.town/v/maxm/logmein/mw";
2
3async function handler(req: Request): Promise<Response> {
4 return new Response(
5 `
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.