Files
technitium-console/update-check/functions/dns-query.ts
T
DenozordecandClaude Sonnet 5.5 f3531c64f9 Move the console onto ReUI PRO
Install ReUI (MCP, skill, @reui registry, Tailwind v4, shadcn base-nova) and move
the shared UI onto it: Button, Tag, Check, Input/Textarea, Segmented, Alert, Panel,
Dialog, Tooltip, Menu and Select (Popover), Toast (sonner), the Table frame
(DataGrid), the Dashboard KPI strip, the shnt Ops palette, Geist and the type scale.

Design only: behaviour, texts and roles are unchanged. Tests that asserted the old
DOM were updated; the tests now format numbers in English wherever they run.
docs/reui-migration-plan.md records the plan and its decisions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 00:06:06 +07:00

31 lines
986 B
TypeScript

/*
Cloudflare Pages serves this file at /dns-query. Everything it does is in
`src/handler.ts`; this only wires it to the live `fetch` and to the edge cache,
which works on *.pages.dev.
*/
import { handle, lookup, type Store } from '../src/handler.ts'
function edgeCache(): Store {
const cache = (caches as unknown as { default: Cache }).default
const key = (name: string) => `https://technitium-console.pages.dev/__cache/${name}`
return {
async get(name) {
const hit = await cache.match(key(name))
if (!hit) return null
try {
return await hit.json()
} catch {
return null
}
},
async put(name, value, ttlSeconds) {
const body = JSON.stringify(value)
await cache.put(key(name), new Response(body, { headers: { 'cache-control': `max-age=${ttlSeconds}` } }))
},
}
}
export const onRequest = (context: { request: Request }): Promise<Response> =>
handle(context.request, () => lookup(fetch, edgeCache()))