1// This val creates a SQLite dashboard admin panel with a sidebar for table names
2// It uses React for the frontend and the Val Town SQLite API for database operations
3// Now includes functionality to edit rows, using rowid or all columns as identifiers
4// and the ability to add new rows to tables
5// Column types are displayed next to column names in the UI
10import { vtTokenSessionAuth } from "https://esm.town/v/stevekrouse/vtTokenSessionAuthSafe";
11
12function App() {
13 const [tables, setTables] = useState([]);
14 const [selectedTable, setSelectedTable] = useState(null);
195}
196
197function client() {
198 createRoot(document.getElementById("root")).render(<App />);
199}
203}
204
205async function server(request: Request): Promise<Response> {
206 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
207 const url = new URL(request.url);
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [text, setText] = useState("");
7 const [qrCode, setQrCode] = useState("");
34}
35
36function client() {
37 createRoot(document.getElementById("root")).render(<App />);
38}
42}
43
44export default async function server(request: Request): Promise<Response> {
45 return new Response(
46 `
6};
7
8function info(): ValInfo {
9 try {
10 throw new Error();
1This val default exports a function returning ValInfo.
2
3The val information comes from the Deno stack trace induced by `throw new Error()`.
16import thisval from "https://esm.town/v/begoon/thisval";
17const val = thisval();
18export default async function(req: Request): Promise<Response> {
19 return Response.json(val);
20}
1import { OpenAI } from "https://esm.town/v/std/openai";
2
3export default async function(req: Request): Promise<Response> {
4 if (req.method === "OPTIONS") {
5 return new Response(null, {
13
14// handle incoming requests
15export default async function(req) {
16 const PLATFORM = "tonpick.game";
17 // const cookies = await blob.getJSON("platforms");
42];
43
44function MenuItem({ item }) {
45 const [isOpen, setIsOpen] = React.useState(false);
46 const [isHovered, setIsHovered] = React.useState(false);
68}
69
70function Menu() {
71 return (
72 <div style={{ width: "250px", borderRight: "1px solid #ccc", height: "100vh", overflowY: "auto" }}>
76}
77
78function Content() {
79 return (
80 <div style={{ padding: "20px", flexGrow: 1 }}>
97}
98
99function App() {
100 return (
101 <BrowserRouter>
108}
109
110function client() {
111 ReactDOM.createRoot(document.getElementById("root")).render(<App />);
112}
114if (typeof document !== "undefined") { client(); }
115
116async function server(request: Request): Promise<Response> {
117 return new Response(
118 `
220`;
221
222function AnimatedHeadline() {
223 const [animationStarted, setAnimationStarted] = useState(false);
224 const [contentVisible, setContentVisible] = useState(false);
271`;
272
273function SubheadlineAnimation() {
274 const [animationStarted, setAnimationStarted] = useState(false);
275 const contentRef = useRef(null);
398`;
399
400function App() {
401 const [isNavOpen, setIsNavOpen] = React.useState(false);
402 const toggleNav = () => {
458}
459
460function client() {
461 createRoot(document.getElementById("root")).render(<App />);
462}
464if (typeof document !== "undefined") { client(); }
465
466export default async function server(request: Request): Promise<Response> {
467 return new Response(
468 `
1import * as cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
2
3export default async function server(request: Request): Promise<Response> {
4 const url = new URL(request.url).searchParams.get("url");
5
2// lalitpur up https://thejeshgn-imd_distrcitwise_warnings.web.val.run/?lat=24.6936599&lon=78.412621
3// vishisha MP https://thejeshgn-imd_distrcitwise_warnings.web.val.run/?lat=23.5210259&lon=77.809569
4export default async function(req: Request): Promise<Response> {
5 const url = new URL(req.url);
6 const lat = parseFloat(url.searchParams.get("lat") || "12.9796");
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.