Polish admin UI and add app.static file serving.

Admin gets a sidebar shell, flash messages, empty states, and forms in-chrome; listen can nest a public directory under /static (or a custom mount).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-12 09:26:30 +08:00
1 parent a0c56fa352
commit db6158e9e2
16 files changed
+605 -95

No files matched your search

+9 -1
View File
@@ -198,8 +198,16 @@ Register `GET|POST /_form/{id}` for listen when the form is not already embedded
**> web_app_mount_form app=`self` id=`id` form=`form`**
## static
+ `dir`
+ `mount`=/static
Serve files from `dir` under `mount` (default `/static`). Path is resolved from the process working directory at listen time.
**> web_app_static app=`self` dir=`dir` mount=`mount`**
## listen
Serve `/`, routed pages, `/_part/{id}` (home) and `{path}/_part/{id}` (routes), `/_form/{id}` (from mounts + page embeds), and optional `/admin`.
Serve `/`, routed pages, `/_part/{id}` (home) and `{path}/_part/{id}` (routes), `/_form/{id}` (from mounts + page embeds), optional `/static` (or custom mount), and optional `/admin`.
**> web_listen app=`self`**
+9 -1
View File
@@ -188,8 +188,16 @@ description: 官方网站类(中文)。表格 + 方法;不写袋式胶水
**> web_app_mount_form app=`self` id=`id` form=`表单`**
## 静态
+ `目录`
+ `挂载`=/static
将 `目录` 下的文件挂到 `挂载`(默认 `/static`)。路径在 `监听` 时相对进程工作目录解析。
**> web_app_static app=`self` dir=`目录` mount=`挂载`**
## 监听
提供 `/`、路由页、首页 `/_part/{id}`、路由 `{路径}/_part/{id}`、`/_form/{id}`,以及可选 `/admin`。
提供 `/`、路由页、首页 `/_part/{id}`、路由 `{路径}/_part/{id}`、`/_form/{id}`、可选静态目录,以及可选 `/admin`。
**> web_listen app=`self`**