yingjieli-admin-ui v1.0.0
subsystem yingjieli.site
capsule://quake0day/[email protected]
Password-protected single-page admin panel for editing all site
content: hero, bio, exhibitions, contact, and the works catalogue
(with client-side image resize before upload).
Owns
- admin/index.html (admin SPA shell)
- admin/admin.js (login flow, editors, client-side image resize, save)
- admin/admin.css (admin-only styling)
- the editing UX (what fields are exposed, save semantics)
Does not own
- session validation (calls /api/auth, lets the server decide)
- content schema (consumes the shape returned by /api/data)
- image upload mechanics (POSTs to /api/upload; doesn't talk to R2)
AI orientation
Single-page admin protected by password login. On load calls GET
/api/auth — if not authenticated, shows login box; otherwise the
editor. Every save is a full PUT /api/data with the entire blob
(no partial updates). Images are resized client-side BEFORE upload.
Avoid
- Sending partial updates (the API only accepts full-blob PUT).
- Decoding the yl_admin cookie or reading SESSION_SECRET in the browser.
- Letting the user pick the final image filename — the server generates it.
Provides
http_api:admin-root
Requires
http_api:auth-loginfromyingjieli-admin-authhttp_api:auth-statusfromyingjieli-admin-authhttp_api:data-readfromyingjieli-content-storehttp_api:data-writefromyingjieli-content-storehttp_api:image-uploadfromyingjieli-image-store
Dependencies
Capsules
yingjieli-admin-auth>=1.0.0 <2.0.0yingjieli-content-store>=1.0.0 <2.0.0yingjieli-image-store>=1.0.0 <2.0.0
Runtime
cloudflare-pages*
Invariants (must always hold)
- The admin UI never bundles ADMIN_PASSWORD or SESSION_SECRET into client code.
- The admin UI calls /api/auth GET before showing the editor.
- Saving from the admin UI always replaces the full content blob, never partial.
Source files (3)
Click any file to view its content; the path on the right shows where the file lands when this capsule is installed.
src/admin/index.html→admin/index.htmlsrc/admin/admin.css→admin/admin.csssrc/admin/admin.js→admin/admin.js
Plus capsule.yaml and
install.json.