A separate admin page: server settings, accounts and the log
/admin, with Server, Accounts and Log sections chosen by the URL's hash. The server sends the page and /admin.js to admins only (anyone else asking for the page goes back to the app, and the script is 403), and removes the header's link to it from everyone else's page rather than hiding it. The API keeps refusing all of it to non-admins as before. Settings becomes personal: theme, OPML import and export, and the schedule and download folder to read. The server fields, the Users dialog and the Log dialog move out of dialogs.ts into admin.ts. The CSS moves out of index.html into web/app.css, which both pages load as /app.css?v=<hash>, served immutable like the scripts. The smoke test checks both pages. Closes #19. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
10
CLAUDE.md
10
CLAUDE.md
@@ -61,11 +61,15 @@ the shell running the command and kills the session (exit 144). This has happene
|
||||
|
||||
## Before you touch the page
|
||||
|
||||
The page is markup and CSS in `web/index.html` and TypeScript in `web/src/`. `build.rs` runs
|
||||
There are three pages: the app (`web/index.html`), the admin page (`web/admin.html`, sent to
|
||||
admins only) and sign-in (`web/login.html`). The app and admin pages share one stylesheet,
|
||||
`web/app.css`, and their script is TypeScript in `web/src/`; `web/build.mjs` lists which files
|
||||
make up each page's script. `build.rs` runs
|
||||
`web/build.mjs`, which uses swc to strip the types and minify the script into `app.js` (and
|
||||
`login.js`), and minifies the page, and the results are `include_str!`d into the binary. The page
|
||||
loads its script as `/app.js?v=<hash of its contents>`: the page is served `no-cache` and the
|
||||
script `immutable`, so a browser keeps the script until a deploy changes it and its name. So **every page change needs a
|
||||
loads its script as `/app.js?v=<hash of its contents>`, and `/app.css` the same way: the page is
|
||||
served `no-cache` and the script and stylesheet `immutable`, so a browser keeps them until a
|
||||
deploy changes them and their names. So **every page change needs a
|
||||
rebuild** before it is visible, and building needs node and `npm ci` run once.
|
||||
|
||||
The files in `web/src` are not modules. They are one script split up, concatenated in the order
|
||||
|
||||
Reference in New Issue
Block a user