Avatar

steveVT

5 public vals
Joined March 28, 2023

Blob Admin

This is a lightweight Blob Admin interface to view and debug your Blob data.

Screenshot 2023-12-13 at 12.51.53.png

To use it on your own Val Town Blob Storage, fork it to your account.

It uses basic authentication with your Val Town API Token as the password (leave the username field blank).

TODO

  • /new - render a page to write a new blob key and value
    • or new blob by file upload
  • /edit/:blob - render a page to edit a blob (prefilled with the existing content)
    • json validation when the existing content is json
      • checkbox to disable that
  • /delete/:blob - delete a blob and render success
1
2
3
4
5
6
7
8
9
10
11
12
13
import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth";
import { blob_admin_blob } from "https://esm.town/v/stevekrouse/blob_admin_blob";
import { blob_admin_home } from "https://esm.town/v/stevekrouse/blob_admin_home";
import { html } from "https://esm.town/v/stevekrouse/html";
import { Hono } from "npm:hono@3.9.2";
const app = new Hono();
app.get("/", async (c) => c.html(await blob_admin_home()));
app.get("/new", (c) => c.html("TODO: New Blob"));
app.get("/:blob", async (c) => c.html(await blob_admin_blob(c.req.param("blob"))));
app.get("/edit/:blob", async (c) => c.html(`TODO: Edit ${c.req.param("blob")}`));
app.get("/delete/:blob", async (c) => c.html(`TODO: Delete ${c.req.param("blob")}`));
export default basicAuth(app.fetch);
1
2
3
let { myTestState } = await import("https://esm.town/v/steveVT/myTestState");
export let mutateMyState = (state) => (myTestState = state);
1
2
3
4
import { mutateTestState as mutateTestState2 } from "https://esm.town/v/stevekrouse/mutateTestState?v=1";
export let mutateTestState = (state) =>
mutateTestState2(state);
1
2
// set by steveVT.mutateTestStateBad at 2023-04-27T12:47:34.728Z
export let testState = 1682599653469;
1
2
3
4
let { testState } = await import("https://esm.town/v/stevekrouse/testState?v=65");
export let mutateTestStateBad = (state) =>
(testState = state);
Next