1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/** @jsxImportSource https://esm.sh/hono@3.9.2/jsx **/
import { blob } from "https://esm.town/v/std/blob";
import { css } from "https://esm.town/v/stevekrouse/sqlite_admin_css";
export async function blob_admin_home() {
let blobs = await blob.list();
return (
<div>
<style>{css}</style>
<h1>Blob Admin</h1>
<a href="/new" style={{ marginBottom: "1em", display: "inline-block" }}>New Blob</a>
<table>
<thead>
<tr>
<th>Name</th>
<th>Size (kb)</th>
<th>Last Modified</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
{blobs.map(b => (
<tr>
<td>
<a href={b.key}>
{b.key}
</a>
</td>
<td>{b.size / 1000}</td>
<td>{new Date(b.lastModified).toLocaleString()}</td>
<td>
<a href={"/edit/" + b.key}>✍️</a>
</td>
<td>
<a href={"/delete/" + b.key}>🗑️</a>
</td>
</tr>
))}
</table>
</div>
);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
April 4, 2024