Peach: Local-first video metadata scraper and media manager.
feat(update): 一键更新改为自动配置,令牌由 Peach 生成在独立卷里
longmeidao0d2e6366e0f7
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 537faf539..870b9b447 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -28,7 +28,7 @@ Removed / Fixed / Security。- **采集**:补女优资料时,如果 minnano-av 上找不到她,就从 avbase 女优页补生日、身高、三围、罩杯,以及站上填了的出身地、血型和趣味,人物页页头不再空着。已有 minnano-av 资料或人工资料的只核对、不覆盖;她之后出现在 minnano-av 上,资料会换成那边的。- **采集**:新增命令 `peach check-sources`,装好、换网络或改代理后,可以一次检查各资料源与图片 CDN 能不能连上,分清连不上、被拒绝、要登录和正在冷却;只读检查,不改设置也不清冷却(#382)。- **采集**:用户脚本添加的任务结束后,完成或失败会一直留在浮卡的「其他任务」里,直到在脚本里标为已读;窗口全关时结束的,下次打开也能看到,失败的也能在脚本里直接重试。需要用户脚本 0.7.2 起的版本;任务中心、想要清单等别处提交的仍只显示 10 分钟。-- **更新**:Docker 部署可以在配置页一键更新。用 `compose.yaml` 新增的 watchtower profile 启动可选的 Watchtower,在「应用与维护 → 一键更新」填同一个令牌后,检查到新镜像时点「一键更新」,Watchtower 拉取镜像并重建 Peach 容器,`/data` 保留,有待执行的数据库迁移时启动前先备份。容器里检查更新改以 Docker Hub 为准,发布页已有新版、镜像还没推送时显示「镜像尚未发布」。没有启用 Watchtower 时仍列出宿主机上的两步命令。Watchtower 能管理宿主机上的容器,启用前先读 [Docker 部署](docs/DOCKER.md#一键更新可选-watchtower)。+- **更新**:Docker 部署可以在配置页一键更新。用 `docker compose --profile watchtower up -d` 启动 `compose.yaml` 新增的可选 Watchtower,Peach 自动配好它,不用填任何设置;检查到新镜像时点「一键更新」,Watchtower 拉取镜像并重建 Peach 容器,`/data` 保留,有待执行的数据库迁移时启动前先备份。容器里检查更新改以 Docker Hub 为准,发布页已有新版、镜像还没推送时显示「镜像尚未发布」。没有启用 Watchtower 时仍列出宿主机上的两步命令。Watchtower 能管理宿主机上的容器,启用前先读 [Docker 部署](docs/DOCKER.md#一键更新可选-watchtower)。### 变更diff --git a/Dockerfile b/Dockerfileindex 9d232ed3b..89cef06cc 100644--- a/Dockerfile+++ b/Dockerfile@@ -49,9 +49,11 @@ COPY --from=build /app/.venv /app/.venvCOPY --from=build /app/amane-runtime /app/amane-runtimeCOPY --from=build /app/tools/amane-bridge /app/tools/amane-bridgeRUN /app/amane-runtime/.venv/bin/python -X utf8 /app/tools/amane-bridge/bridge.py --self-check+# 一键更新的令牌目录:compose 在这里挂 peach-update 卷,空卷首次挂载时照搬这个目录的属主(ADR-0140)。+RUN mkdir /update && chown peach:peach /updateENV PATH="/app/.venv/bin:$PATH" PEACH_DATA_ROOT=/data PYTHONUNBUFFERED=1 \PYTHONIOENCODING=utf-8 PYTHONUTF8=1 PEACH_FACE_MODELS=/app/tools/face-models PEACH_DISTRIBUTION=docker \- PEACH_AMANE_RUNTIME=/app/amane-runtime+ PEACH_AMANE_RUNTIME=/app/amane-runtime PEACH_UPDATE_DIR=/updateWORKDIR /dataUSER peachEXPOSE 8900diff --git a/compose.yaml b/compose.yamlindex bebefbe51..9fd71868f 100644--- a/compose.yaml+++ b/compose.yaml@@ -17,6 +17,8 @@ services:- "${PEACH_BIND:-127.0.0.1}:${PEACH_PORT:-8900}:8900"volumes:- peach-data:/data+ # 只装一键更新的令牌:Peach 首次启动时生成,watchtower 只读这一个卷,看不到 /data。+ - peach-update:/update- type: bindsource: ${PEACH_MEDIA_ROOT:-./media}target: /media@@ -31,20 +33,20 @@ services:image: nickfedor/watchtower:1.23.2profiles: [watchtower]restart: unless-stopped+ depends_on:+ # 令牌在 Peach 起服务前写好;等它就绪再启动,Watchtower 启动时读到的就是那份文件。+ peach:+ condition: service_healthyenvironment:WATCHTOWER_HTTP_API_ENDPOINTS: update- WATCHTOWER_HTTP_API_TOKEN: /run/secrets/watchtower_token+ WATCHTOWER_HTTP_API_TOKEN: /peach-update/watchtower-tokenWATCHTOWER_LABEL_ENABLE: "true"# 换下的旧镜像已失去 edge 标签,留着只占盘;回滚按版本号标签从 Docker Hub 重新拉。WATCHTOWER_CLEANUP: "true"volumes:- /var/run/docker.sock:/var/run/docker.sock- secrets:- - watchtower_token--secrets:- watchtower_token:- file: ${PEACH_WATCHTOWER_TOKEN_FILE:-./secrets/watchtower-token}+ - peach-update:/peach-update:rovolumes:peach-data:+ peach-update:diff --git a/docs/DOCKER.md b/docs/DOCKER.mdindex 15d1f3fb5..239563db3 100644--- a/docs/DOCKER.md+++ b/docs/DOCKER.md@@ -170,18 +170,15 @@ docker compose cp peach:/tmp/peach-support.zip ./peach-support.zipWatchtower 挂着宿主机的 Docker socket,能创建、停止任何容器,等于宿主机 root 权限。只在信任这台宿主机上的 compose 配置时启用。Peach 容器本身不挂 socket,只持有 Watchtower 更新接口的令牌。-启用步骤,在 `compose.yaml` 所在目录执行:+启用只需一步,不用在配置页填写任何内容:在 `compose.yaml` 所在目录运行 `docker compose --profile watchtower up -d`。之后的 `docker compose` 命令都带上 `--profile watchtower`,或在 `.env` 写 `COMPOSE_PROFILES=watchtower`。`.env` 不要把 `PEACH_VERSION` 固定成版本号:Watchtower 只会换同一标签的新镜像,标签是版本号时配置页会改为列出两步命令。-1. 生成令牌文件:`mkdir -p secrets && openssl rand -hex 32 > secrets/watchtower-token`。文件放在其他位置时,在 `.env` 设置 `PEACH_WATCHTOWER_TOKEN_FILE`。-2. 确认 `.env` 没有把 `PEACH_VERSION` 固定成版本号。Watchtower 只会换同一标签的新镜像,标签是版本号时一键更新换不到新版本,配置页会改为列出两步命令。-3. 启动:`docker compose --profile watchtower up -d`。之后的 `docker compose` 命令都带上 `--profile watchtower`,或在 `.env` 写 `COMPOSE_PROFILES=watchtower`。-4. 在配置页「应用与维护 → 一键更新」填写地址 `http://watchtower:8080` 与令牌文件的内容,保存配置。令牌只保存在 `/data/secrets`,页面不再显示。+令牌由 Peach 首次启动时生成,放在 `peach-update` 卷里,之后不再更换。Watchtower 等 Peach 健康后才启动,只读挂这个卷,读不到 `/data`。`/data` 改成宿主机目录时不用改 Watchtower 的配置。不启用 profile 的部署只多一个装着令牌文件的小卷。点「一键更新」提示令牌不一致时,运行 `docker compose restart watchtower` 让它重新读取。检查更新发现新镜像后,「一键更新」替代两步命令。点击并确认后,Peach 会断开一会儿;新版本启动后页面提示刷新。15 分钟内没有看到新版本时,用 `docker compose logs watchtower` 和 `docker compose logs peach` 查看原因。已经在宿主机上 `docker compose pull` 过新镜像、还没 `up -d` 时,旧容器的镜像可能已失去标签,Watchtower 日志显示 `Failed to retrieve image info` 并跳过;这时直接运行 `docker compose up -d`。Watchtower 不在新容器起不来时自动回退。换上新镜像后它删除被替下的旧镜像,免得每次更新在 NAS 上多留一份;指向同一镜像的其他本地标签也一起删除。Docker Hub 保留每个版本号标签,回滚时重新拉取。回滚到旧版本前,先停下 Peach,用升级时生成的 `ledger.pre-migrate-<时间>.db` 替换 `ledger.db`,再把 `.env` 的 `PEACH_VERSION` 设为旧版本号并 `docker compose up -d`;旧版本不会写入它不认识的数据库结构。方案取舍见 [ADR-0140](adr/0140-docker-one-click-update-via-watchtower.md)。-2026-11-04 在 Windows 的 Docker Desktop(Engine 29.9.2,containerd 镜像库)上,运行中容器的镜像只有 `edge` 一个本机标签,把本地 registry 的 `edge` 换成版本号更高、多一个空表迁移的测试镜像,经配置页触发后通过验收:Watchtower 自己拉取新镜像,按 75 秒停止超时停下旧容器,11 秒内起了新容器;`/data` 里的标记文件保留,启动前生成 `ledger.pre-migrate-*.db` 并执行了新迁移,`/healthz?ready=1` 通过,旧镜像已清理。不带 profile、没有令牌文件时 `docker compose up -d` 照常启动。Docker Hub 的真实拉取、ARM NAS 与 Docker Desktop 以外的 Linux 宿主机未取得。+2026-11-04 在 Windows 的 Docker Desktop(Engine 29.9.2,containerd 镜像库)上,运行中容器的镜像只有 `edge` 一个本机标签,把本地 registry 的 `edge` 换成版本号更高、多一个空表迁移的测试镜像,经配置页触发后通过验收:Watchtower 自己拉取新镜像,按 75 秒停止超时停下旧容器,11 秒内起了新容器;`/data` 里的标记文件保留,启动前生成 `ledger.pre-migrate-*.db` 并执行了新迁移,`/healthz?ready=1` 通过,旧镜像已清理。全新启动时 Watchtower 在 Peach 首次健康的同一秒启动,令牌文件属主为 `peach`、权限 600;两个容器同时重启后令牌仍然一致;改掉卷里的令牌后点「一键更新」得到要求重启 Watchtower 的提示,`docker compose restart watchtower` 后恢复。不带 profile 时 `docker compose up -d` 照常启动。Docker Hub 的真实拉取、ARM NAS 与 Docker Desktop 以外的 Linux 宿主机未取得。Linux 容器不读取用户电脑上的浏览历史,也不包含交互式浏览器;需要本机浏览器完成验证的来源在此环境不可用。CloudDrive2 的真实账号登录、网盘流量与 NAS 实机挂载需在目标机器验证。diff --git a/docs/REUSE.md b/docs/REUSE.mdindex fb7e1b495..d3d89724b 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -363,7 +363,7 @@ Actions 工作流静态检查复用 actionlint 1.7.12(MIT,`rhysd/actionlint:Linux Docker 容器复用 Docker 官方 Python `3.14.8-slim-trixie`、uv `0.13.1`(MIT/Apache-2.0),以及 Docker 官方 Buildx、login-action 和 build-push-action 的「先验收再发布」流程。Python 镜像许可证随上游组件保留,FFmpeg 使用 Debian 包及其许可证。Peach 差异仅为配置重载、资料处理请求与持久化路径;不引入新 Python 依赖,不改写真实 ledger。CloudDrive2 使用其官方独立服务,不复制其代码或打包进 Peach。部署与证据范围见 [Docker 部署](DOCKER.md)。-Docker 一键更新复用 [nicholas-fedor/watchtower](https://github.com/nicholas-fedor/watchtower) 1.23.2(Apache-2.0,`nickfedor/watchtower:1.23.2`,2026-10-22 发布;原 `containrrr/watchtower` 已于 2025-12 归档)完成拉取与重建,作为 compose 的可选 profile 独立运行,版本由 Dependabot 的 docker-compose 生态更新。2026-11-04 读过 v1.23.2 源码:`POST /v1/update?async=true` 立即回 202,令牌经 `getSecretFromFile` 从 secrets 文件读取,停容器时按容器自己的 `StopTimeout`。Peach 只保留开放条件、本机令牌与触发请求,传输复用 HTTPX。镜像仓库核对复用共享 `HttpxTransport`(跨源跳转时丢掉 `Authorization`),按 [Docker Registry HTTP API](https://distribution.github.io/distribution/spec/api/) 匿名 `HEAD` manifest 比较摘要,做法参照 [JavBoss `internal/update/container.go`](https://github.com/Solr159/JavBoss)(GPL-3.0,只参照协议用法,未复制代码)。拒绝给 Peach 容器挂 Docker socket 与自写更新容器的理由见 [ADR-0140](adr/0140-docker-one-click-update-via-watchtower.md);无新增 Python 或前端依赖。+Docker 一键更新复用 [nicholas-fedor/watchtower](https://github.com/nicholas-fedor/watchtower) 1.23.2(Apache-2.0,`nickfedor/watchtower:1.23.2`,2026-10-22 发布;原 `containrrr/watchtower` 已于 2025-12 归档)完成拉取与重建,作为 compose 的可选 profile 独立运行,版本由 Dependabot 的 docker-compose 生态更新。2026-11-04 读过 v1.23.2 源码:`POST /v1/update?async=true` 立即回 202,令牌经 `getSecretFromFile` 从文件读取,停容器时按容器自己的 `StopTimeout`。Peach 只保留开放条件、本机令牌与触发请求,传输复用 HTTPX。镜像仓库核对复用共享 `HttpxTransport`(跨源跳转时丢掉 `Authorization`),按 [Docker Registry HTTP API](https://distribution.github.io/distribution/spec/api/) 匿名 `HEAD` manifest 比较摘要,做法参照 [JavBoss `internal/update/container.go`](https://github.com/Solr159/JavBoss)(GPL-3.0,只参照协议用法,未复制代码)。拒绝给 Peach 容器挂 Docker socket 与自写更新容器的理由见 [ADR-0140](adr/0140-docker-one-click-update-via-watchtower.md);无新增 Python 或前端依赖。收藏窗口复用 React Aria 外壳、Peach 设置弹层布局及共用关闭控件 `SettingsDialogClose`。入口为中性星形按钮;实体分类和保存的筛选分别显示,已标记与稍后看位于导航底部。收藏图像复用实体引用、厂牌标识、本地代表作与已绑定在线来源的本地头像代理,通过全站图片回退链逐项尝试,不写入偏好。原始 BoardUI 源码哈希见 `docs/BOARD_UI.md`。Rule34 视频封面使用来源缩略图,图片保留原文件扩展名;失败图片在关注数据刷新时重新尝试。无新增运行时依赖或真实 ledger 写入。diff --git a/docs/ROUTES.md b/docs/ROUTES.mdindex b73ae7a01..93fc06ba8 100644--- a/docs/ROUTES.md+++ b/docs/ROUTES.md@@ -118,7 +118,7 @@`GET /api/client-updates` 要求应用鉴权,返回运行版本与构建标记、发行版检查结果、安装状态、用户脚本版本和自动补修状态,不触发外部检查。`GET /api/jav-browser/updates` 使用用户脚本专用令牌,无需番号,返回运行与发行版、脚本版本快照,不暴露补修明细。`POST /api/configuration/upgrade-repairs/retry` 限本机同源请求,重试失败项;`GET /api/configuration/upgrade-repairs/review` 限本机管理权限,下载 JSON 复核记录,无记录时返回 404。-Docker 镜像的一键更新([ADR-0140](adr/0140-docker-one-click-update-via-watchtower.md)):`GET /api/configuration` 在容器里多一个 `docker_update` 区域,返回 Watchtower 地址、`token_set`、镜像标签与 `rolling`(标签是否为 `edge`),不回显令牌。`POST /api/configuration/docker-update` 保存地址与令牌,令牌留空不改,`clear_token: true` 撤掉;地址无效返回 400。`POST /api/configuration/docker-update/run` 请 Watchtower 异步拉取并重建容器,收到 202 后返回 `state: updating`;没有令牌、标签不是 `edge`、Watchtower 拒绝令牌或正忙返回 409。两条写入接口限本机同源请求,非 Docker 部署返回 404。容器里的 `GET /api/configuration/updates` 在 Docker Hub 的版本号标签与 `edge` 指向同一镜像前返回 `state: pending`。+Docker 镜像的一键更新([ADR-0140](adr/0140-docker-one-click-update-via-watchtower.md)):容器里的 `GET /api/configuration/updates` 在 Docker Hub 的版本号标签与 `edge` 指向同一镜像前返回 `state: pending`;有新镜像时多一个 `one_click`,`available` 表示镜像标签是 `edge`、令牌已生成且探测得到 Watchtower,不能时 `reason` 说明原因,没启用 Watchtower 时为空。`POST /api/configuration/docker-update` 请 Watchtower 异步拉取并重建容器,收到 202 后返回 `state: updating`;条件不满足、Watchtower 拒绝令牌或正忙返回 409。接口限本机同源请求,非 Docker 部署返回 404,从不回传令牌。`GET /api/configuration/cloud-proxies` 返回已添加媒体库对应的 CloudDrive 账号及 API/数据代理、未匹配媒体库和账号修订号,不回显代理密码;尚未填写 CloudDrive2 地址时返回空列表与 `configured: false`。`POST` 接受账号 `id`、`revision` 和本次修改的 `api`/`data`,写回 CloudDrive 后返回该账号当前状态;配置冲突返回 409。这两条接口均限本机管理权限,写入还要求同源请求。diff --git a/docs/adr/0140-docker-one-click-update-via-watchtower.md b/docs/adr/0140-docker-one-click-update-via-watchtower.mdindex 0320baa64..c2d84aeea 100644--- a/docs/adr/0140-docker-one-click-update-via-watchtower.md+++ b/docs/adr/0140-docker-one-click-update-via-watchtower.md@@ -28,8 +28,9 @@- `WATCHTOWER_HTTP_API_ENDPOINTS=update`:只开 `POST /v1/update`。开了 HTTP API 后默认不再定时轮询,更新只在用户点击时发生。旧的 `--http-api-update` 在 1.23 已标为弃用。- `WATCHTOWER_LABEL_ENABLE=true`,Peach 服务带 `com.centurylinklabs.watchtower.enable=true` 标签:同一台宿主机上的其他容器不受影响。-- `WATCHTOWER_HTTP_API_TOKEN=/run/secrets/watchtower_token`:令牌来自 compose secrets 文件,Watchtower 启动时发现这是已存在的文件就读其内容(`internal/flags/flags.go` 的 `getSecretFromFile`)。+- `WATCHTOWER_HTTP_API_TOKEN=/peach-update/watchtower-token`:令牌文件来自 `peach-update` 卷(见决策五),Watchtower 启动时发现这是已存在的文件就读其内容(`internal/flags/flags.go` 的 `getSecretFromFile`)。- 不发布端口。Peach 在同一 compose 网络里经 `http://watchtower:8080` 访问。+- `depends_on` 等 Peach 健康后才启动,保证读令牌时文件已经写好。- `WATCHTOWER_CLEANUP=true`:换下的旧镜像随 `edge` 移走变成无标签镜像,留着只占 NAS 磁盘,改回旧标签也用不上它。回滚按版本号标签从 Docker Hub 重新拉取。停 Peach 容器时 Watchtower 用容器自己的停止超时(`pkg/container/container_source.go` 读 `Config.StopTimeout`),即 compose 的 `stop_grace_period: 75s`,与手动 `docker compose up -d` 一致。@@ -37,9 +38,12 @@**二、一键更新的开放条件。** 「一键更新」主按钮同时满足以下条件才出现,否则保留两步命令:1. 运行在官方镜像里(`PEACH_DISTRIBUTION=docker`);-2. 配置页已保存 Watchtower 地址与令牌;-3. 镜像标签是 `edge`。compose 把 `PEACH_IMAGE_TAG: ${PEACH_VERSION:-edge}` 传进容器。Watchtower 只会把容器换到同一标签的新镜像;`.env` 把 `PEACH_VERSION` 固定成版本号时,一键更新拉回来的还是那个版本,所以这时给两步命令,并提示先改 `.env`;-4. 镜像仓库已有新版镜像(见决策三)。+2. 镜像标签是 `edge`。compose 把 `PEACH_IMAGE_TAG: ${PEACH_VERSION:-edge}` 传进容器。Watchtower 只会把容器换到同一标签的新镜像;`.env` 把 `PEACH_VERSION` 固定成版本号时,一键更新拉回来的还是那个版本,所以这时给两步命令,并提示先改 `.env`。容器里没有这个变量多半是旧 compose,提示换 compose 文件;+3. 令牌文件已生成;+4. 同一网络里探测得到 `http://watchtower:8080`(任何 HTTP 响应都算,探测不带令牌);解析不出来就是没启用 profile,照常给两步命令,并说明怎样启用;+5. 镜像仓库已有新版镜像(见决策三)。++用户不填任何设置,配置页也没有相应的表单。有待执行迁移不作为关闭条件:容器起来时启动入口会先备份再迁移,与手动更新相同。@@ -47,11 +51,15 @@**四、触发走异步。** Peach 调 `POST /v1/update?async=true`,带 `Authorization: Bearer <令牌>`,收到 202 即返回。同步调用时 Watchtower 会在请求中途停掉 Peach 容器,响应回不来。之后配置页轮询 `/api/client-updates`,运行版本变化后提示刷新页面;15 分钟内没有变化就报告未完成,并给出查看 Watchtower 日志的命令。Watchtower 正在执行另一次更新时回 429,页面照原文提示稍后重试。-**五、令牌只存本机,接口不回显。** Peach 侧的地址与令牌写在数据卷 `secrets/follow/watchtower.json`(`CredentialStore`,文件权限 600),读接口只回地址与 `token_set`。令牌留空表示不改。宿主机上同一个令牌放在 compose 目录的 `secrets/watchtower-token`,由用户生成。+**五、令牌由 Peach 生成,放在单独的卷里,接口不回传。** 官方镜像里有交给 UID 1000 的 `/update` 目录(`PEACH_UPDATE_DIR`),compose 在这里挂 `peach-update` 命名卷;空卷首次挂载时 Docker 照搬目录属主。`peach.server` 起服务前在里面生成 `watchtower-token`(32 字节随机,权限 600),已有就不动,之后不轮换。Watchtower 只读挂同一个卷,看不到 `/data`;用户把 `/data` 改成宿主机目录也不影响它。++不用 compose secrets 文件在两个容器间共享:2026-11-04 实测,服务引用的 secrets 文件不存在时 `docker compose up` 不报错,而是把该路径建成目录。给 Peach 也挂这个 secret,没启用 Watchtower 的部署会多出一个目录,日后再生成令牌文件就会失败。++Watchtower 只在启动时读令牌。宿主机重启后两个容器同时拉起,文件早已在卷里;万一对不上(例如有人删了卷里的文件),Peach 调更新接口会收到 401,页面提示运行 `docker compose restart watchtower`。## 后果-- 启用一键更新要多跑一个拿着 Docker socket 的容器。默认 compose 不起它,`docs/DOCKER.md` 写清启用步骤与这项风险。+- 启用一键更新要多跑一个拿着 Docker socket 的容器。默认 compose 不起它,`docs/DOCKER.md` 写清启用步骤与这项风险。没启用的部署只多一个装着令牌文件的小卷。- 迁移失败沿用启动入口的已知边界:迁移进程限时 180 秒,超时或失败时容器退出,`restart: unless-stopped` 会反复重启,每次重启都会再备份一份账本。回滚旧版镜像前必须先用迁移前的备份替换账本,旧版本拒绝写入它不认识的结构。这两点写进文档,本 ADR 不改启动入口。- Watchtower 不做健康检查回退。新容器起不来时,用户在宿主机上看 `docker compose logs`,按文档回滚。- 只核对 `linux/amd64` 单架构镜像的摘要;以后发布多架构 index 时,两个标签仍指向同一个 index,判据不变。diff --git a/docs/dockerhub/README.md b/docs/dockerhub/README.mdindex 93a2984e5..705270334 100644--- a/docs/dockerhub/README.md+++ b/docs/dockerhub/README.md@@ -55,6 +55,7 @@ services:- "${PEACH_BIND:-127.0.0.1}:${PEACH_PORT:-8900}:8900"volumes:- peach-data:/data+ - peach-update:/update- type: bindsource: ${PEACH_MEDIA_ROOT:?Set PEACH_MEDIA_ROOT in .env to an existing media folder}target: /media@@ -65,6 +66,7 @@ services:volumes:peach-data:+ peach-update:```Save `.env` next to it and replace the path with the absolute media path on your host:@@ -105,7 +107,9 @@ On NAS container UIs, run `peach token` in the Peach container's terminal to getRun `docker compose pull` and `docker compose up -d` again. Keep the `peach-data` volume: deleting it removes your settings, database and watch history.-To update from the settings page instead, run the optional Watchtower container from the repository's [`compose.yaml`](https://github.com/peach-mitao/peach/blob/master/compose.yaml) (`watchtower` profile) and enter its token under Settings → Maintenance → One-click update. Watchtower mounts the Docker socket, which gives it root-level control of the host; read the [one-click update section](https://github.com/peach-mitao/peach/blob/master/docs/DOCKER.md#一键更新可选-watchtower) before enabling it. Hardware transcoding, CloudDrive2 networking, path mapping and diagnostics are covered in the [Docker guide](https://github.com/peach-mitao/peach/blob/master/docs/DOCKER.md).+To update from the settings page instead, use the repository's [`compose.yaml`](https://github.com/peach-mitao/peach/blob/master/compose.yaml) and start it with `docker compose --profile watchtower up -d`. It adds an optional Watchtower container that Peach configures itself; the settings page then offers a one-click update when a new image is published. Watchtower mounts the Docker socket, which gives it root-level control of the host; read the [one-click update section](https://github.com/peach-mitao/peach/blob/master/docs/DOCKER.md#一键更新可选-watchtower) before enabling it.++Hardware transcoding, CloudDrive2 networking, path mapping and diagnostics are covered in the [Docker guide](https://github.com/peach-mitao/peach/blob/master/docs/DOCKER.md).## Licensediff --git a/frontend/src/react/bundle.d.ts b/frontend/src/react/bundle.d.tsindex 7d8530e1e..4094578e1 100644--- a/frontend/src/react/bundle.d.ts+++ b/frontend/src/react/bundle.d.ts@@ -256,15 +256,8 @@ export interface ReleaseState {in_app_update?: boolean;/** 容器换新版要在宿主机上做的几步;其他安装方式是空表。 */steps?: { text: string; command: string }[];-}--/** Docker 一键更新经 Watchtower(ADR-0140)。令牌不回传,只有存没存过。 */-export interface DockerUpdateState {- url: string;- token_set: boolean;- /** compose 传进来的镜像标签;不是 edge 时 Watchtower 换不到新版本。 */- image_tag: string;- rolling: boolean;+ /** Docker 镜像检查到新镜像时才有:能否经 Watchtower 一键更新(ADR-0140),不能时 `reason` 说明为什么。 */+ one_click?: { available: boolean; reason: string };}export interface UpdateJob {@@ -300,7 +293,6 @@ export interface ConfigurationData {downloads?: DownloadSettingsState;updates?: ReleaseState;update_job?: UpdateJob;- docker_update?: DockerUpdateState;automatic_updates?: AutomaticUpdateState;access?: AccessState;tunnel?: TunnelState;diff --git a/frontend/src/react/settings/docker-update.tsx b/frontend/src/react/settings/docker-update.tsxindex 5c6873f8d..10cc14463 100644--- a/frontend/src/react/settings/docker-update.tsx+++ b/frontend/src/react/settings/docker-update.tsx@@ -1,16 +1,13 @@-/* Docker 一键更新(ADR-0140):Watchtower 连接设置,以及点击后等新容器起来。+/* Docker 一键更新(ADR-0140):点击后等新容器起来。*- * 容器换不掉自己,Peach 只请同一 compose 里的 Watchtower 在后台拉镜像、重建容器。请求发出后- * Peach 会断开一会儿;每 3 秒问一次运行版本,换成新版本就提示刷新,15 分钟没换就报告未完成。 */-import { useEffect, useRef, useState, type FormEvent } from 'react';--import { Button } from '@/components/base/buttons/button';-import { Input } from '@/components/base/input/input';+ * 容器换不掉自己,Peach 只请同一 compose 里的 Watchtower 在后台拉镜像、重建容器;令牌与地址都由+ * compose 自动配好,页面没有设置项。请求发出后 Peach 会断开一会儿;每 3 秒问一次运行版本,+ * 换成新版本就提示刷新,15 分钟没换就报告未完成。 */+import { useEffect, useRef, useState } from 'react';import { apiGet, apiSend } from '../../api';-import type { DockerUpdateState } from '../bundle';-import { CommandSteps, ErrorText, Footer, Help, Section, Stack } from './section';-import { busyProps, useAction } from './use-action';+import { CommandSteps, ErrorText, Help, Stack } from './section';+import { useAction } from './use-action';const POLL = 3000;const GIVE_UP = 15 * 60 * 1000;@@ -47,7 +44,7 @@ export function useDockerUpdate(currentVersion: string) {}, [job.state, currentVersion]);const run = () => action.run('docker-update',- (signal) => apiSend<{ state: string }>('/api/configuration/docker-update/run', {}, 'POST', signal),+ (signal) => apiSend<{ state: string }>('/api/configuration/docker-update', {}, 'POST', signal),() => { started.current = Date.now(); setJob({ state: 'updating' }); });return { job, run, busy: action.busy === 'docker-update', error: action.error };}@@ -66,38 +63,3 @@ export function DockerUpdateProgress({ job }: { job: DockerJob }) {}return null;}--/** Watchtower 的地址与令牌。令牌提交后清空草稿,页面上不留明文,回来的只有存没存过。 */-export function DockerUpdateSettings({ state, onSaved, receipt }: {- state: DockerUpdateState; onSaved(next: DockerUpdateState): void; receipt(message: string): void;-}) {- const [url, setUrl] = useState(state.url);- const [token, setToken] = useState('');- const action = useAction();-- const submit = (event: FormEvent<HTMLFormElement>) => {- event.preventDefault();- void action.run('save', (signal) => apiSend<DockerUpdateState>('/api/configuration/docker-update', { url, token }, 'POST', signal),- (next) => { setToken(''); setUrl(next.url); onSaved(next); receipt('已保存配置'); });- };-- return (- <Section title="一键更新" onSubmit={submit}>- <Stack>- <Help>用 compose 的 watchtower profile 启动 Watchtower 后,填同一个令牌,检查更新时就能在页面里更新。Watchtower 能管理宿主机上的容器,启用前先读 Docker 部署说明。</Help>- <Input id="docker-update-url" label="Watchtower 地址" autoComplete="off" maxLength={512}- value={url} onChange={setUrl} hint="同一 compose 里填 http://watchtower:8080。" />- <Input id="docker-update-token" type="password" label="Watchtower 令牌" autoComplete="off" maxLength={512}- value={token} onChange={setToken}- hint={state.token_set ? '已保存,留空不改。' : '与宿主机 secrets/watchtower-token 文件的内容一致。'} />- {state.rolling ? null : state.image_tag- ? <Help>当前镜像标签是 {state.image_tag},Watchtower 只会换同一标签的新镜像。把 .env 的 PEACH_VERSION 删掉或改成 edge 后才能一键更新。</Help>- : <Help>容器里没有镜像标签,compose.yaml 可能还是旧版。换成仓库当前的 compose.yaml 后重建容器,才能一键更新。</Help>}- {action.error ? <ErrorText>{action.error}</ErrorText> : null}- </Stack>- <Footer>- <Button type="submit" {...busyProps(action.busy === 'save')}>保存配置</Button>- </Footer>- </Section>- );-}diff --git a/frontend/src/react/settings/general-settings.tsx b/frontend/src/react/settings/general-settings.tsxindex ca9bfc631..8b549b45f 100644--- a/frontend/src/react/settings/general-settings.tsx+++ b/frontend/src/react/settings/general-settings.tsx@@ -8,7 +8,6 @@ import { Switch } from '@/components/base/switch/switch';import { apiSend } from '../../api';import type { ConfigurationGroupProps, StartupState } from '../bundle';import { groupRoot } from './configuration-panel';-import { DockerUpdateSettings } from './docker-update';import { AutomaticUpdates } from './maintenance-settings';import { ReleaseUpdates } from './release-updates';import { UpgradeRepairs } from './upgrade-repairs';@@ -16,12 +15,9 @@ import { ErrorText, Footer, Help, Rows, Section, Stack } from './section';import { busyProps, useAction } from './use-action';export function GeneralSettings({ data, receipt, panel }: ConfigurationGroupProps) {- // 一键更新的连接只有 Docker 镜像有;保存后检查更新那一块要立刻知道配好了没有。- const [docker, setDocker] = useState(data.docker_update);return (<div {...groupRoot(panel)}>- {data.updates ? <ReleaseUpdates initial={data.updates} initialJob={data.update_job} docker={docker} /> : null}- {docker ? <DockerUpdateSettings state={docker} onSaved={setDocker} receipt={receipt} /> : null}+ {data.updates ? <ReleaseUpdates initial={data.updates} initialJob={data.update_job} /> : null}<UpgradeRepairs />{data.automatic_updates ? <AutomaticUpdates initial={data.automatic_updates} receipt={receipt} /> : null}{data.startup ? <StartupSettings startup={data.startup} receipt={receipt} /> : null}diff --git a/frontend/src/react/settings/release-updates.tsx b/frontend/src/react/settings/release-updates.tsxindex a45ed7ed0..b004bff19 100644--- a/frontend/src/react/settings/release-updates.tsx+++ b/frontend/src/react/settings/release-updates.tsx@@ -8,7 +8,7 @@ import { confirmModal } from '@peach/legacy/ui';import { Button, ButtonLink } from '@/components/base/buttons/button';import { apiGet, apiSend, errorMessage } from '../../api';-import type { DockerUpdateState, ReleaseState, UpdateJob } from '../bundle';+import type { ReleaseState, UpdateJob } from '../bundle';import { Note } from '../components/note';import { Progress } from '../components/progress';import { StatusLabel } from '../components/status-label';@@ -22,9 +22,7 @@ const MAX_FAILURES = 120;/** 服务端没给发布页时的去处;检查到新版本后服务端给的是那一版自己的发布页。 */const RELEASES_URL = 'https://github.com/peach-mitao/peach/releases';-export function ReleaseUpdates({ initial, initialJob, docker }: {- initial: ReleaseState; initialJob?: UpdateJob | undefined; docker?: DockerUpdateState | undefined;-}) {+export function ReleaseUpdates({ initial, initialJob }: { initial: ReleaseState; initialJob?: UpdateJob | undefined }) {const [data, setData] = useState(initial);const [job, setJob] = useState<UpdateJob>(initialJob || { state: 'idle', progress: 0 });const [pollError, setPollError] = useState('');@@ -33,7 +31,7 @@ export function ReleaseUpdates({ initial, initialJob, docker }: {const mounted = useRef(true);const running = ACTIVE.has(job.state);const container = useDockerUpdate(initial.current_version);- const oneClick = data.state === 'available' && !!docker?.token_set && !!docker.rolling;+ const oneClick = data.state === 'available' && !!data.one_click?.available;const rebuilding = container.job.state === 'updating';const confirmDockerUpdate = () => void confirmModal({title: '一键更新', body: `Watchtower 会拉取 Peach ${data.latest_version || ''} 的镜像并重建容器,/data 数据卷保留。`@@ -124,9 +122,12 @@ export function ReleaseUpdates({ initial, initialJob, docker }: {: error || data.state === 'error'? <ErrorText>{error || data.message}</ErrorText>: data.state === 'unchecked' ? null : <Help role="status">{data.message}</Help>}- {/* 容器没配 Watchtower 时没有应用内更新:在宿主机上拉镜像、重建容器。 */}+ {/* 容器没启用 Watchtower 时没有应用内更新:在宿主机上拉镜像、重建容器,并说明怎样才能一键更新。 */}{data.state === 'available' && !error && !oneClick && container.job.state === 'idle' && data.steps?.length- ? <CommandSteps label="在宿主机上更新" steps={data.steps} /> : null}+ ? <>+ <CommandSteps label="在宿主机上更新" steps={data.steps} />+ <Help>{data.one_click?.reason || '用 compose 的 watchtower profile 启动 Watchtower 后,可以在这里一键更新,启用前先读 Docker 部署说明。'}</Help>+ </> : null}<DockerUpdateProgress job={container.job} />{job.state === 'error' ? <ErrorText>{job.message}</ErrorText> : null}{job.state !== 'idle' && job.state !== 'error' ? (diff --git a/src/peach/docker_update.py b/src/peach/docker_update.pyindex 2bc3e1aec..733bedbba 100644--- a/src/peach/docker_update.py+++ b/src/peach/docker_update.py@@ -1,19 +1,19 @@-"""Docker 部署的一键更新(ADR-0140):核对镜像仓库、保存 Watchtower 连接、请它重建容器。+"""Docker 部署的一键更新(ADR-0140):核对镜像仓库、探测 Watchtower、请它重建容器。-容器换不掉自己,拉镜像与重建交给同一 compose 里可选的 Watchtower。Peach 只持有它的-HTTP API 地址与令牌;令牌存在本机 secrets,读接口只回存没存过。+容器换不掉自己,拉镜像与重建交给同一 compose 里可选的 Watchtower。两边共用的令牌由 Peach+在首次启动时生成,放在只装这一个文件的 `peach-update` 卷里;Watchtower 只读挂这个卷、+启动时读一次。用户不用填任何设置,接口也从不回传令牌。"""from __future__ import annotationsimport jsonimport osimport re+import secretsfrom pathlib import Path-from urllib.parse import urlsplitimport httpx-from .follow_secrets import CredentialStorefrom .fsutil import atomic_write_textfrom .http import HttpRequest@@ -27,17 +27,42 @@ MANIFEST_ACCEPT = ", ".join(("application/vnd.docker.distribution.manifest.v2+json",))_DIGEST = re.compile(r"sha256:[0-9a-f]{64}")-CREDENTIAL = "watchtower"-DEFAULT_URL = "http://watchtower:8080"+#: 同一 compose 网络里的服务名;watchtower profile 没启用时这个名字解析不出来。+WATCHTOWER_URL = "http://watchtower:8080"+#: 镜像里建好并交给 UID 1000 的目录,compose 把 `peach-update` 卷挂在这里。+UPDATE_DIR_ENV = "PEACH_UPDATE_DIR"+TOKEN_NAME = "watchtower-token"#: compose 把 `${PEACH_VERSION:-edge}` 传进来。Watchtower 只换同一标签的新镜像,钉了版本号就换不动。IMAGE_TAG_ENV = "PEACH_IMAGE_TAG"ROLLING_TAG = "edge"+RESTART_WATCHTOWER = "在 compose.yaml 所在目录运行 docker compose restart watchtower 后重试"def image_tag() -> str:return os.environ.get(IMAGE_TAG_ENV, "").strip()+def token_path() -> Path | None:+ directory = os.environ.get(UPDATE_DIR_ENV, "").strip()+ return Path(directory) / TOKEN_NAME if directory else None+++def ensure_token() -> None:+ """首次启动时生成令牌,之后不轮换:Watchtower 只在自己启动时读一次。"""+ path = token_path()+ if path is None or path.is_file():+ return+ atomic_write_text(path, secrets.token_urlsafe(32), mode=0o600)+++def _token() -> str:+ path = token_path()+ try:+ return path.read_text(encoding="utf-8").strip() if path is not None else ""+ except OSError:+ return ""++def _digest(transport, tag: str, token: str) -> str | None:response = transport(HttpRequest("HEAD", f"{REGISTRY}/v2/{REPOSITORY}/manifests/{tag}", {"Accept": MANIFEST_ACCEPT, "Authorization": f"Bearer {token}"}), 12.0, 0)@@ -65,73 +90,47 @@ def published(transport, version: str) -> bool:return target is not None and target == _digest(transport, ROLLING_TAG, token)-def values(root: Path) -> dict:- saved = CredentialStore(root).load(CREDENTIAL)- return dict(saved.values) if saved else {}+def _client(transport: httpx.BaseTransport | None, timeout: float) -> httpx.Client:+ # 地址在 compose 网络里:不走 Peach 代理,也不跟随重定向,令牌只发给这一个地址。+ return httpx.Client(trust_env=False, follow_redirects=False, timeout=timeout, transport=transport)-def describe(root: Path) -> dict:- saved = values(root)+def status(*, transport: httpx.BaseTransport | None = None) -> dict:+ """能不能一键更新;不能时 `reason` 说明为什么,没启用 Watchtower 时为空。"""tag = image_tag()- return {"url": saved.get("url") or DEFAULT_URL, "token_set": bool(saved.get("token")),- "image_tag": tag, "rolling": tag == ROLLING_TAG}---def ready(root: Path) -> bool:- state = describe(root)- return state["token_set"] and state["rolling"]+ if not tag:+ return {"available": False, "reason": "容器里没有镜像标签,compose.yaml 可能还是旧版;换成仓库当前的 compose.yaml 并重建容器后可一键更新。"}+ if tag != ROLLING_TAG:+ return {"available": False, "reason": f"镜像标签是 {tag},Watchtower 只换同一标签的新镜像;把 .env 的 PEACH_VERSION 删掉或改成 edge 后可一键更新。"}+ if not _token():+ return {"available": False, "reason": "更新令牌还没有生成,重建 Peach 容器后可一键更新。"}+ try:+ with _client(transport, 3.0) as client:+ client.get(WATCHTOWER_URL + "/v1/update")+ except httpx.HTTPError:+ # 名字解析不出来或连不上:没有用 watchtower profile 启动,照常给两步命令。+ return {"available": False, "reason": ""}+ return {"available": True, "reason": ""}-def save(root: Path, body: object) -> dict:- """保存地址与令牌;令牌留空表示不改,`clear_token` 才撤掉。"""- if not isinstance(body, dict):- raise ValueError("请填写 Watchtower 地址")- url = body.get("url")- if not isinstance(url, str) or not url.strip():- raise ValueError("请填写 Watchtower 地址")- url = url.strip().rstrip("/")- try:- parsed = urlsplit(url)- valid = (parsed.scheme in {"http", "https"} and parsed.hostname and not parsed.username- and not parsed.query and not parsed.fragment and parsed.path == "")- except ValueError:- valid = False- if not valid or any(char.isspace() for char in url):- raise ValueError("Watchtower 地址写成 http://主机名:端口,不带路径")- token = body.get("token") or ""- if not isinstance(token, str) or any(char.isspace() for char in token.strip()):- raise ValueError("令牌不能含空白字符")- saved = values(root)- token = "" if body.get("clear_token") is True else token.strip() or saved.get("token", "")- path = CredentialStore(root).path_for(CREDENTIAL)- atomic_write_text(path, json.dumps({"url": url, "token": token}), mode=0o600)- return describe(root)---def trigger(root: Path, *, transport: httpx.BaseTransport | None = None) -> dict:+def trigger(*, transport: httpx.BaseTransport | None = None) -> dict:"""请 Watchtower 在后台拉镜像、重建 Peach 容器,收到 202 就返回。- 必须异步:同步请求时 Watchtower 会在响应回来之前把 Peach 容器停掉。地址在 compose- 网络里,不走 Peach 代理,也不跟随重定向,令牌只发给这一个地址。+ 必须异步:同步请求时 Watchtower 会在响应回来之前把 Peach 容器停掉。"""- saved = values(root)- if not saved.get("token"):- raise ValueError("请先保存 Watchtower 令牌")- if not image_tag():- raise ValueError("容器里没有镜像标签,compose.yaml 可能还是旧版;换成仓库当前的 compose.yaml 后重建容器")- if image_tag() != ROLLING_TAG:- raise ValueError("镜像标签不是 edge,Watchtower 换不到新版本;请按下方步骤在宿主机上更新")- url = saved.get("url") or DEFAULT_URL+ state = status(transport=transport)+ if not state["available"]:+ raise ValueError(state["reason"] or "没有检测到 Watchtower,请用 compose 的 watchtower profile 启动")try:- with httpx.Client(trust_env=False, follow_redirects=False, timeout=15.0, transport=transport) as client:- response = client.post(url + "/v1/update", params={"async": "true"},- headers={"Authorization": f"Bearer {saved['token']}"})+ with _client(transport, 15.0) as client:+ response = client.post(WATCHTOWER_URL + "/v1/update", params={"async": "true"},+ headers={"Authorization": f"Bearer {_token()}"})except httpx.HTTPError as error:- raise OSError(f"连不上 Watchtower({type(error).__name__}),请确认已用 watchtower profile 启动") from error+ raise OSError(f"连不上 Watchtower({type(error).__name__}),请稍后重试") from errorif response.status_code == 202:return {"state": "updating", "message": "Watchtower 正在拉取新镜像并重建容器。"}if response.status_code == 401:- raise ValueError("Watchtower 拒绝了令牌,请核对与宿主机 secrets/watchtower-token 一致")+ raise ValueError(f"Watchtower 读到的令牌与 Peach 不一致;{RESTART_WATCHTOWER}")if response.status_code == 429:raise ValueError("Watchtower 正在执行另一次更新,请稍后再试")raise OSError(f"Watchtower 返回 HTTP {response.status_code}")diff --git a/src/peach/release_updates.py b/src/peach/release_updates.pyindex 14992eb61..92e7b4317 100644--- a/src/peach/release_updates.py+++ b/src/peach/release_updates.py@@ -129,7 +129,8 @@ def check(*, transport=None, system: str | None = None, machine: str | None = Nolatest = tag.removeprefix("v")if state == "available" and not docker_update.published(client, latest):state, message = "pending", f"Peach {latest} 的镜像尚未发布,请稍后再检查。"- return dict(result, latest_version=latest, state=state, release_url=release_url,+ extra = {"one_click": docker_update.status()} if state == "available" else {}+ return dict(result, latest_version=latest, state=state, release_url=release_url, **extra,message="有新镜像可拉取。" if state == "available" else message)return dict(result, latest_version=tag.removeprefix("v"), state=state, message=message,asset_url=f"{directory}/{asset['name']}",diff --git a/src/peach/routes_configuration.py b/src/peach/routes_configuration.pyindex d505411d3..118f857fc 100644--- a/src/peach/routes_configuration.py+++ b/src/peach/routes_configuration.py@@ -265,8 +265,6 @@ def snapshot(config) -> dict[str, Any]:("mount_dependencies", "挂载依赖", media_configuration.mount_dependencies),("facts", "运行信息", lambda: runtime_fact_entries(config)),)- if distribution.docker():- readers += (("docker_update", "一键更新设置", lambda: docker_update.describe(config.directory("secrets"))),)for key, title, reader in readers:_read_section(result, key, title, reader)return result@@ -808,29 +806,15 @@ def upgrade_repairs_review(request: Request, _args=Depends(require_auth)):headers={'Content-Disposition': 'attachment; filename="upgrade-review.json"'})-def _docker_secrets():- if not distribution.docker():- raise HTTPException(404, "只有 Docker 镜像有一键更新")- return settings_file.load_config().directory("secrets")--@router.post("/api/configuration/docker-update")-def save_docker_update(request: Request, body: dict = Body(...), _args=Depends(require_auth)):- """保存 Watchtower 地址与令牌;回应里只有地址和令牌存没存过。"""- local_only(request)- same_origin(request)- try:- return docker_update.save(_docker_secrets(), body)- except (ValueError, OSError) as exc:- raise HTTPException(400, str(exc)) from exc--[email protected]("/api/configuration/docker-update/run")def run_docker_update(request: Request, _args=Depends(require_auth)):+ """请同一 compose 里的 Watchtower 拉取新镜像并重建容器(ADR-0140)。"""local_only(request)same_origin(request)+ if not distribution.docker():+ raise HTTPException(404, "只有 Docker 镜像有一键更新")try:- return docker_update.trigger(_docker_secrets())+ return docker_update.trigger()except (ValueError, OSError) as exc:raise HTTPException(409, str(exc)) from excdiff --git a/src/peach/server.py b/src/peach/server.pyindex 3c68d3d44..2f3671c0b 100644--- a/src/peach/server.py+++ b/src/peach/server.py@@ -117,6 +117,13 @@ def main(argv: list[str] | None = None) -> int:for signum in (signal.SIGTERM, signal.SIGINT):signal.signal(signum, lambda *_: stopping.set())initialize()+ if os.environ.get('PEACH_DISTRIBUTION') == 'docker':+ # 起服务前写好:watchtower profile 等 Peach 就绪才启动,启动时读这份令牌(ADR-0140)。+ from .docker_update import ensure_token+ try:+ ensure_token()+ except OSError as error:+ print(f"一键更新令牌未能生成:{error}", file=sys.stderr, flush=True)print(f"Peach 服务监听:{args.host}:{args.port}。容器外部访问地址以宿主机端口映射为准。", flush=True)print("首次登录:在运行 Peach 的环境中执行 peach token 查看口令,登录后设置访问密码。", flush=True)if os.environ.get('PEACH_DISTRIBUTION') == 'docker':diff --git a/tests/test_release_updates.py b/tests/test_release_updates.pyindex c771b8627..0ff7e7fa0 100644--- a/tests/test_release_updates.py+++ b/tests/test_release_updates.py@@ -178,7 +178,8 @@ class ReleaseUpdateTests(unittest.TestCase):return HttpResponse(200, {}, json.dumps([release("1.0.0")]).encode())with patch.dict("os.environ", {"PEACH_DISTRIBUTION": "docker"}), \- patch.object(release_updates, "__version__", "0.9.0"):+ patch.object(release_updates, "__version__", "0.9.0"), \+ patch.object(docker_update, "status", return_value={"available": True, "reason": ""}):return release_updates.check(transport=transport, system="linux", machine="x86_64"), callsdef test_docker_image_reports_itself_and_gives_host_steps_instead_of_a_package(self):@@ -193,6 +194,7 @@ class ReleaseUpdateTests(unittest.TestCase):self.assertEqual(result["release_url"], release_updates.RELEASES_URL + "/tag/v1.0.0")self.assertNotIn("package_kind", result, "容器不下载 Windows 发行包")self.assertNotIn("asset_url", result)+ self.assertEqual(result["one_click"], {"available": True, "reason": ""})manifests = [request for request in calls if "/manifests/" in request.url]self.assertEqual({request.method for request in manifests}, {"HEAD"}, "只读摘要,不下载 manifest 正文与镜像层")self.assertTrue(all(request.headers["Authorization"] == "Bearer anonymous" for request in manifests))@@ -209,6 +211,7 @@ class ReleaseUpdateTests(unittest.TestCase):self.assertEqual(result["state"], "pending", "Release 已建、镜像还没推送时不能提示拉取")self.assertEqual(result["latest_version"], "1.0.0")self.assertIn("镜像尚未发布", result["message"])+ self.assertNotIn("one_click", result, "镜像没推送时不给一键更新")result, _ = self.docker_check({"1.0.0": new, "edge": new}, auth_status=503)self.assertEqual(result["state"], "error", "读不到镜像仓库就是没查成,不当成有新版")@@ -222,49 +225,63 @@ class ReleaseUpdateTests(unittest.TestCase):class DockerUpdateTests(unittest.TestCase):def setUp(self):self.root = Path(self.enterContext(tempfile.TemporaryDirectory()))- self.enterContext(patch.dict("os.environ", {docker_update.IMAGE_TAG_ENV: "edge"}))+ self.enterContext(patch.dict("os.environ", {docker_update.IMAGE_TAG_ENV: "edge",+ docker_update.UPDATE_DIR_ENV: str(self.root)}))- def watchtower(self, status):+ def watchtower(self, post_status, *, reachable=True):+ """假 Watchtower:探测(GET)回 401 表示在线,更新请求(POST)回 `post_status`。"""requests = []def handler(request):requests.append(request)- return httpx.Response(status)+ if not reachable:+ raise httpx.ConnectError("Name or service not known", request=request)+ return httpx.Response(401 if request.method == "GET" else post_status)return httpx.MockTransport(handler), requests- def test_token_is_kept_locally_and_never_echoed(self):- state = docker_update.describe(self.root)- self.assertEqual((state["url"], state["token_set"], state["rolling"]), (docker_update.DEFAULT_URL, False, True))- saved = docker_update.save(self.root, {"url": "http://watchtower:8080/", "token": "s3cret"})- self.assertEqual(saved, {"url": "http://watchtower:8080", "token_set": True, "image_tag": "edge", "rolling": True})- self.assertNotIn("s3cret", json.dumps(saved))- docker_update.save(self.root, {"url": "http://watchtower:8080", "token": ""})- self.assertEqual(docker_update.values(self.root)["token"], "s3cret", "留空表示不改")- self.assertFalse(docker_update.save(self.root, {"url": "http://watchtower:8080", "clear_token": True})["token_set"])- for url in ("watchtower:8080", "http://watchtower:8080/v1/update", "http://user@watchtower:8080", "ftp://watchtower"):- with self.subTest(url=url), self.assertRaises(ValueError):- docker_update.save(self.root, {"url": url, "token": "x"})-- def test_trigger_posts_an_async_update_with_the_saved_token(self):- docker_update.save(self.root, {"url": "http://watchtower:8080", "token": "s3cret"})+ def test_token_is_generated_once_and_kept(self):+ docker_update.ensure_token()+ path = self.root / docker_update.TOKEN_NAME+ first = path.read_text(encoding="utf-8")+ self.assertGreaterEqual(len(first), 40)+ docker_update.ensure_token()+ self.assertEqual(path.read_text(encoding="utf-8"), first, "Watchtower 只在启动时读一次,换了就对不上")+ with patch.dict("os.environ", {docker_update.UPDATE_DIR_ENV: ""}):+ docker_update.ensure_token() # 不在官方镜像里:没有令牌目录,什么也不做++ def test_one_click_needs_a_rolling_tag_a_token_and_a_reachable_watchtower(self):+ transport, _ = self.watchtower(202)+ self.assertIn("令牌", docker_update.status(transport=transport)["reason"])+ docker_update.ensure_token()+ self.assertEqual(docker_update.status(transport=transport), {"available": True, "reason": ""})+ self.assertEqual(docker_update.status(transport=self.watchtower(202, reachable=False)[0]),+ {"available": False, "reason": ""}, "没启用 watchtower profile 时照常给两步命令,不报错")+ for tag, message in (("0.53.0", ".env"), ("", "compose.yaml")):+ with self.subTest(tag=tag), patch.dict("os.environ", {docker_update.IMAGE_TAG_ENV: tag}):+ state = docker_update.status(transport=transport)+ self.assertFalse(state["available"])+ self.assertIn(message, state["reason"], "旧 compose 没传标签时要指向 compose 文件,不是 .env")++ def test_trigger_posts_an_async_update_with_the_generated_token(self):+ docker_update.ensure_token()+ token = (self.root / docker_update.TOKEN_NAME).read_text(encoding="utf-8")transport, requests = self.watchtower(202)- self.assertEqual(docker_update.trigger(self.root, transport=transport)["state"], "updating")- [request] = requests- self.assertEqual((request.method, str(request.url)), ("POST", "http://watchtower:8080/v1/update?async=true"),+ self.assertEqual(docker_update.trigger(transport=transport)["state"], "updating")+ posted = [request for request in requests if request.method == "POST"]+ self.assertEqual([str(request.url) for request in posted], [docker_update.WATCHTOWER_URL + "/v1/update?async=true"],"同步请求的响应会被 Watchtower 停容器打断")- self.assertEqual(request.headers["Authorization"], "Bearer s3cret")- for status, message in ((401, "令牌"), (429, "另一次更新"), (500, "HTTP 500")):+ self.assertEqual(posted[0].headers["Authorization"], f"Bearer {token}")+ self.assertFalse(any("Authorization" in request.headers for request in requests if request.method == "GET"),+ "探测不带令牌")+ for status, message in ((401, "docker compose restart watchtower"), (429, "另一次更新"), (500, "HTTP 500")):with self.subTest(status=status), self.assertRaisesRegex((ValueError, OSError), message):- docker_update.trigger(self.root, transport=self.watchtower(status)[0])+ docker_update.trigger(transport=self.watchtower(status)[0])- def test_trigger_refuses_without_a_token_or_a_rolling_tag(self):+ def test_trigger_refuses_before_contacting_watchtower_when_it_cannot_update(self):transport, requests = self.watchtower(202)- with self.assertRaisesRegex(ValueError, "令牌"):- docker_update.trigger(self.root, transport=transport)- docker_update.save(self.root, {"url": "http://watchtower:8080", "token": "s3cret"})- for tag, message in (("0.53.0", "edge"), ("", "compose.yaml")):- with self.subTest(tag=tag), patch.dict("os.environ", {docker_update.IMAGE_TAG_ENV: tag}):- self.assertFalse(docker_update.ready(self.root))- with self.assertRaisesRegex(ValueError, message, msg="旧 compose 没传标签时要指向 compose 文件,不是 .env"):- docker_update.trigger(self.root, transport=transport)+ docker_update.ensure_token()+ with patch.dict("os.environ", {docker_update.IMAGE_TAG_ENV: "0.53.0"}), self.assertRaisesRegex(ValueError, "edge"):+ docker_update.trigger(transport=transport)self.assertEqual(requests, [], "换不到新版本时不打扰 Watchtower")+ with self.assertRaisesRegex(ValueError, "watchtower profile"):+ docker_update.trigger(transport=self.watchtower(202, reachable=False)[0])diff --git a/web/dist/peach-app.configuration-page-DrYVxvix.js b/web/dist/peach-app.configuration-page-DnmSyP33.jssimilarity index 88%rename from web/dist/peach-app.configuration-page-DrYVxvix.jsrename to web/dist/peach-app.configuration-page-DnmSyP33.jsindex 92fd6d17c..c3816318e 100644--- a/web/dist/peach-app.configuration-page-DrYVxvix.js+++ b/web/dist/peach-app.configuration-page-DnmSyP33.js@@ -1,7 +1,7 @@(function() {try {var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7e29bc25-ab84-42e6-a136-b98eb873a38a", e._sentryDebugIdIdentifier = "sentry-dbid-7e29bc25-ab84-42e6-a136-b98eb873a38a");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "291b0207-ad40-4fe7-a5a3-8833eac94686", e._sentryDebugIdIdentifier = "sentry-dbid-291b0207-ad40-4fe7-a5a3-8833eac94686");} catch {}})();import { AnimatedItems as e, Cell as t, ChartBackground as n, ChartContainer as r, ChartLegend as i, ChartLegendContent as a, ChartTip as o, ChartTooltip as s, ChartTooltipContent as c, Curve as l, DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME as u, DATA_ITEM_INDEX_ATTRIBUTE_NAME as d, DefaultZIndexes as f, EvilBarChart as p, LabelList as m, LabelListFromLabelProp as h, Layer as g, LoadingIndicator as _, PolarChart as v, PolarLabelContextProvider as y, PolarLabelListContextProvider as b, RegisterGraphicalItemId as x, Sector as S, SetPolarGraphicalItem as C, SetPolarLegendPayload as w, SetTooltipEntrySettings as T, Shape as ee, TIP_SWATCH as te, Text as ne, ZIndexLayer as re, adaptEventsOfChild as ie, arrayTooltipSearcher as ae, createSelector as oe, defaultPolarChartProps as se, findAllByType as ce, get as le, getClassNameFromUnknown as ue, getColorsCount as de, getMaxRadius as fe, getPercentValue as pe, getTooltipNameProp as me, getValueByDataKey as he, interpolate as ge, isNumber as _e, matchAppend as ve, mathSign as ye, polarToCartesian as be, resolveDefaultProps as xe, selectActiveTooltipDataKey as Se, selectActiveTooltipGraphicalItemId as Ce, selectActiveTooltipIndex as we, selectChartDataAndAlwaysIgnoreIndexes as Te, selectChartOffsetInternal as Ee, selectUnfilteredPolarItems as De, svgPropertiesNoEvents as Oe, svgPropertiesNoEventsFromUnknown as ke, tone as Ae, useAnimationCallbacks as je, useAppSelector as Me, useMouseClickItemDispatch as Ne, useMouseEnterItemDispatch as Pe, useMouseLeaveItemDispatch as Fe, usePolarChartLayout as Ie } from "./peach-app.chart-tip-CRxYp6KT.js";@@ -705,111 +705,12 @@ function jr({ state: e, settle: t, receipt: n, username: r, setUsername: i }) {]});}-// src/react/settings/docker-update.tsx-var Mr = 3e3, Nr = 9e5;-function Pr(e) {- let [t, n] = (0, Z.useState)({ state: "idle" }), r = Y(), i = (0, Z.useRef)(0);- return (0, Z.useEffect)(() => {- if (t.state !== "updating") return;- let r = new AbortController(), a, o = async () => {- try {- let t = (await W("/api/client-updates", r.signal)).runtime?.version;- if (!r.signal.aborted && t && t !== e) {- n({- state: "done",- version: t- });- return;- }- } catch {}- r.signal.aborted || (Date.now() - i.current > Nr ? n({ state: "timeout" }) : a = setTimeout(o, Mr));- };- return a = setTimeout(o, Mr), () => {- r.abort(), clearTimeout(a);- };- }, [t.state, e]), {- job: t,- run: () => r.run("docker-update", (e) => G("/api/configuration/docker-update/run", {}, "POST", e), () => {- i.current = Date.now(), n({ state: "updating" });- }),- busy: r.busy === "docker-update",- error: r.error- };-}-function Fr({ job: e }) {- return e.state === "updating" ? /* @__PURE__ */ (0, Q.jsx)(N, {- role: "status",- children: "Watchtower 正在拉取新镜像并重建容器。期间 Peach 会断开一会儿,新版本启动后这里会提示刷新。"- }) : e.state === "done" ? /* @__PURE__ */ (0, Q.jsxs)(N, {- role: "status",- children: [- "已更新到 Peach ",- e.version,- ",刷新页面即可使用。"- ]- }) : e.state === "timeout" ? /* @__PURE__ */ (0, Q.jsxs)(V, { children: [/* @__PURE__ */ (0, Q.jsx)(k, { children: "15 分钟内没有看到新版本启动。在 compose.yaml 所在目录查看 Watchtower 与 Peach 的日志:" }), /* @__PURE__ */ (0, Q.jsx)(tt, {- label: "查看更新日志",- steps: [{- text: "Watchtower 的拉取与重建记录",- command: "docker compose logs watchtower"- }, {- text: "Peach 的启动与数据库迁移记录",- command: "docker compose logs peach"- }]- })] }) : null;-}-function Ir({ state: e, onSaved: t, receipt: n }) {- let [r, i] = (0, Z.useState)(e.url), [a, o] = (0, Z.useState)(""), s = Y();- return /* @__PURE__ */ (0, Q.jsxs)(L, {- title: "一键更新",- onSubmit: (e) => {- e.preventDefault(), s.run("save", (e) => G("/api/configuration/docker-update", {- url: r,- token: a- }, "POST", e), (e) => {- o(""), i(e.url), t(e), n("已保存配置");- });- },- children: [/* @__PURE__ */ (0, Q.jsxs)(V, { children: [- /* @__PURE__ */ (0, Q.jsx)(N, { children: "用 compose 的 watchtower profile 启动 Watchtower 后,填同一个令牌,检查更新时就能在页面里更新。Watchtower 能管理宿主机上的容器,启用前先读 Docker 部署说明。" }),- /* @__PURE__ */ (0, Q.jsx)(P, {- id: "docker-update-url",- label: "Watchtower 地址",- autoComplete: "off",- maxLength: 512,- value: r,- onChange: i,- hint: "同一 compose 里填 http://watchtower:8080。"- }),- /* @__PURE__ */ (0, Q.jsx)(P, {- id: "docker-update-token",- type: "password",- label: "Watchtower 令牌",- autoComplete: "off",- maxLength: 512,- value: a,- onChange: o,- hint: e.token_set ? "已保存,留空不改。" : "与宿主机 secrets/watchtower-token 文件的内容一致。"- }),- e.rolling ? null : e.image_tag ? /* @__PURE__ */ (0, Q.jsxs)(N, { children: [- "当前镜像标签是 ",- e.image_tag,- ",Watchtower 只会换同一标签的新镜像。把 .env 的 PEACH_VERSION 删掉或改成 edge 后才能一键更新。"- ] }) : /* @__PURE__ */ (0, Q.jsx)(N, { children: "容器里没有镜像标签,compose.yaml 可能还是旧版。换成仓库当前的 compose.yaml 后重建容器,才能一键更新。" }),- s.error ? /* @__PURE__ */ (0, Q.jsx)(k, { children: s.error }) : null- ] }), /* @__PURE__ */ (0, Q.jsx)(M, { children: /* @__PURE__ */ (0, Q.jsx)(E, {- type: "submit",- ...K(s.busy === "save"),- children: "保存配置"- }) })]- });-}// src/react/settings/ledger-backup-settings.tsx-var Lr = "/api/configuration/ledger-backups", Rr = 1500, zr = (e) => (/* @__PURE__ */ new Date(e.modified_at * 1e3)).toLocaleString();-function Br(e) {+var Mr = "/api/configuration/ledger-backups", Nr = 1500, Pr = (e) => (/* @__PURE__ */ new Date(e.modified_at * 1e3)).toLocaleString();+function Fr(e) {return [e.source === "manual" ? "手动" : `自动 · ${e.purpose}`, J(e.bytes)].join(" · ");}-function Vr({ job: e, label: t }) {+function Ir({ job: e, label: t }) {return /* @__PURE__ */ (0, Q.jsxs)("div", {"aria-live": "polite",className: "flex flex-col gap-2",@@ -824,23 +725,23 @@ function Vr({ job: e, label: t }) {]});}-function Hr({ receipt: e }) {+function Lr({ receipt: e }) {let [t, n] = (0, Z.useState)(null), [r, i] = (0, Z.useState)(""), a = Y(), o = t?.backup.status === "running", s = t?.restore.status === "running", c = o || s, l = (0, Z.useRef)({backup: !1,restore: !1});if ((0, Z.useEffect)(() => {let e = new AbortController();- return W(Lr, e.signal).then(n, (t) => {+ return W(Mr, e.signal).then(n, (t) => {e.signal.aborted || i(String(t?.message || t));}), () => e.abort();}, []), (0, Z.useEffect)(() => {if (!c) return;let e = new AbortController(), t = setTimeout(() => {- W(Lr, e.signal).then(n, () => {+ W(Mr, e.signal).then(n, () => {e.signal.aborted || n((e) => e && { ...e });});- }, Rr);+ }, Nr);return () => {e.abort(), clearTimeout(t);};@@ -855,13 +756,13 @@ function Hr({ receipt: e }) {title: "账本备份",children: /* @__PURE__ */ (0, Q.jsx)(V, { children: r ? /* @__PURE__ */ (0, Q.jsx)(k, { children: r }) : /* @__PURE__ */ (0, Q.jsx)(vt, { label: "正在读取备份列表" }) })});- let u = () => void a.run("backup", (e) => G(`${Lr}/backup`, {}, "POST", e), n), d = (e) => void rn({+ let u = () => void a.run("backup", (e) => G(`${Mr}/backup`, {}, "POST", e), n), d = (e) => void rn({title: "从备份恢复账本",danger: !0,- body: `将用 ${zr(e)} 的备份(${Br(e)})替换当前账本,此后的资料、观看记录与复核结论回到备份时的状态。替换前先把当前账本另存为一份备份;恢复期间不能启动新任务。`,+ body: `将用 ${Pr(e)} 的备份(${Fr(e)})替换当前账本,此后的资料、观看记录与复核结论回到备份时的状态。替换前先把当前账本另存为一份备份;恢复期间不能启动新任务。`,confirmLabel: "替换当前账本",onConfirm: async () => {- l.current.restore = !0, n(await G(`${Lr}/restore`, {+ l.current.restore = !0, n(await G(`${Mr}/restore`, {id: e.id,confirm: !0}));@@ -875,11 +776,11 @@ function Hr({ receipt: e }) {/* @__PURE__ */ (0, Q.jsxs)(V, { children: [/* @__PURE__ */ (0, Q.jsx)(N, { children: "账本保存全部资料、观看记录与复核结论。手动备份与写入前的自动备份放在一起,保留最近 5 份和 24 小时内的备份。" }),t.writer ? null : /* @__PURE__ */ (0, Q.jsxs)(N, { children: ["这台电脑不是账本写入端,只能在写入端恢复:", t.writer_reason] }),- o ? /* @__PURE__ */ (0, Q.jsx)(Vr, {+ o ? /* @__PURE__ */ (0, Q.jsx)(Ir, {job: t.backup,label: "备份进度"}) : null,- s ? /* @__PURE__ */ (0, Q.jsx)(Vr, {+ s ? /* @__PURE__ */ (0, Q.jsx)(Ir, {job: t.restore,label: "恢复进度"}) : null,@@ -891,8 +792,8 @@ function Hr({ receipt: e }) {className: "border-t border-separator-border","data-ledger-backups": "",children: /* @__PURE__ */ (0, Q.jsx)(I, { children: t.backups.map((e) => /* @__PURE__ */ (0, Q.jsx)(B, {- label: zr(e),- description: Br(e),+ label: Pr(e),+ description: Fr(e),children: /* @__PURE__ */ (0, Q.jsx)(E, {variant: "secondary",disabled: !t.writer || c,@@ -914,7 +815,7 @@ function Hr({ receipt: e }) {});}// src/react/settings/library-sharing-settings.tsx-function Ur({ initial: e, receipt: t }) {+function Rr({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(null), [o, s] = (0, Z.useState)(!1), [c, l] = (0, Z.useState)(!1), u = (0, Z.useMemo)(() => i ? JSON.stringify(i.data, null, 2) : "", [i]), d = Y(), f = (e) => void d.run("save", (t) => G("/api/configuration/library-sharing", {enabled: e,schema: n.schema,@@ -1044,7 +945,7 @@ function Ur({ initial: e, receipt: t }) {] });}// src/react/settings/remote-reporting-settings.tsx-function Wr({ value: e, onChange: t, busy: n = !1 }) {+function zr({ value: e, onChange: t, busy: n = !1 }) {return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(I, { children: /* @__PURE__ */ (0, Q.jsx)(B, {label: "发送版本统计与错误诊断(推荐)",description: "上传版本、系统信息、故障类型、代码位置与发生次数。",@@ -1066,9 +967,9 @@ function Wr({ value: e, onChange: t, busy: n = !1 }) {})})] });}-function Gr({ initial: e, receipt: t }) {+function Br({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e), i = Y();- return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Wr, {+ return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(zr, {value: n,busy: i.busy === "save",onChange: (e) => {@@ -1085,8 +986,8 @@ function Gr({ initial: e, receipt: t }) {}) : null] });}// src/react/components/animated-number.tsx-var Kr = .6;-function qr({ value: e, format: t = (e) => Math.round(e).toLocaleString(), className: n }) {+var Vr = .6;+function Hr({ value: e, format: t = (e) => Math.round(e).toLocaleString(), className: n }) {let r = Un(), [i, a] = (0, Z.useState)(e), o = (0, Z.useRef)(e);return (0, Z.useEffect)(() => {if (r || o.current === e) {@@ -1094,7 +995,7 @@ function qr({ value: e, format: t = (e) => Math.round(e).toLocaleString(), classreturn;}let t = Xt(o.current, e, {- duration: Kr,+ duration: Vr,ease: "easeOut",onUpdate: (e) => {o.current = e, a(e);@@ -1107,7 +1008,7 @@ function qr({ value: e, format: t = (e) => Math.round(e).toLocaleString(), class});}// node_modules/recharts/es6/state/selectors/pieSelectors.js-function Jr(e, t) {+function Ur(e, t) {var n = Object.keys(e);if (Object.getOwnPropertySymbols) {var r = Object.getOwnPropertySymbols(e);@@ -1117,30 +1018,30 @@ function Jr(e, t) {}return n;}-function Yr(e) {+function Wr(e) {for (var t = 1; t < arguments.length; t++) {var n = arguments[t] == null ? {} : arguments[t];- t % 2 ? Jr(Object(n), !0).forEach(function(t) {- Xr(e, t, n[t]);- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Jr(Object(n)).forEach(function(t) {+ t % 2 ? Ur(Object(n), !0).forEach(function(t) {+ Gr(e, t, n[t]);+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ur(Object(n)).forEach(function(t) {Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));});}return e;}-function Xr(e, t, n) {- return (t = Zr(t)) in e ? Object.defineProperty(e, t, {+function Gr(e, t, n) {+ return (t = Kr(t)) in e ? Object.defineProperty(e, t, {value: n,enumerable: !0,configurable: !0,writable: !0}) : e[t] = n, e;}-function Zr(e) {- var t = Qr(e, "string");+function Kr(e) {+ var t = qr(e, "string");return typeof t == "symbol" ? t : t + "";}-function Qr(e, t) {+function qr(e, t) {if (typeof e != "object" || !e) return e;var n = e[Symbol.toPrimitive];if (n !== void 0) {@@ -1150,20 +1051,20 @@ function Qr(e, t) {}return (t === "string" ? String : Number)(e);}-var $r = oe([De, (e, t) => t], (e, t) => e.filter((e) => e.type === "pie").find((e) => e.id === t)), ei = [], ti = (e, t, n) => n?.length === 0 ? ei : n, ni = oe([+var Jr = oe([De, (e, t) => t], (e, t) => e.filter((e) => e.type === "pie").find((e) => e.id === t)), Yr = [], Xr = (e, t, n) => n?.length === 0 ? Yr : n, Zr = oe([Te,- $r,- ti+ Jr,+ Xr], (e, t, n) => {var r = e.chartData;if (t != null) {var i = t?.data != null && t.data.length > 0 ? t.data : r;- if (i && i.length || n == null || (i = n.map((e) => Yr(Yr({}, t.presentationProps), e.props))), i != null) return i;+ if (i && i.length || n == null || (i = n.map((e) => Wr(Wr({}, t.presentationProps), e.props))), i != null) return i;}-}), ri = oe([- ni,- $r,- ti+}), Qr = oe([+ Zr,+ Jr,+ Xr], (e, t, n) => {if (e != null && t != null) return e.map((e, r) => {var i, a = he(e, t.nameKey, t.name), o = n != null && (i = n[r]) != null && (i = i.props) != null && i.fill ? n[r].props.fill : typeof e == "object" && e && "fill" in e ? e.fill : t.fill;@@ -1175,42 +1076,42 @@ var $r = oe([De, (e, t) => t], (e, t) => e.filter((e) => e.type === "pie").find(type: t.legendType};});-}), ii = oe([- ni,- $r,- ti,+}), $r = oe([+ Zr,+ Jr,+ Xr,Ee], (e, t, n, r) => {- if (t != null && e != null) return ki({+ if (t != null && e != null) return wi({offset: r,pieSettings: t,displayedData: e,cells: n});-}), ai = ["key"], oi = [+}), ei = ["key"], ti = ["onMouseEnter","onClick","onMouseLeave"-], si = ["id"], ci = ["id"];-function li() {- return li = Object.assign ? Object.assign.bind() : function(e) {+], ni = ["id"], ri = ["id"];+function ii() {+ return ii = Object.assign ? Object.assign.bind() : function(e) {for (var t = 1; t < arguments.length; t++) {var n = arguments[t];for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);}return e;- }, li.apply(null, arguments);+ }, ii.apply(null, arguments);}-function ui(e, t) {+function ai(e, t) {if (e == null) return {};- var n, r, i = di(e, t);+ var n, r, i = oi(e, t);if (Object.getOwnPropertySymbols) {var a = Object.getOwnPropertySymbols(e);for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);}return i;}-function di(e, t) {+function oi(e, t) {if (e == null) return {};var n = {};for (var r in e) if ({}.hasOwnProperty.call(e, r)) {@@ -1219,7 +1120,7 @@ function di(e, t) {}return n;}-function fi(e, t) {+function si(e, t) {var n = Object.keys(e);if (Object.getOwnPropertySymbols) {var r = Object.getOwnPropertySymbols(e);@@ -1232,27 +1133,27 @@ function fi(e, t) {function $(e) {for (var t = 1; t < arguments.length; t++) {var n = arguments[t] == null ? {} : arguments[t];- t % 2 ? fi(Object(n), !0).forEach(function(t) {- pi(e, t, n[t]);- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : fi(Object(n)).forEach(function(t) {+ t % 2 ? si(Object(n), !0).forEach(function(t) {+ ci(e, t, n[t]);+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : si(Object(n)).forEach(function(t) {Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));});}return e;}-function pi(e, t, n) {- return (t = mi(t)) in e ? Object.defineProperty(e, t, {+function ci(e, t, n) {+ return (t = li(t)) in e ? Object.defineProperty(e, t, {value: n,enumerable: !0,configurable: !0,writable: !0}) : e[t] = n, e;}-function mi(e) {- var t = hi(e, "string");+function li(e) {+ var t = ui(e, "string");return typeof t == "symbol" ? t : t + "";}-function hi(e, t) {+function ui(e, t) {if (typeof e != "object" || !e) return e;var n = e[Symbol.toPrimitive];if (n !== void 0) {@@ -1262,12 +1163,12 @@ function hi(e, t) {}return (t === "string" ? String : Number)(e);}-var gi = S;-function _i(e) {- var n = (0, Z.useMemo)(() => ce(e.children, t), [e.children]), r = Me((t) => ri(t, e.id, n));+var di = S;+function fi(e) {+ var n = (0, Z.useMemo)(() => ce(e.children, t), [e.children]), r = Me((t) => Qr(t, e.id, n));return r == null ? null : /*#__PURE__*/ Z.createElement(w, { legendPayload: r });}-function vi(e) {+function pi(e) {if (e != null && typeof e != "boolean" && typeof e != "function") {if (/*#__PURE__*/ Z.isValidElement(e)) {var t = e.props?.fill;@@ -1277,8 +1178,8 @@ function vi(e) {return typeof n == "string" ? n : void 0;}}-var yi = /*#__PURE__*/ Z.memo((e) => {- var t = e.dataKey, n = e.nameKey, r = e.sectors, i = e.stroke, a = e.strokeWidth, o = e.fill, s = e.name, c = e.hide, l = e.tooltipType, u = e.formatter, d = e.id, f = e.activeShape, p = vi(f), m = {+var mi = /*#__PURE__*/ Z.memo((e) => {+ var t = e.dataKey, n = e.nameKey, r = e.sectors, i = e.stroke, a = e.strokeWidth, o = e.fill, s = e.name, c = e.hide, l = e.tooltipType, u = e.formatter, d = e.id, f = e.activeShape, p = pi(f), m = {dataDefinedOnItem: r.map((e) => {var t = e.tooltipPayload;return p == null || t == null ? t : t.map((e) => $($({}, e), {}, {@@ -1303,42 +1204,42 @@ var yi = /*#__PURE__*/ Z.memo((e) => {}};return /*#__PURE__*/ Z.createElement(T, { tooltipEntrySettings: m });-}), bi = (e, t) => e > t ? "start" : e < t ? "end" : "middle", xi = (e, t, n) => pe(typeof t == "function" ? t(e) : t, n, n * .8), Si = (e, t, n) => {+}), hi = (e, t) => e > t ? "start" : e < t ? "end" : "middle", gi = (e, t, n) => pe(typeof t == "function" ? t(e) : t, n, n * .8), _i = (e, t, n) => {var r = t.top, i = t.left, a = t.width, o = t.height, s = fe(a, o);return {cx: i + pe(e.cx, a, a / 2),cy: r + pe(e.cy, o, o / 2),innerRadius: pe(e.innerRadius, s, 0),- outerRadius: xi(n, e.outerRadius, s),+ outerRadius: gi(n, e.outerRadius, s),maxRadius: e.maxRadius || Math.sqrt(a * a + o * o) / 2};-}, Ci = (e, t) => ye(t - e) * Math.min(Math.abs(t - e), 360), wi = (e, t) => {+}, vi = (e, t) => ye(t - e) * Math.min(Math.abs(t - e), 360), yi = (e, t) => {if (/*#__PURE__*/ Z.isValidElement(e)) return /*#__PURE__*/ Z.cloneElement(e, t);if (typeof e == "function") return e(t);var n = tn("recharts-pie-label-line", typeof e == "boolean" ? "" : e.className);t.key;- var r = ui(t, ai);- return /*#__PURE__*/ Z.createElement(l, li({}, r, {+ var r = ai(t, ei);+ return /*#__PURE__*/ Z.createElement(l, ii({}, r, {type: "linear",className: n}));-}, Ti = (e, t, n) => {+}, bi = (e, t, n) => {if (/*#__PURE__*/ Z.isValidElement(e)) return /*#__PURE__*/ Z.cloneElement(e, t);var r = n;if (typeof e == "function" && (r = e(t), /*#__PURE__*/ Z.isValidElement(r))) return r;var i = tn("recharts-pie-label-text", ue(e));- return /*#__PURE__*/ Z.createElement(ne, li({}, t, {+ return /*#__PURE__*/ Z.createElement(ne, ii({}, t, {alignmentBaseline: "middle",className: i}), r);};-function Ei(e) {+function xi(e) {var t = e.sectors, n = e.props, r = e.showLabels, i = n.label, a = n.labelLine, o = n.dataKey;if (!r || !i || !t) return null;var s = Oe(n), c = ke(i), l = ke(a), u = typeof i == "object" && "offsetRadius" in i && typeof i.offsetRadius == "number" && i.offsetRadius || 20, d = t.map((e, t) => {var n = (e.startAngle + e.endAngle) / 2, r = be(e.cx, e.cy, e.outerRadius + u, n), d = $($($($({}, s), e), {}, { stroke: "none" }, c), {}, {index: t,- textAnchor: bi(r.x, e.cx)+ textAnchor: hi(r.x, e.cx)}, r), p = $($($($({}, s), e), {}, {fill: "none",stroke: e.fill@@ -1350,20 +1251,20 @@ function Ei(e) {return /*#__PURE__*/ Z.createElement(re, {zIndex: f.label,key: `label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${t}`- }, /*#__PURE__*/ Z.createElement(g, null, a && wi(a, p), Ti(i, d, he(e, o))));+ }, /*#__PURE__*/ Z.createElement(g, null, a && yi(a, p), bi(i, d, he(e, o))));});return /*#__PURE__*/ Z.createElement(g, { className: "recharts-pie-labels" }, d);}-function Di(e) {+function Si(e) {var t = e.sectors, n = e.props, r = e.showLabels, i = n.label;- return typeof i == "object" && i && "position" in i ? /*#__PURE__*/ Z.createElement(h, { label: i }) : /*#__PURE__*/ Z.createElement(Ei, {+ return typeof i == "object" && i && "position" in i ? /*#__PURE__*/ Z.createElement(h, { label: i }) : /*#__PURE__*/ Z.createElement(xi, {sectors: t,props: n,showLabels: r});}-function Oi(e) {- var t = e.sectors, n = e.activeShape, r = e.inactiveShape, i = e.allOtherPieProps, a = e.shape, o = e.id, s = e.animationElapsedTime, c = e.isAnimating, l = e.isEntrance, f = Me(we), p = Me(Se), m = Me(Ce), h = i.onMouseEnter, _ = i.onClick, v = i.onMouseLeave, y = ui(i, oi), b = Pe(h, i.dataKey, o), x = Fe(v), S = Ne(_, i.dataKey, o);+function Ci(e) {+ var t = e.sectors, n = e.activeShape, r = e.inactiveShape, i = e.allOtherPieProps, a = e.shape, o = e.id, s = e.animationElapsedTime, c = e.isAnimating, l = e.isEntrance, f = Me(we), p = Me(Se), m = Me(Ce), h = i.onMouseEnter, _ = i.onClick, v = i.onMouseLeave, y = ai(i, ti), b = Pe(h, i.dataKey, o), x = Fe(v), S = Ne(_, i.dataKey, o);return t == null || t.length === 0 ? null : /*#__PURE__*/ Z.createElement(Z.Fragment, null, t.map((e, h) => {if (e?.startAngle === 0 && e?.endAngle === 0 && t.length !== 1) return null;var _ = m == null || m === o, v = String(h) === f && (p == null || i.dataKey === p) && _, C = n && v ? n : f ? r : null, w = $($({}, e), {}, {@@ -1377,7 +1278,7 @@ function Oi(e) {[d]: h,[u]: o});- return /*#__PURE__*/ Z.createElement(g, li({+ return /*#__PURE__*/ Z.createElement(g, ii({key: `sector-${e?.startAngle}-${e?.endAngle}-${e.midAngle}-${h}`,tabIndex: -1,className: "recharts-pie-sector"@@ -1387,13 +1288,13 @@ function Oi(e) {onClick: S(e, h)}), /*#__PURE__*/ Z.createElement(ee, {option: C ?? a,- DefaultShape: gi,+ DefaultShape: di,shapeProps: w}));}));}-function ki(e) {- var t = e.pieSettings, n = e.displayedData, r = e.cells, i = e.offset, a = t.cornerRadius, o = t.startAngle, s = t.endAngle, c = t.dataKey, l = t.nameKey, u = t.tooltipType, d = Math.abs(t.minAngle), f = Ci(o, s), p = Math.abs(f), m = n.length <= 1 ? 0 : t.paddingAngle ?? 0, h = n.filter((e) => he(e, c, 0) !== 0).length, g = (p >= 360 ? h : h - 1) * m, _ = n.reduce((e, t) => {+function wi(e) {+ var t = e.pieSettings, n = e.displayedData, r = e.cells, i = e.offset, a = t.cornerRadius, o = t.startAngle, s = t.endAngle, c = t.dataKey, l = t.nameKey, u = t.tooltipType, d = Math.abs(t.minAngle), f = vi(o, s), p = Math.abs(f), m = n.length <= 1 ? 0 : t.paddingAngle ?? 0, h = n.filter((e) => he(e, c, 0) !== 0).length, g = (p >= 360 ? h : h - 1) * m, _ = n.reduce((e, t) => {var n = he(t, c, 0);return e + (_e(n) ? n : 0);}, 0), v = d > 0 && _ > 0 && n.some((e) => {@@ -1403,7 +1304,7 @@ function ki(e) {if (_ > 0) {var x;b = n.map((e, n) => {- var s = he(e, c, 0), d = he(e, l, n), p = Si(t, i, e), h = (_e(s) ? s : 0) / _, g, b = $($({}, e), r && r[n] && r[n].props), S = b != null && "fill" in b && typeof b.fill == "string" ? b.fill : t.fill;+ var s = he(e, c, 0), d = he(e, l, n), p = _i(t, i, e), h = (_e(s) ? s : 0) / _, g, b = $($({}, e), r && r[n] && r[n].props), S = b != null && "fill" in b && typeof b.fill == "string" ? b.fill : t.fill;g = n ? x.endAngle + ye(f) * m * (s === 0 ? 0 : 1) : o;var C = g + ye(f) * ((s === 0 ? 0 : v) + h * y), w = (g + C) / 2, T = (p.innerRadius + p.outerRadius) / 2, ee = [{name: d,@@ -1435,7 +1336,7 @@ function ki(e) {}return b;}-function Ai(e) {+function Ti(e) {var t = e.showLabels, n = e.sectors, r = e.children, i = (0, Z.useMemo)(() => !t || !n ? [] : n.map((e) => ({value: e.value,payload: e.payload,@@ -1454,7 +1355,7 @@ function Ai(e) {})), [n, t]);return /*#__PURE__*/ Z.createElement(b, { value: t ? i : void 0 }, r);}-var ji = (e, t) => {+var Ei = (e, t) => {if (e == null) return [];var n = [], r = e.find((e) => e.status !== "removed"), i = r ? r.next.startAngle : 0;return e.forEach((e, r) => {@@ -1476,11 +1377,11 @@ var ji = (e, t) => {}}), n;};-function Mi(t) {+function Di(t) {var n = t.props, r = t.previousSectorsRef, i = t.id, a = n.sectors, o = n.activeShape, s = n.inactiveShape, c = n.animationInterpolateFn, l = je(n.onAnimationStart, n.onAnimationEnd), u = l.isAnimating, d = l.handleAnimationStart, f = l.handleAnimationEnd, p = Ie();if (p == null) return null;var m = a[0];- return /*#__PURE__*/ Z.createElement(Ai, {+ return /*#__PURE__*/ Z.createElement(Ti, {showLabels: !u,sectors: a}, /*#__PURE__*/ Z.createElement(e, {@@ -1497,7 +1398,7 @@ function Mi(t) {animationInterpolateFn: c,animationMatchBy: n.animationMatchBy,layout: p- }, (e, t, r) => /*#__PURE__*/ Z.createElement(g, null, /*#__PURE__*/ Z.createElement(Oi, {+ }, (e, t, r) => /*#__PURE__*/ Z.createElement(g, null, /*#__PURE__*/ Z.createElement(Ci, {sectors: e,activeShape: o,inactiveShape: s,@@ -1507,7 +1408,7 @@ function Mi(t) {animationElapsedTime: t,isAnimating: u || t < 1,isEntrance: r- }))), /*#__PURE__*/ Z.createElement(Di, {+ }))), /*#__PURE__*/ Z.createElement(Si, {showLabels: !u,sectors: a,props: n@@ -1521,11 +1422,11 @@ function Mi(t) {clockWise: !1}, n.children));}-var Ni = {+var Oi = {animationBegin: 400,animationDuration: 1500,animationEasing: "ease",- animationInterpolateFn: ji,+ animationInterpolateFn: Ei,animationMatchBy: ve,cx: "50%",cy: "50%",@@ -1543,17 +1444,17 @@ var Ni = {outerRadius: "80%",paddingAngle: 0,rootTabIndex: 0,- shape: gi,+ shape: di,startAngle: 0,stroke: "#fff",zIndex: f.area};-function Pi(e) {- var n = e.id, r = ui(e, si), i = e.hide, a = e.className, o = e.rootTabIndex, s = (0, Z.useMemo)(() => ce(e.children, t), [e.children]), c = Me((e) => ii(e, n, s)), l = (0, Z.useRef)(null), u = tn("recharts-pie", a);+function ki(e) {+ var n = e.id, r = ai(e, ni), i = e.hide, a = e.className, o = e.rootTabIndex, s = (0, Z.useMemo)(() => ce(e.children, t), [e.children]), c = Me((e) => $r(e, n, s)), l = (0, Z.useRef)(null), u = tn("recharts-pie", a);return i || c == null ? (l.current = null, /*#__PURE__*/ Z.createElement(g, {tabIndex: o,className: u- })) : /*#__PURE__*/ Z.createElement(re, { zIndex: e.zIndex }, /*#__PURE__*/ Z.createElement(yi, {+ })) : /*#__PURE__*/ Z.createElement(re, { zIndex: e.zIndex }, /*#__PURE__*/ Z.createElement(mi, {dataKey: e.dataKey,nameKey: e.nameKey,sectors: c,@@ -1569,14 +1470,14 @@ function Pi(e) {}), /*#__PURE__*/ Z.createElement(g, {tabIndex: o,className: u- }, /*#__PURE__*/ Z.createElement(Mi, {+ }, /*#__PURE__*/ Z.createElement(Di, {props: $($({}, r), {}, { sectors: c }),previousSectorsRef: l,id: n})));}-function Fi(e) {- var t = xe(e, Ni), n = t.id, r = ui(t, ci), i = Oe(r);+function Ai(e) {+ var t = xe(e, Oi), n = t.id, r = ai(t, ri), i = Oe(r);return /*#__PURE__*/ Z.createElement(x, {id: n,type: "pie"@@ -1604,12 +1505,12 @@ function Fi(e) {cornerRadius: r.cornerRadius,presentationProps: i,maxRadius: t.maxRadius- }), /*#__PURE__*/ Z.createElement(_i, li({}, r, { id: e })), /*#__PURE__*/ Z.createElement(Pi, li({}, r, { id: e }))));+ }), /*#__PURE__*/ Z.createElement(fi, ii({}, r, { id: e })), /*#__PURE__*/ Z.createElement(ki, ii({}, r, { id: e }))));}-var Ii = Fi;-Ii.displayName = "Pie";+var ji = Ai;+ji.displayName = "Pie";// node_modules/recharts/es6/chart/PieChart.js-function Li(e, t) {+function Mi(e, t) {var n = Object.keys(e);if (Object.getOwnPropertySymbols) {var r = Object.getOwnPropertySymbols(e);@@ -1619,30 +1520,30 @@ function Li(e, t) {}return n;}-function Ri(e) {+function Ni(e) {for (var t = 1; t < arguments.length; t++) {var n = arguments[t] == null ? {} : arguments[t];- t % 2 ? Li(Object(n), !0).forEach(function(t) {- zi(e, t, n[t]);- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Li(Object(n)).forEach(function(t) {+ t % 2 ? Mi(Object(n), !0).forEach(function(t) {+ Pi(e, t, n[t]);+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Mi(Object(n)).forEach(function(t) {Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));});}return e;}-function zi(e, t, n) {- return (t = Bi(t)) in e ? Object.defineProperty(e, t, {+function Pi(e, t, n) {+ return (t = Fi(t)) in e ? Object.defineProperty(e, t, {value: n,enumerable: !0,configurable: !0,writable: !0}) : e[t] = n, e;}-function Bi(e) {- var t = Vi(e, "string");+function Fi(e) {+ var t = Ii(e, "string");return typeof t == "symbol" ? t : t + "";}-function Vi(e, t) {+function Ii(e, t) {if (typeof e != "object" || !e) return e;var n = e[Symbol.toPrimitive];if (n !== void 0) {@@ -1652,27 +1553,27 @@ function Vi(e, t) {}return (t === "string" ? String : Number)(e);}-var Hi = ["item"], Ui = Ri(Ri({}, se), {}, {+var Li = ["item"], Ri = Ni(Ni({}, se), {}, {layout: "centric",startAngle: 0,endAngle: 360-}), Wi = /*#__PURE__*/ (0, Z.forwardRef)((e, t) => {- var n = xe(e, Ui);+}), zi = /*#__PURE__*/ (0, Z.forwardRef)((e, t) => {+ var n = xe(e, Ri);return /*#__PURE__*/ Z.createElement(v, {chartName: "PieChart",defaultTooltipEventType: "item",- validateTooltipEventTypes: Hi,+ validateTooltipEventTypes: Li,tooltipPayloadSearcher: ae,categoricalChartProps: n,ref: t});-}), Gi = 5, Ki = 2e3, qi = 0, Ji = "80%", Yi = 0, Xi = 0, Zi = 0, Qi = 360, $i = [], ea = (0, Z.createContext)(null);-function ta() {- let e = (0, Z.use)(ea);+}), Bi = 5, Vi = 2e3, Hi = 0, Ui = "80%", Wi = 0, Gi = 0, Ki = 0, qi = 360, Ji = [], Yi = (0, Z.createContext)(null);+function Xi() {+ let e = (0, Z.use)(Yi);if (!e) throw Error("Pie chart parts (<Pie />, <Tooltip />, …) must be used within <EvilPieChart />");return e;}-function na({ config: e, data: t, dataKey: n, nameKey: i, children: a, className: o, chartProps: s, defaultSelectedSector: c = null, onSelectionChange: l, isLoading: u = !1 }) {+function Zi({ config: e, data: t, dataKey: n, nameKey: i, children: a, className: o, chartProps: s, defaultSelectedSector: c = null, onSelectionChange: l, isLoading: u = !1 }) {let [d, f] = (0, Z.useState)(c), p = (0, Z.useCallback)((e) => {if (f(e), e === null) {l?.(null);@@ -1705,12 +1606,12 @@ function na({ config: e, data: t, dataKey: n, nameKey: i, children: a, classNamed,p]);- return /* @__PURE__ */ (0, Q.jsx)(ea, {+ return /* @__PURE__ */ (0, Q.jsx)(Yi, {value: m,children: /* @__PURE__ */ (0, Q.jsxs)(r, {className: o,config: e,- children: [/* @__PURE__ */ (0, Q.jsx)(_, { isLoading: u }), /* @__PURE__ */ (0, Q.jsx)(Wi, {+ children: [/* @__PURE__ */ (0, Q.jsx)(_, { isLoading: u }), /* @__PURE__ */ (0, Q.jsx)(zi, {id: "evil-charts-pie-chart",accessibilityLayer: !0,...s,@@ -1719,10 +1620,10 @@ function na({ config: e, data: t, dataKey: n, nameKey: i, children: a, className})});}-function ra({ variant: e = "gradient", innerRadius: t = qi, outerRadius: n = Ji, cornerRadius: r = Yi, paddingAngle: i = Xi, startAngle: a = Zi, endAngle: o = Qi, isClickable: s = !1, glowingSectors: c = $i, children: l, pieProps: u }) {- let { config: d, data: f, dataKey: p, nameKey: m, isLoading: h, selectedSector: g, selectSector: _ } = ta(), v = (0, Z.useId)().replace(/:/g, "");- if (h) return /* @__PURE__ */ (0, Q.jsx)(Ii, {- data: da,+function Qi({ variant: e = "gradient", innerRadius: t = Hi, outerRadius: n = Ui, cornerRadius: r = Wi, paddingAngle: i = Gi, startAngle: a = Ki, endAngle: o = qi, isClickable: s = !1, glowingSectors: c = Ji, children: l, pieProps: u }) {+ let { config: d, data: f, dataKey: p, nameKey: m, isLoading: h, selectedSector: g, selectSector: _ } = Xi(), v = (0, Z.useId)().replace(/:/g, "");+ if (h) return /* @__PURE__ */ (0, Q.jsx)(ji, {+ data: oa,dataKey: "value",nameKey: "name",innerRadius: t,@@ -1733,13 +1634,13 @@ function ra({ variant: e = "gradient", innerRadius: t = qi, outerRadius: n = Ji,endAngle: o,strokeWidth: 0,isAnimationActive: !1,- shape: (e) => /* @__PURE__ */ (0, Q.jsx)(fa, { ...e })+ shape: (e) => /* @__PURE__ */ (0, Q.jsx)(sa, { ...e })});- let y = ca(l, p), b = f.map((e) => ({+ let y = ra(l, p), b = f.map((e) => ({...e,fill: `url(#${v}-colors-${e[m]})`}));- return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Ii, {+ return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(ji, {data: b,dataKey: p,nameKey: m,@@ -1771,18 +1672,18 @@ function ra({ variant: e = "gradient", innerRadius: t = qi, outerRadius: n = Ji,},...u,children: y- }), /* @__PURE__ */ (0, Q.jsxs)("defs", { children: [/* @__PURE__ */ (0, Q.jsx)(la, {+ }), /* @__PURE__ */ (0, Q.jsxs)("defs", { children: [/* @__PURE__ */ (0, Q.jsx)(ia, {id: v,config: d,variant: e- }), c.length > 0 && /* @__PURE__ */ (0, Q.jsx)(ua, {+ }), c.length > 0 && /* @__PURE__ */ (0, Q.jsx)(aa, {id: v,glowingSectors: c})] })] });}-var ia = () => null;-function aa({ variant: e, roundness: t, defaultIndex: n }) {- let { isLoading: r, nameKey: i } = ta();+var $i = () => null;+function ea({ variant: e, roundness: t, defaultIndex: n }) {+ let { isLoading: r, nameKey: i } = Xi();return r ? null : /* @__PURE__ */ (0, Q.jsx)(s, {defaultIndex: n,content: /* @__PURE__ */ (0, Q.jsx)(c, {@@ -1793,8 +1694,8 @@ function aa({ variant: e, roundness: t, defaultIndex: n }) {})});}-function oa({ variant: e, align: t = "center", verticalAlign: n = "bottom", isClickable: r = !1 }) {- let { nameKey: o, selectedSector: s, selectSector: c } = ta();+function ta({ variant: e, align: t = "center", verticalAlign: n = "bottom", isClickable: r = !1 }) {+ let { nameKey: o, selectedSector: s, selectSector: c } = Xi();return /* @__PURE__ */ (0, Q.jsx)(i, {verticalAlign: n,align: t,@@ -1807,13 +1708,13 @@ function oa({ variant: e, align: t = "center", verticalAlign: n = "bottom", isCl})});}-function sa({ variant: e = "dots" }) {+function na({ variant: e = "dots" }) {return /* @__PURE__ */ (0, Q.jsx)(n, { variant: e });}-var ca = (e, t) => {+var ra = (e, t) => {let n = null;return Z.Children.forEach(e, (e) => {- if (!(0, Z.isValidElement)(e) || e.type !== ia) return;+ if (!(0, Z.isValidElement)(e) || e.type !== $i) return;let { dataKey: r, labelListProps: i } = e.props;n = /* @__PURE__ */ (0, Q.jsx)(m, {dataKey: r ?? t,@@ -1825,7 +1726,7 @@ var ca = (e, t) => {...i});}), n;-}, la = ({ id: e, config: t }) => /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: Object.entries(t).map(([t, n]) => {+}, ia = ({ id: e, config: t }) => /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: Object.entries(t).map(([t, n]) => {let r = de(n);return /* @__PURE__ */ (0, Q.jsx)("linearGradient", {id: `${e}-colors-${t}`,@@ -1847,7 +1748,7 @@ var ca = (e, t) => {}, i);})}, `${e}-colors-${t}`);-}) }), ua = ({ id: e, glowingSectors: t }) => /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: t.map((t) => /* @__PURE__ */ (0, Q.jsxs)("filter", {+}) }), aa = ({ id: e, glowingSectors: t }) => /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: t.map((t) => /* @__PURE__ */ (0, Q.jsxs)("filter", {id: `${e}-glow-${t}`,x: "-100%",y: "-100%",@@ -1867,11 +1768,11 @@ var ca = (e, t) => {}),/* @__PURE__ */ (0, Q.jsxs)("feMerge", { children: [/* @__PURE__ */ (0, Q.jsx)("feMergeNode", { in: "glow" }), /* @__PURE__ */ (0, Q.jsx)("feMergeNode", { in: "SourceGraphic" })] })]-}, `${e}-glow-${t}`)) }), da = Array.from({ length: Gi }, (e, t) => ({+}, `${e}-glow-${t}`)) }), oa = Array.from({ length: Bi }, (e, t) => ({name: `loading${t}`,- value: 100 / Gi-})), fa = (e) => {- let { index: t = 0, ...n } = e, r = t / Gi * (Ki / 1e3);+ value: 100 / Bi+})), sa = (e) => {+ let { index: t = 0, ...n } = e, r = t / Bi * (Vi / 1e3);return /* @__PURE__ */ (0, Q.jsx)(Sn.g, {initial: { opacity: .15 },animate: { opacity: [@@ -1880,7 +1781,7 @@ var ca = (e, t) => {.15] },transition: {- duration: Ki / 1e3,+ duration: Vi / 1e3,delay: r,repeat: Infinity,ease: "easeInOut"@@ -1891,9 +1792,9 @@ var ca = (e, t) => {})});};-na.Pie = ra, na.Label = ia, na.Tooltip = aa, na.Legend = oa, na.Background = sa;+Zi.Pie = Qi, Zi.Label = $i, Zi.Tooltip = ea, Zi.Legend = ta, Zi.Background = na;// src/react/settings/storage-charts.tsx-var pa = {+var ca = {database: "var(--color-chart-1)",backups: "var(--color-chart-2)",playback: "var(--color-chart-3)",@@ -1903,7 +1804,7 @@ var pa = {sources: "var(--color-chart-7)",records: "var(--color-chart-8)",tools: "var(--color-chart-9)"-}, ma = "var(--color-text-tertiary)", ha = {+}, la = "var(--color-text-tertiary)", ua = {database: "bg-chart-1",backups: "bg-chart-2",playback: "bg-chart-3",@@ -1913,23 +1814,23 @@ var pa = {sources: "bg-chart-7",records: "bg-chart-8",tools: "bg-chart-9"-}, ga = (e) => J(e);-function _a(e) {- let t = e.filter((e) => pa[e.key] && e.bytes > 0).map((e) => ({+}, da = (e) => J(e);+function fa(e) {+ let t = e.filter((e) => ca[e.key] && e.bytes > 0).map((e) => ({key: e.key,label: e.label,bytes: e.bytes,- color: pa[e.key]- })), n = e.filter((e) => !pa[e.key]).reduce((e, t) => e + t.bytes, 0);+ color: ca[e.key]+ })), n = e.filter((e) => !ca[e.key]).reduce((e, t) => e + t.bytes, 0);return n > 0 ? [...t, {key: "rest",label: "其余",bytes: n,- color: ma+ color: la}] : t;}-function va({ storage: e }) {- let t = e.usage, n = _a(t.categories), r = Object.fromEntries(n.map((e) => [e.key, {+function pa({ storage: e }) {+ let t = e.usage, n = fa(t.categories), r = Object.fromEntries(n.map((e) => [e.key, {label: e.label,colors: Ae(e.color)}])), i = n.map((e) => ({@@ -1941,14 +1842,14 @@ function va({ storage: e }) {children: [/* @__PURE__ */ (0, Q.jsxs)("div", {className: "relative mx-auto size-48 flex-none",role: "img",- "aria-label": `数据目录共 ${ga(t.total_bytes)},各类占比`,- children: [/* @__PURE__ */ (0, Q.jsxs)(na, {+ "aria-label": `数据目录共 ${da(t.total_bytes)},各类占比`,+ children: [/* @__PURE__ */ (0, Q.jsxs)(Zi, {data: i,dataKey: "value",nameKey: "slice",config: r,className: "aspect-square size-48 flex-none",- children: [/* @__PURE__ */ (0, Q.jsx)(na.Pie, {+ children: [/* @__PURE__ */ (0, Q.jsx)(Zi.Pie, {innerRadius: "68%",outerRadius: "100%",paddingAngle: 1,@@ -1956,13 +1857,13 @@ function va({ storage: e }) {}), /* @__PURE__ */ (0, Q.jsx)(o, {nameKey: "slice",hideLabel: !0,- format: ga+ format: da})]}), /* @__PURE__ */ (0, Q.jsxs)("div", {className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children: [/* @__PURE__ */ (0, Q.jsx)("b", {className: "text-title-2-medium tabular-nums text-text-primary",- children: ga(t.total_bytes)+ children: da(t.total_bytes)}), /* @__PURE__ */ (0, Q.jsxs)("small", {className: "text-caption-1-regular tabular-nums text-text-secondary",children: [t.total_files.toLocaleString(), " 个文件"]@@ -1978,20 +1879,20 @@ function va({ storage: e }) {children: [/* @__PURE__ */ (0, Q.jsx)("i", {"aria-hidden": !0,- className: `${te} ${ha[e.key] || "bg-text-tertiary"}`+ className: `${te} ${ua[e.key] || "bg-text-tertiary"}`}),e.label,/* @__PURE__ */ (0, Q.jsx)("span", {className: "tabular-nums text-text-primary",- children: ga(e.bytes)+ children: da(e.bytes)})]}, e.key))- }), /* @__PURE__ */ (0, Q.jsx)(ya, { storage: e })]+ }), /* @__PURE__ */ (0, Q.jsx)(ma, { storage: e })]})]});}-function ya({ storage: e }) {+function ma({ storage: e }) {if (e.total_bytes === null || e.free_bytes === null || !e.usage) return null;let t = Math.min(e.usage.total_bytes, e.total_bytes), n = e.free_bytes, r = Math.max(0, e.total_bytes - n - t), i = {peach: {@@ -2000,7 +1901,7 @@ function ya({ storage: e }) {},others: {label: "其他文件",- colors: Ae(ma)+ colors: Ae(la)},free: {label: "可用",@@ -2013,7 +1914,7 @@ function ya({ storage: e }) {className: "text-caption-1-regular text-text-secondary",children: ["所在磁盘共 ",- ga(e.total_bytes),+ da(e.total_bytes),e.system_drive ? "(系统盘)" : "",",Peach 占 ",((t) => {@@ -2021,7 +1922,7 @@ function ya({ storage: e }) {return n < .1 ? "不到 0.1%" : `${n.toFixed(+(n < 10))}%`;})(t),", 可用 ",- ga(n)+ da(n)]}), /* @__PURE__ */ (0, Q.jsxs)(p, {data: [{@@ -2052,26 +1953,26 @@ function ya({ storage: e }) {/* @__PURE__ */ (0, Q.jsx)(p.Bar, { dataKey: "free" }),/* @__PURE__ */ (0, Q.jsx)(o, {hideLabel: !0,- format: ga+ format: da})]})]});}// src/react/settings/storage-settings.tsx-var ba = "/api/configuration/storage", xa = 1500, Sa = 864e5, Ca = (e) => e instanceof qe && e.body?.errors?.target || q(e);-function wa(e) {+var ha = "/api/configuration/storage", ga = 1500, _a = 864e5, va = (e) => e instanceof qe && e.body?.errors?.target || q(e);+function ya(e) {if (e.free_bytes === null || e.total_bytes === null) return "未取得";let t = `${J(e.free_bytes)} 可用,共 ${J(e.total_bytes)}`;return e.system_drive ? `${t}(系统盘)` : t;}-var Ta = (e) => e.cleanable && e.reclaimable > 0;-function Ea({ job: e }) {+var ba = (e) => e.cleanable && e.reclaimable > 0;+function xa({ job: e }) {let t = e.files || 0, n = e.expected_files || 0, r = /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: ["已统计 ",- /* @__PURE__ */ (0, Q.jsx)(qr, { value: t }),+ /* @__PURE__ */ (0, Q.jsx)(Hr, { value: t })," 个文件 · ",- /* @__PURE__ */ (0, Q.jsx)(qr, {+ /* @__PURE__ */ (0, Q.jsx)(Hr, {value: e.bytes || 0,format: J})@@ -2091,8 +1992,8 @@ function Ea({ job: e }) {] })] }) : /* @__PURE__ */ (0, Q.jsx)(vt, { label: "正在统计占用空间" }), n ? null : /* @__PURE__ */ (0, Q.jsx)(N, { children: r })]});}-function Da({ category: e, selected: t, disabled: n, onToggle: r }) {- let i = Ta(e), a = e.cleanable ? e.reclaimable > 0 ? `清理后${e.note}` : "没有可以清理的文件" : `不能清理:${e.note}`;+function Sa({ category: e, selected: t, disabled: n, onToggle: r }) {+ let i = ba(e), a = e.cleanable ? e.reclaimable > 0 ? `清理后${e.note}` : "没有可以清理的文件" : `不能清理:${e.note}`;return /* @__PURE__ */ (0, Q.jsxs)("div", {"data-category": e.key,className: "flex min-h-13 w-full items-start gap-3 border-b border-separator-border py-2.5 pr-3 last:border-b-0",@@ -2111,7 +2012,7 @@ function Da({ category: e, selected: t, disabled: n, onToggle: r }) {className: "flex items-center gap-2 text-body-regular text-text-primary",children: [/* @__PURE__ */ (0, Q.jsx)("i", {"aria-hidden": !0,- className: `size-2.5 shrink-0 rounded-xs ${ha[e.key] || "bg-text-tertiary"}`+ className: `size-2.5 shrink-0 rounded-xs ${ua[e.key] || "bg-text-tertiary"}`}), e.label]}),/* @__PURE__ */ (0, Q.jsx)("p", {@@ -2126,7 +2027,7 @@ function Da({ category: e, selected: t, disabled: n, onToggle: r }) {}),/* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex shrink-0 flex-col items-end gap-0.5 text-right",- children: [/* @__PURE__ */ (0, Q.jsx)(qr, {+ children: [/* @__PURE__ */ (0, Q.jsx)(Hr, {value: e.bytes,format: J,className: "text-body-regular text-text-primary"@@ -2138,22 +2039,22 @@ function Da({ category: e, selected: t, disabled: n, onToggle: r }) {]});}-function Oa({ initial: e, receipt: t }) {+function Ca({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(""), [o, s] = (0, Z.useState)(/* @__PURE__ */ new Set()), c = Y(), l = n.job.state !== "idle", u = (0, Z.useRef)(l);(0, Z.useEffect)(() => {if (!l) return;let e = new AbortController(), t = setTimeout(() => {- W(ba, e.signal).then(r, () => {+ W(ha, e.signal).then(r, () => {e.signal.aborted || r((e) => ({ ...e }));});- }, xa);+ }, ga);return () => {e.abort(), clearTimeout(t);};}, [n]), (0, Z.useEffect)(() => {l ? u.current = !0 : u.current && (u.current = !1, s(/* @__PURE__ */ new Set()), n.job.error || t(n.job.message || "已统计占用空间"));}, [l]);- let d = () => void c.run("measure", (e) => G(`${ba}/measure`, {}, "POST", e), r), f = n.usage, p = f?.categories.filter(Ta) ?? [], m = p.filter((e) => o.has(e.key)), h = (e, t) => {+ let d = () => void c.run("measure", (e) => G(`${ha}/measure`, {}, "POST", e), r), f = n.usage, p = f?.categories.filter(ba) ?? [], m = p.filter((e) => o.has(e.key)), h = (e, t) => {if (!e.length) return;let n = e.reduce((e, t) => e + t.reclaimable, 0);rn({@@ -2161,7 +2062,7 @@ function Oa({ initial: e, receipt: t }) {body: `将删除 ${J(n)}:${e.map((e) => `${e.label} ${J(e.reclaimable)}(清理后${e.note})`).join(";")}。`,confirmLabel: `清理 ${J(n)}`,danger: e.some((e) => e.key === "backups"),- onConfirm: async () => r(await G(`${ba}/clean`, { categories: e.map((e) => e.key) }))+ onConfirm: async () => r(await G(`${ha}/clean`, { categories: e.map((e) => e.key) }))});}, g = () => void c.run("relocate", async (e) => {let t = (await G(wt, { initial: n.data_root }, "POST", e)).path;@@ -2173,13 +2074,13 @@ function Oa({ initial: e, receipt: t }) {confirmLabel: "迁移数据目录",onConfirm: async () => {try {- a((await G(`${ba}/relocate`, { target: t })).message);+ a((await G(`${ha}/relocate`, { target: t })).message);} catch (e) {- throw Error(Ca(e));+ throw Error(va(e));}}});- }, () => void 0), _ = n.relocation.last, v = _ && (_.state === "error" || (_.notes?.length ?? 0) > 0 || Date.now() - _.finished_at * 1e3 < Sa), y = f?.categories.find((e) => e.key === n.job.category)?.label, b = i || (n.job.state === "cleaning" ? `正在清理${y || ""}…` : n.job.state === "measuring" ? "正在统计占用空间…" : m.length ? `已选 ${m.length} 类,可释放 ${J(m.reduce((e, t) => e + t.reclaimable, 0))}` : f ? `统计于 ${(/* @__PURE__ */ new Date(f.measured_at * 1e3)).toLocaleString()}` : ""), x = l || !!i, S = (e) => (t) => s((n) => {+ }, () => void 0), _ = n.relocation.last, v = _ && (_.state === "error" || (_.notes?.length ?? 0) > 0 || Date.now() - _.finished_at * 1e3 < _a), y = f?.categories.find((e) => e.key === n.job.category)?.label, b = i || (n.job.state === "cleaning" ? `正在清理${y || ""}…` : n.job.state === "measuring" ? "正在统计占用空间…" : m.length ? `已选 ${m.length} 类,可释放 ${J(m.reduce((e, t) => e + t.reclaimable, 0))}` : f ? `统计于 ${(/* @__PURE__ */ new Date(f.measured_at * 1e3)).toLocaleString()}` : ""), x = l || !!i, S = (e) => (t) => s((n) => {let r = new Set(n);return t ? r.add(e) : r.delete(e), r;});@@ -2197,12 +2098,12 @@ function Oa({ initial: e, receipt: t }) {})}), /* @__PURE__ */ (0, Q.jsx)(j, {term: "所在磁盘",- children: wa(n)+ children: ya(n)})] }),/* @__PURE__ */ (0, Q.jsxs)(V, {divided: !0,children: [- n.job.state === "measuring" ? /* @__PURE__ */ (0, Q.jsx)(Ea, { job: n.job }) : null,+ n.job.state === "measuring" ? /* @__PURE__ */ (0, Q.jsx)(xa, { job: n.job }) : null,f ? /* @__PURE__ */ (0, Q.jsxs)("div", {"data-storage-result": "",className: $t({@@ -2212,10 +2113,10 @@ function Oa({ initial: e, receipt: t }) {}),children: [/* @__PURE__ */ (0, Q.jsx)("div", {className: "border-b border-separator-border p-4",- children: /* @__PURE__ */ (0, Q.jsx)(va, { storage: n })+ children: /* @__PURE__ */ (0, Q.jsx)(pa, { storage: n })}), /* @__PURE__ */ (0, Q.jsx)("div", {className: "flex flex-col pl-4",- children: f.categories.map((e) => /* @__PURE__ */ (0, Q.jsx)(Da, {+ children: f.categories.map((e) => /* @__PURE__ */ (0, Q.jsx)(Sa, {category: e,selected: o.has(e.key),disabled: x,@@ -2270,48 +2171,48 @@ function Oa({ initial: e, receipt: t }) {});}// src/react/settings/maintenance-settings.tsx-var ka = [+var wa = [["6", "每 6 小时"],["24", "每天"],["168", "每周"]];-function Aa({ data: e, receipt: t, reopenTutorial: n, panel: r }) {+function Ta({ data: e, receipt: t, reopenTutorial: n, panel: r }) {return /* @__PURE__ */ (0, Q.jsxs)("div", {...dr(r),children: [- e.storage ? /* @__PURE__ */ (0, Q.jsx)(Oa, {+ e.storage ? /* @__PURE__ */ (0, Q.jsx)(Ca, {initial: e.storage,receipt: t}) : null,- e.storage ? /* @__PURE__ */ (0, Q.jsx)(Hr, { receipt: t }) : null,+ e.storage ? /* @__PURE__ */ (0, Q.jsx)(Lr, { receipt: t }) : null,e.remote_reporting || e.library_sharing ? /* @__PURE__ */ (0, Q.jsxs)(L, {id: "librarySharing",guide: "reporting",title: "数据上传",- children: [e.remote_reporting ? /* @__PURE__ */ (0, Q.jsx)(Gr, {+ children: [e.remote_reporting ? /* @__PURE__ */ (0, Q.jsx)(Br, {initial: e.remote_reporting,receipt: t}) : null, e.library_sharing ? /* @__PURE__ */ (0, Q.jsx)("div", {className: "border-t border-separator-border",- children: /* @__PURE__ */ (0, Q.jsx)(Ur, {+ children: /* @__PURE__ */ (0, Q.jsx)(Rr, {initial: e.library_sharing,receipt: t})}) : null]}) : null,- /* @__PURE__ */ (0, Q.jsx)(Na, { facts: e.facts }),- /* @__PURE__ */ (0, Q.jsx)(ja, {+ /* @__PURE__ */ (0, Q.jsx)(Oa, { facts: e.facts }),+ /* @__PURE__ */ (0, Q.jsx)(Ea, {receipt: t,reopenTutorial: n}),- e.uninstall ? /* @__PURE__ */ (0, Q.jsx)(Pa, {+ e.uninstall ? /* @__PURE__ */ (0, Q.jsx)(ka, {uninstall: e.uninstall,receipt: t}) : null]});}-function ja({ reopenTutorial: e }) {+function Ea({ reopenTutorial: e }) {return /* @__PURE__ */ (0, Q.jsx)("section", {"aria-label": "新手教程",className: "w-full",@@ -2326,7 +2227,7 @@ function ja({ reopenTutorial: e }) {}) }) })});}-function Ma({ initial: e, receipt: t }) {+function Da({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e.mode), [i, a] = (0, Z.useState)(e.interval_hours), o = Y(e.error), s = (r) => {r.preventDefault(), e.available && o.run("save", (e) => G("/api/configuration/automatic-updates", {mode: n,@@ -2369,7 +2270,7 @@ function Ma({ initial: e, receipt: t }) {onSelectionChange: (e) => {e !== null && a(Number(e));},- children: ka.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {+ children: wa.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {id: e,children: t}, e))@@ -2389,7 +2290,7 @@ function Ma({ initial: e, receipt: t }) {]});}-function Na({ facts: e }) {+function Oa({ facts: e }) {return /* @__PURE__ */ (0, Q.jsx)(L, {guide: "facts",title: "运行信息",@@ -2402,7 +2303,7 @@ function Na({ facts: e }) {}, e.term)) })});}-function Pa({ uninstall: e, receipt: t }) {+function ka({ uninstall: e, receipt: t }) {let [n, r] = (0, Z.useState)(!1), [i, a] = (0, Z.useState)(""), o = () => void rn({title: "卸载 Peach",danger: !0,@@ -2458,136 +2359,189 @@ function Pa({ uninstall: e, receipt: t }) {]});}+// src/react/settings/docker-update.tsx+var Aa = 3e3, ja = 9e5;+function Ma(e) {+ let [t, n] = (0, Z.useState)({ state: "idle" }), r = Y(), i = (0, Z.useRef)(0);+ return (0, Z.useEffect)(() => {+ if (t.state !== "updating") return;+ let r = new AbortController(), a, o = async () => {+ try {+ let t = (await W("/api/client-updates", r.signal)).runtime?.version;+ if (!r.signal.aborted && t && t !== e) {+ n({+ state: "done",+ version: t+ });+ return;+ }+ } catch {}+ r.signal.aborted || (Date.now() - i.current > ja ? n({ state: "timeout" }) : a = setTimeout(o, Aa));+ };+ return a = setTimeout(o, Aa), () => {+ r.abort(), clearTimeout(a);+ };+ }, [t.state, e]), {+ job: t,+ run: () => r.run("docker-update", (e) => G("/api/configuration/docker-update", {}, "POST", e), () => {+ i.current = Date.now(), n({ state: "updating" });+ }),+ busy: r.busy === "docker-update",+ error: r.error+ };+}+function Na({ job: e }) {+ return e.state === "updating" ? /* @__PURE__ */ (0, Q.jsx)(N, {+ role: "status",+ children: "Watchtower 正在拉取新镜像并重建容器。期间 Peach 会断开一会儿,新版本启动后这里会提示刷新。"+ }) : e.state === "done" ? /* @__PURE__ */ (0, Q.jsxs)(N, {+ role: "status",+ children: [+ "已更新到 Peach ",+ e.version,+ ",刷新页面即可使用。"+ ]+ }) : e.state === "timeout" ? /* @__PURE__ */ (0, Q.jsxs)(V, { children: [/* @__PURE__ */ (0, Q.jsx)(k, { children: "15 分钟内没有看到新版本启动。在 compose.yaml 所在目录查看 Watchtower 与 Peach 的日志:" }), /* @__PURE__ */ (0, Q.jsx)(tt, {+ label: "查看更新日志",+ steps: [{+ text: "Watchtower 的拉取与重建记录",+ command: "docker compose logs watchtower"+ }, {+ text: "Peach 的启动与数据库迁移记录",+ command: "docker compose logs peach"+ }]+ })] }) : null;+}// src/react/settings/release-updates.tsx-var Fa = /* @__PURE__ */ new Set([+var Pa = /* @__PURE__ */ new Set(["downloading","verifying","extracting","preparing","restarting","installing"-]), Ia = [+]), Fa = [65,75,90-], La = 120, Ra = "https://github.com/peach-mitao/peach/releases";-function za({ initial: e, initialJob: t, docker: n }) {- let [r, i] = (0, Z.useState)(e), [a, o] = (0, Z.useState)(t || {+], Ia = 120, La = "https://github.com/peach-mitao/peach/releases";+function Ra({ initial: e, initialJob: t }) {+ let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(t || {state: "idle",progress: 0- }), [s, c] = (0, Z.useState)(""), l = Y(), u = (0, Z.useRef)(!1), d = (0, Z.useRef)(!0), f = Fa.has(a.state), p = Pr(e.current_version), m = r.state === "available" && !!n?.token_set && !!n.rolling, h = p.job.state === "updating", g = () => void rn({+ }), [o, s] = (0, Z.useState)(""), c = Y(), l = (0, Z.useRef)(!1), u = (0, Z.useRef)(!0), d = Pa.has(i.state), f = Ma(e.current_version), p = n.state === "available" && !!n.one_click?.available, m = f.job.state === "updating", h = () => void rn({title: "一键更新",- body: `Watchtower 会拉取 Peach ${r.latest_version || ""} 的镜像并重建容器,/data 数据卷保留。重建期间 Peach 暂时断开,进行中的任务在启动后续跑;有待执行的数据库迁移时,启动前先备份再迁移。`,+ body: `Watchtower 会拉取 Peach ${n.latest_version || ""} 的镜像并重建容器,/data 数据卷保留。重建期间 Peach 暂时断开,进行中的任务在启动后续跑;有待执行的数据库迁移时,启动前先备份再迁移。`,confirmLabel: "开始更新",cancelLabel: "取消",- onConfirm: p.run+ onConfirm: f.run});- (0, Z.useEffect)(() => (d.current = !0, () => {- d.current = !1;+ (0, Z.useEffect)(() => (u.current = !0, () => {+ u.current = !1;}), []);- let _ = async () => {+ let g = async () => {let e = await G("/api/configuration/update-restart", {});- d.current && o(e);- }, v = () => void rn({+ u.current && a(e);+ }, _ = () => void rn({title: "更新已准备好",- body: `Peach ${a.version || ""} 将在重启后安装。`,+ body: `Peach ${i.version || ""} 将在重启后安装。`,confirmLabel: "立即重启",cancelLabel: "稍后",- onConfirm: _+ onConfirm: g});(0, Z.useEffect)(() => {- a.state !== "ready" || u.current || (u.current = !0, v());- }, [a.state]), (0, Z.useEffect)(() => {- let e = new AbortController(), t = Fa.has(a.state) ? 1e3 : 3e4, n, r = 0, s = async () => {+ i.state !== "ready" || l.current || (l.current = !0, _());+ }, [i.state]), (0, Z.useEffect)(() => {+ let e = new AbortController(), t = Pa.has(i.state) ? 1e3 : 3e4, n, o = 0, c = async () => {try {let t = await W("/api/configuration/update-status", e.signal);if (e.signal.aborted) return;- o(t), r = 0, t.state === "complete" && i((e) => ({+ a(t), o = 0, t.state === "complete" && r((e) => ({...e,current_version: t.version || e.current_version,state: "current",message: "已是最新测试版。"}));let n = await W("/api/configuration/automatic-updates", e.signal);- !e.signal.aborted && n.result && i(n.result);+ !e.signal.aborted && n.result && r(n.result);} catch {- r += 1, r >= La && !e.signal.aborted && c("尚未连接到 Peach,请检查托盘后刷新页面。");+ o += 1, o >= Ia && !e.signal.aborted && s("尚未连接到 Peach,请检查托盘后刷新页面。");}- !e.signal.aborted && r < La && (n = setTimeout(s, t));+ !e.signal.aborted && o < Ia && (n = setTimeout(c, t));};- return n = setTimeout(s, t), () => {+ return n = setTimeout(c, t), () => {e.abort(), clearTimeout(n);};- }, [a.state]);- let y = () => {- f || (u.current = !1, c(""), l.run("download", (e) => G("/api/configuration/update", {}, "POST", e), o));- }, b = () => void l.run("check", (e) => W("/api/configuration/updates", e), i, (t) => {- i({+ }, [i.state]);+ let v = () => {+ d || (l.current = !1, s(""), c.run("download", (e) => G("/api/configuration/update", {}, "POST", e), a));+ }, y = () => void c.run("check", (e) => W("/api/configuration/updates", e), r, (t) => {+ r({...e,state: "error"- }), l.setError(q(t));- }), x = l.error || s || p.error, S = a.state === "downloading" && a.total ? `${((a.downloaded || 0) / 1048576).toFixed(1)} / ${(a.total / 1048576).toFixed(1)} MB` : `${a.progress}%`;+ }), c.setError(q(t));+ }), b = c.error || o || f.error, x = i.state === "downloading" && i.total ? `${((i.downloaded || 0) / 1048576).toFixed(1)} / ${(i.total / 1048576).toFixed(1)} MB` : `${i.progress}%`;return /* @__PURE__ */ (0, Q.jsxs)(L, {id: "releaseUpdates",guide: "updates",title: "检查更新",aside: /* @__PURE__ */ (0, Q.jsx)(H, {- tone: x || r.state === "error" || a.state === "error" || p.job.state === "timeout" ? "error" : f || h ? "progress" : p.job.state === "done" ? "success" : r.state === "available" ? "warning" : r.state === "unchecked" ? "neutral" : "success",- children: x || r.state === "error" || a.state === "error" ? "检查未完成" : p.job.state === "timeout" ? "更新未完成" : f ? "准备更新中" : h ? "正在更新" : p.job.state === "done" ? "已更新" : a.state === "ready" ? "可安装" : r.state === "available" ? "有可用更新" : r.state === "unchecked" ? "尚未检查" : "检查完成"+ tone: b || n.state === "error" || i.state === "error" || f.job.state === "timeout" ? "error" : d || m ? "progress" : f.job.state === "done" ? "success" : n.state === "available" ? "warning" : n.state === "unchecked" ? "neutral" : "success",+ children: b || n.state === "error" || i.state === "error" ? "检查未完成" : f.job.state === "timeout" ? "更新未完成" : d ? "准备更新中" : m ? "正在更新" : f.job.state === "done" ? "已更新" : i.state === "ready" ? "可安装" : n.state === "available" ? "有可用更新" : n.state === "unchecked" ? "尚未检查" : "检查完成"}),children: [/* @__PURE__ */ (0, Q.jsxs)(ut, { children: [/* @__PURE__ */ (0, Q.jsx)(j, {term: "当前版本",- children: p.job.state === "done" ? p.job.version : r.current_version+ children: f.job.state === "done" ? f.job.version : n.current_version}),/* @__PURE__ */ (0, Q.jsx)(j, {term: "安装方式",- children: r.installation+ children: n.installation}),/* @__PURE__ */ (0, Q.jsx)(j, {term: "更新通道",- children: r.channel+ children: n.channel}),/* @__PURE__ */ (0, Q.jsx)(j, {term: "最新版本",- children: r.latest_version || "未取得"+ children: n.latest_version || "未取得"}),- r.package_kind ? /* @__PURE__ */ (0, Q.jsxs)(j, {+ n.package_kind ? /* @__PURE__ */ (0, Q.jsxs)(j, {term: "下载内容",- children: [r.package_kind === "update" ? "应用更新包" : r.package_kind === "installer" ? "macOS 安装镜像" : "应用与工具", r.asset_size ? ` · ${(r.asset_size / 1048576).toFixed(1)} MB` : ""]+ children: [n.package_kind === "update" ? "应用更新包" : n.package_kind === "installer" ? "macOS 安装镜像" : "应用与工具", n.asset_size ? ` · ${(n.asset_size / 1048576).toFixed(1)} MB` : ""]}) : null] }),- r.package_kind === "update" ? /* @__PURE__ */ (0, Q.jsx)(N, { children: "应用更新包复用已安装工具;工具缺失、损坏或版本变化时会另行下载所需工具包。" }) : r.package_kind === "full" ? /* @__PURE__ */ (0, Q.jsx)(N, { children: "本次更新包含媒体工具。" }) : r.package_kind === "installer" ? /* @__PURE__ */ (0, Q.jsx)(N, { children: "下载后打开镜像,把 Peach 拖入「应用程序」替换旧版本,数据目录与设置保留;提示已损坏时按发布页说明移除隔离标记。" }) : null,- r.state === "unchecked" && !r.checked_at && !x && a.state === "idle" ? null : /* @__PURE__ */ (0, Q.jsxs)(V, {+ n.package_kind === "update" ? /* @__PURE__ */ (0, Q.jsx)(N, { children: "应用更新包复用已安装工具;工具缺失、损坏或版本变化时会另行下载所需工具包。" }) : n.package_kind === "full" ? /* @__PURE__ */ (0, Q.jsx)(N, { children: "本次更新包含媒体工具。" }) : n.package_kind === "installer" ? /* @__PURE__ */ (0, Q.jsx)(N, { children: "下载后打开镜像,把 Peach 拖入「应用程序」替换旧版本,数据目录与设置保留;提示已损坏时按发布页说明移除隔离标记。" }) : null,+ n.state === "unchecked" && !n.checked_at && !b && i.state === "idle" ? null : /* @__PURE__ */ (0, Q.jsxs)(V, {divided: !0,children: [- r.checked_at ? /* @__PURE__ */ (0, Q.jsxs)(N, { children: ["检查于 ", (/* @__PURE__ */ new Date(r.checked_at * 1e3)).toLocaleString()] }) : null,- p.job.state === "done" ? null : r.state === "available" && !x ? /* @__PURE__ */ (0, Q.jsx)(F, {+ n.checked_at ? /* @__PURE__ */ (0, Q.jsxs)(N, { children: ["检查于 ", (/* @__PURE__ */ new Date(n.checked_at * 1e3)).toLocaleString()] }) : null,+ f.job.state === "done" ? null : n.state === "available" && !b ? /* @__PURE__ */ (0, Q.jsx)(F, {tone: "info",title: "有可用更新",- children: r.message- }) : x || r.state === "error" ? /* @__PURE__ */ (0, Q.jsx)(k, { children: x || r.message }) : r.state === "unchecked" ? null : /* @__PURE__ */ (0, Q.jsx)(N, {+ children: n.message+ }) : b || n.state === "error" ? /* @__PURE__ */ (0, Q.jsx)(k, { children: b || n.message }) : n.state === "unchecked" ? null : /* @__PURE__ */ (0, Q.jsx)(N, {role: "status",- children: r.message+ children: n.message}),- r.state === "available" && !x && !m && p.job.state === "idle" && r.steps?.length ? /* @__PURE__ */ (0, Q.jsx)(tt, {+ n.state === "available" && !b && !p && f.job.state === "idle" && n.steps?.length ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(tt, {label: "在宿主机上更新",- steps: r.steps- }) : null,- /* @__PURE__ */ (0, Q.jsx)(Fr, { job: p.job }),- a.state === "error" ? /* @__PURE__ */ (0, Q.jsx)(k, { children: a.message }) : null,- a.state !== "idle" && a.state !== "error" ? /* @__PURE__ */ (0, Q.jsxs)("div", {+ steps: n.steps+ }), /* @__PURE__ */ (0, Q.jsx)(N, { children: n.one_click?.reason || "用 compose 的 watchtower profile 启动 Watchtower 后,可以在这里一键更新,启用前先读 Docker 部署说明。" })] }) : null,+ /* @__PURE__ */ (0, Q.jsx)(Na, { job: f.job }),+ i.state === "error" ? /* @__PURE__ */ (0, Q.jsx)(k, { children: i.message }) : null,+ i.state !== "idle" && i.state !== "error" ? /* @__PURE__ */ (0, Q.jsxs)("div", {"aria-live": "polite",className: "flex flex-col gap-2",children: [/* @__PURE__ */ (0, Q.jsx)(jt, {label: "更新准备进度",- value: a.progress,- stops: Ia+ value: i.progress,+ stops: Fa}),- /* @__PURE__ */ (0, Q.jsxs)(N, { children: ["下载 → 校验 → 解压 → 准备安装 · ", a.message] }),- /* @__PURE__ */ (0, Q.jsx)(N, { children: S })+ /* @__PURE__ */ (0, Q.jsxs)(N, { children: ["下载 → 校验 → 解压 → 准备安装 · ", i.message] }),+ /* @__PURE__ */ (0, Q.jsx)(N, { children: x })]}) : null]@@ -2605,42 +2559,42 @@ function za({ initial: e, initialJob: t, docker: n }) {children: "GitHub"}),/* @__PURE__ */ (0, Q.jsx)(A, {- href: r.release_url || Ra,+ href: n.release_url || La,children: "查看发布页"})]}),children: [/* @__PURE__ */ (0, Q.jsx)(E, {- variant: a.state === "ready" || m || r.state === "available" && r.installation === "独立测试包" ? "secondary" : "primary",- disabled: f || h,- onClick: b,- ...K(l.busy === "check"),+ variant: i.state === "ready" || p || n.state === "available" && n.installation === "独立测试包" ? "secondary" : "primary",+ disabled: d || m,+ onClick: y,+ ...K(c.busy === "check"),children: "检查更新"}),- p.job.state === "done" ? /* @__PURE__ */ (0, Q.jsx)(E, {+ f.job.state === "done" ? /* @__PURE__ */ (0, Q.jsx)(E, {variant: "primary",onClick: () => window.location.reload(),children: "刷新页面"- }) : m ? /* @__PURE__ */ (0, Q.jsx)(E, {+ }) : p ? /* @__PURE__ */ (0, Q.jsx)(E, {variant: "primary",- onClick: g,- ...K(h || p.busy),+ onClick: h,+ ...K(m || f.busy),children: "一键更新"}) : null,- r.state === "available" && r.in_app_update && a.state !== "ready" ? /* @__PURE__ */ (0, Q.jsx)(E, {+ n.state === "available" && n.in_app_update && i.state !== "ready" ? /* @__PURE__ */ (0, Q.jsx)(E, {variant: "primary",- onClick: y,- ...K(f || l.busy === "download"),+ onClick: v,+ ...K(d || c.busy === "download"),children: "下载并安装"- }) : r.state === "available" && r.installation === "独立测试包" && r.asset_url ? /* @__PURE__ */ (0, Q.jsx)(Je, {+ }) : n.state === "available" && n.installation === "独立测试包" && n.asset_url ? /* @__PURE__ */ (0, Q.jsx)(Je, {variant: "primary",- href: r.asset_url,+ href: n.asset_url,children: "下载新版本"}) : null,- a.state === "ready" ? /* @__PURE__ */ (0, Q.jsx)(E, {+ i.state === "ready" ? /* @__PURE__ */ (0, Q.jsx)(E, {variant: "primary",- onClick: v,+ onClick: _,children: "重启安装"}) : null]@@ -2649,7 +2603,7 @@ function za({ initial: e, initialJob: t, docker: n }) {});}// src/react/settings/upgrade-repairs.tsx-var Ba = {+var za = {pending: "等待修复",running: "正在修复",failed: "需要重试",@@ -2657,7 +2611,7 @@ var Ba = {complete: "已完成",unavailable: "当前部署未启用"};-function Va() {+function Ba() {let { snapshot: e } = Bn(), [t, n] = (0, Z.useState)(null), r = Y();(0, Z.useEffect)(() => n(null), [e]);let i = t ?? e?.repairs, a = i?.state || "pending", o = i?.items.reduce((e, t) => e + (t.pending || 0), 0) || 0, s = i?.items.reduce((e, t) => e + (t.failed || 0), 0) || 0, c = i?.items.reduce((e, t) => e + (t.review_count || 0), 0) || 0;@@ -2668,7 +2622,7 @@ function Va() {tone: a === "failed" ? "error" : a === "running" ? "progress" : a === "review" ? "warning" : a === "complete" ? "success" : "neutral",children: /* @__PURE__ */ (0, Q.jsx)("span", {"data-copy-key": `upgradeRepairs.${a}.status`,- children: Ba[a] || "未取得"+ children: za[a] || "未取得"}, a)}),children: [@@ -2676,15 +2630,15 @@ function Va() {/* @__PURE__ */ (0, Q.jsxs)(ut, { children: [/* @__PURE__ */ (0, Q.jsx)(j, {term: "待完成",- children: /* @__PURE__ */ (0, Q.jsxs)("span", { children: [/* @__PURE__ */ (0, Q.jsx)(qr, { value: o }), " 项"] })+ children: /* @__PURE__ */ (0, Q.jsxs)("span", { children: [/* @__PURE__ */ (0, Q.jsx)(Hr, { value: o }), " 项"] })}),/* @__PURE__ */ (0, Q.jsx)(j, {term: "失败",- children: /* @__PURE__ */ (0, Q.jsxs)("span", { children: [/* @__PURE__ */ (0, Q.jsx)(qr, { value: s }), " 项"] })+ children: /* @__PURE__ */ (0, Q.jsxs)("span", { children: [/* @__PURE__ */ (0, Q.jsx)(Hr, { value: s }), " 项"] })}),/* @__PURE__ */ (0, Q.jsx)(j, {term: "待复核",- children: /* @__PURE__ */ (0, Q.jsxs)("span", { children: [/* @__PURE__ */ (0, Q.jsx)(qr, { value: c }), " 项"] })+ children: /* @__PURE__ */ (0, Q.jsxs)("span", { children: [/* @__PURE__ */ (0, Q.jsx)(Hr, { value: c }), " 项"] })})] }),i?.message || r.error ? /* @__PURE__ */ (0, Q.jsx)(V, { children: /* @__PURE__ */ (0, Q.jsx)(k, { children: r.error || i?.message }) }) : null,@@ -2708,34 +2662,27 @@ function Va() {});}// src/react/settings/general-settings.tsx-function Ha({ data: e, receipt: t, panel: n }) {- let [r, i] = (0, Z.useState)(e.docker_update);+function Va({ data: e, receipt: t, panel: n }) {return /* @__PURE__ */ (0, Q.jsxs)("div", {...dr(n),children: [- e.updates ? /* @__PURE__ */ (0, Q.jsx)(za, {+ e.updates ? /* @__PURE__ */ (0, Q.jsx)(Ra, {initial: e.updates,- initialJob: e.update_job,- docker: r- }) : null,- r ? /* @__PURE__ */ (0, Q.jsx)(Ir, {- state: r,- onSaved: i,- receipt: t+ initialJob: e.update_job}) : null,- /* @__PURE__ */ (0, Q.jsx)(Va, {}),- e.automatic_updates ? /* @__PURE__ */ (0, Q.jsx)(Ma, {+ /* @__PURE__ */ (0, Q.jsx)(Ba, {}),+ e.automatic_updates ? /* @__PURE__ */ (0, Q.jsx)(Da, {initial: e.automatic_updates,receipt: t}) : null,- e.startup ? /* @__PURE__ */ (0, Q.jsx)(Ua, {+ e.startup ? /* @__PURE__ */ (0, Q.jsx)(Ha, {startup: e.startup,receipt: t}) : null]});}-function Ua({ startup: e, receipt: t }) {+function Ha({ startup: e, receipt: t }) {let [n, r] = (0, Z.useState)(e.enabled), [i, a] = (0, Z.useState)(e.silent), [o, s] = (0, Z.useState)(e.desktop), c = Y(), l = e.available && !e.desktop_message;return /* @__PURE__ */ (0, Q.jsxs)(L, {guide: "startup",@@ -2793,7 +2740,7 @@ function Ua({ startup: e, receipt: t }) {});}// src/react/restart-redirect.ts-var Wa = 8e3, Ga = [+var Ua = 8e3, Wa = [{name: "机械硬盘,或内存 8 GB 以内",cache: "10–20 GiB",@@ -2812,12 +2759,12 @@ var Wa = 8e3, Ga = [read: "256 / 128 KB",task: "2 个起步"}-], Ka = [+], Ga = [["cache", "缓存上限"],["read", "读取长度(默认 / 最小)"],["task", "同时处理视频"]];-function qa() {+function Ka() {return /* @__PURE__ */ (0, Q.jsx)("div", {className: "@container flex flex-col gap-3",children: /* @__PURE__ */ (0, Q.jsxs)(O, {@@ -2832,14 +2779,14 @@ function qa() {/* @__PURE__ */ (0, Q.jsx)("ul", {"aria-label": "按缓存所在硬盘分档",className: "flex flex-col gap-2",- children: Ga.map((e) => /* @__PURE__ */ (0, Q.jsxs)("li", {+ children: Wa.map((e) => /* @__PURE__ */ (0, Q.jsxs)("li", {className: "flex flex-col gap-2 rounded-2lg border border-separator-border bg-background-primary-default p-3",children: [/* @__PURE__ */ (0, Q.jsx)("p", {className: "text-body-medium text-text-primary",children: e.name}), /* @__PURE__ */ (0, Q.jsx)("dl", {className: "inline-grid grid-cols-1 gap-2 @md:grid-cols-3",- children: Ka.map(([t, n]) => /* @__PURE__ */ (0, Q.jsxs)("div", {+ children: Ga.map(([t, n]) => /* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex flex-col",children: [/* @__PURE__ */ (0, Q.jsx)("dt", {className: "text-caption-1-regular text-text-secondary",@@ -2869,15 +2816,15 @@ function qa() {});}// src/react/settings/cloud-proxy-settings.tsx-var Ja = "/api/configuration/cloud-proxies", Ya = [+var qa = "/api/configuration/cloud-proxies", Ja = [["direct", "直连"],["system", "跟随系统"],["http", "HTTP 代理"],["socks5", "SOCKS5 代理"]];-function Xa({ receipt: e }) {+function Ya({ receipt: e }) {let [t, n] = (0, Z.useState)(null), [r, i] = (0, Z.useState)(!0), a = (0, Z.useRef)(/* @__PURE__ */ new Set()), o = (0, Z.useRef)(/* @__PURE__ */ new Set()), [s, c] = (0, Z.useState)(!1), l = (0, Z.useRef)(() => void 0), u = Y(), d = () => {- o.current.size || u.run("refresh", (e) => W(Ja, e), (e) => {+ o.current.size || u.run("refresh", (e) => W(qa, e), (e) => {a.current.clear(), n(e), i(!1);}, (e) => {i(!1), u.setError(e instanceof Error ? e.message : "无法读取网盘代理");@@ -2931,7 +2878,7 @@ function Xa({ receipt: e }) {children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: ir(e.location) }), e.name]}) }), /* @__PURE__ */ (0, Q.jsx)(N, { children: "尚未匹配 CloudDrive 账号" })]}, e.root)),- t?.accounts.map((t) => /* @__PURE__ */ (0, Q.jsx)(Za, {+ t?.accounts.map((t) => /* @__PURE__ */ (0, Q.jsx)(Xa, {initial: t,receipt: e,onDirty: () => a.current.add(t.id),@@ -2955,7 +2902,7 @@ function Xa({ receipt: e }) {}) })]});}-function Za({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {+function Xa({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {let [a, o] = (0, Z.useState)(e), [s, c] = (0, Z.useState)([]), l = a.libraries?.map((e) => e.name).join("、") || a.name, u = Y(), d = (e, t) => {o((n) => ({...n,@@ -2965,7 +2912,7 @@ function Za({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {return /* @__PURE__ */ (0, Q.jsxs)("form", {"aria-label": `${l} 代理`,onSubmit: (e) => {- e.preventDefault(), i(!0), u.run("save", (e) => G(Ja, {+ e.preventDefault(), i(!0), u.run("save", (e) => G(qa, {id: a.id,revision: a.revision,...s.includes("api") ? { api: a.api } : {},@@ -2985,13 +2932,13 @@ function Za({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {" · ",a.path] }),- /* @__PURE__ */ (0, Q.jsx)(Qa, {+ /* @__PURE__ */ (0, Q.jsx)(Za, {label: "数据代理",value: a.data,disabled: !a.writable || !!u.busy,onChange: (e) => d("data", e)}),- /* @__PURE__ */ (0, Q.jsx)(Qa, {+ /* @__PURE__ */ (0, Q.jsx)(Za, {label: "API 代理",value: a.api,disabled: !a.writable || !!u.busy,@@ -3015,7 +2962,7 @@ function Za({ initial: e, receipt: t, onDirty: n, onSaved: r, onSaving: i }) {]});}-function Qa({ label: e, value: t, disabled: n, onChange: r }) {+function Za({ label: e, value: t, disabled: n, onChange: r }) {let i = t.mode === "http" || t.mode === "socks5";return /* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex min-w-0 flex-col gap-3",@@ -3034,7 +2981,7 @@ function Qa({ label: e, value: t, disabled: n, onChange: r }) {children: [t.mode === "unknown" ? /* @__PURE__ */ (0, Q.jsx)(z, {id: "unknown",children: "无法识别的代理类型"- }) : null, Ya.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {+ }) : null, Ja.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {id: e,children: t}, e))]@@ -3102,7 +3049,7 @@ function Qa({ label: e, value: t, disabled: n, onChange: r }) {});}// src/react/settings/library-icon-picker.tsx-var $a = [+var Qa = [["", "自动识别"],["hard-drive", "磁盘"],["database", "资料库"],@@ -3146,13 +3093,13 @@ var $a = [["star", "收藏"],["tags", "主题"]];-function eo(e) {+function $a(e) {let t = e === "local" ? "" : St[e];return t ? [t, "自动识别"] : ["hard-drive", "默认"];}-var to = "auto";-function no({ value: e, label: t, kind: n = "local", onChange: r }) {- let i = (0, Z.useRef)(null), [a, o] = (0, Z.useState)(!1), [s, c] = (0, Z.useState)(e), [l, u] = eo(n);+var eo = "auto";+function to({ value: e, label: t, kind: n = "local", onChange: r }) {+ let i = (0, Z.useRef)(null), [a, o] = (0, Z.useState)(!1), [s, c] = (0, Z.useState)(e), [l, u] = $a(n);return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(E, {ref: i,variant: "secondary",@@ -3166,7 +3113,7 @@ function no({ value: e, label: t, kind: n = "local", onChange: r }) {children: /* @__PURE__ */ (0, Q.jsxs)("span", {"data-icon-choice": !0,className: "flex items-center gap-2",- children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: e || l }), ((e) => e && $a.find(([t]) => t === e)?.[1] || u)(e)]+ children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: e || l }), ((e) => e && Qa.find(([t]) => t === e)?.[1] || u)(e)]})}), /* @__PURE__ */ (0, Q.jsx)(ze, {triggerRef: i,@@ -3186,15 +3133,15 @@ function no({ value: e, label: t, kind: n = "local", onChange: r }) {}),/* @__PURE__ */ (0, Q.jsx)(We, {"aria-label": "可选图标",- value: s || to,- onChange: (e) => c(e === to ? "" : e),+ value: s || eo,+ onChange: (e) => c(e === eo ? "" : e),className: "inline-grid grid-cols-7 gap-1",- children: $a.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(Ge, {- value: e || to,+ children: Qa.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(Ge, {+ value: e || eo,"aria-label": e ? t : u,className: "flex h-10 cursor-pointer items-center justify-center rounded-lg text-foreground-icon-secondary outline-none hover:bg-dropdown-item-hover-background focus-visible:ring-2 focus-visible:ring-border-focus-ring data-selected:bg-dropdown-item-hover-background data-selected:text-text-primary",children: /* @__PURE__ */ (0, Q.jsx)(Ht, { mark: e || l })- }, e || to))+ }, e || eo))}),/* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex justify-end gap-2 border-t border-separator-border pt-2.5",@@ -3215,19 +3162,19 @@ function no({ value: e, label: t, kind: n = "local", onChange: r }) {})] });}// src/react/settings/library-policy-settings.tsx-var ro = [+var no = [["probe", "读取视频信息"],["metadata", "联网补资料"],["cover", "联网补封面"],["people", "联网补人物图片"],["preview", "生成九宫格预览"]-], io = [+], ro = ["probe","metadata","cover","people","preview"-], ao = [+], io = [["auto","自动补全",@@ -3244,7 +3191,7 @@ var ro = ["逐项选择要做的步骤"]];-function oo() {+function ao() {return /* @__PURE__ */ (0, Q.jsxs)("div", {"data-policy-legend": "",className: "flex flex-col gap-1",@@ -3276,7 +3223,7 @@ function oo() {})]});}-function so({ name: e, value: t, onChange: n }) {+function oo({ name: e, value: t, onChange: n }) {return /* @__PURE__ */ (0, Q.jsx)(Rt, {"data-guide-target": "library-policy",className: "w-full",@@ -3285,10 +3232,10 @@ function so({ name: e, value: t, onChange: n }) {prefix: "处理方式",renderValue: /* @__PURE__ */ (0, Q.jsx)("span", {className: "truncate",- children: ao.find(([e]) => e === t)?.[1]+ children: io.find(([e]) => e === t)?.[1]}),onSelectionChange: (e) => n(String(e)),- children: ao.map(([e, t, n]) => /* @__PURE__ */ (0, Q.jsx)(z, {+ children: io.map(([e, t, n]) => /* @__PURE__ */ (0, Q.jsx)(z, {id: e,textValue: t,children: /* @__PURE__ */ (0, Q.jsxs)("span", {@@ -3301,15 +3248,15 @@ function so({ name: e, value: t, onChange: n }) {}, e))});}-function co({ name: e, value: t, onChange: n }) {+function so({ name: e, value: t, onChange: n }) {return /* @__PURE__ */ (0, Q.jsx)(O, {defaultOpen: !0,- summary: `${e} 的处理步骤(${t.length}/${ro.length})`,+ summary: `${e} 的处理步骤(${t.length}/${no.length})`,children: /* @__PURE__ */ (0, Q.jsx)("div", {className: "flex flex-wrap gap-x-6 gap-y-2",role: "group","aria-label": `${e} 处理步骤`,- children: ro.map(([e, r]) => /* @__PURE__ */ (0, Q.jsx)(D, {+ children: no.map(([e, r]) => /* @__PURE__ */ (0, Q.jsx)(D, {isSelected: t.includes(e),onChange: (r) => n(r ? [...t, e] : t.filter((t) => t !== e)),children: r@@ -3317,7 +3264,7 @@ function co({ name: e, value: t, onChange: n }) {})});}-function lo({ id: e, name: t, value: n, onChange: r }) {+function co({ id: e, name: t, value: n, onChange: r }) {let i = (0, Z.useRef)(null), [a, o] = (0, Z.useState)(!1), s = Ke.find(([e]) => e === n)?.[1] || "无颜色", c = (t) => {r(t), Tn(e, t), o(!1);};@@ -3400,8 +3347,8 @@ function lo({ id: e, name: t, value: n, onChange: r }) {})] });}// src/react/settings/push-discovery-settings.tsx-var uo = "/api/configuration/push-discovery", fo = "/api/configuration/push-discovery/secret";-function po({ initial: e, receipt: t }) {+var lo = "/api/configuration/push-discovery", uo = "/api/configuration/push-discovery/secret";+function fo({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(e.prefixes), [o, s] = (0, Z.useState)(""), c = Y(), l = n.media_roots, [u, d] = (0, Z.useState)(e), f = (e, n) => {r(e), d(e), a(e.prefixes), s(""), t(n);}, p = (e, t) => a((n) => n.map((n, r) => r === e ? {@@ -3415,9 +3362,9 @@ function po({ initial: e, receipt: t }) {cloud: n.cloud,prefixes: i};- c.run("save", (e) => G(uo, t, "POST", e), (e) => f(e, "已保存配置"), (e) => s(q(e)));+ c.run("save", (e) => G(lo, t, "POST", e), (e) => f(e, "已保存配置"), (e) => s(q(e)));}, h = () => {- c.run("secret", (e) => G(fo, {}, "POST", e), (e) => f(e, "已更换共享密钥"), (e) => s(q(e)));+ c.run("secret", (e) => G(uo, {}, "POST", e), (e) => f(e, "已更换共享密钥"), (e) => s(q(e)));}, g = `已入库 ${u.queue.ingested} 个文件` + (u.queue.failed ? `,${u.queue.failed} 个入库失败` : "") + (u.queue.pending ? `,队列里还有 ${u.queue.pending} 条` : ""), _ = u.local_running ? `正在监视 ${u.local_roots.join("、")}` : u.local_message || "没有运行";return /* @__PURE__ */ (0, Q.jsxs)(L, {id: "pushDiscovery",@@ -3580,7 +3527,7 @@ function po({ initial: e, receipt: t }) {});}// src/react/settings/media-settings.tsx-async function mo(e) {+async function po(e) {let t;try {t = await mn();@@ -3595,14 +3542,14 @@ async function mo(e) {});return n;}-var ho = (e) => $n.find(([t]) => t === e)?.[1] ?? e, go = [...$n, ["smb", "SMB 共享"]], _o = (e) => e.library_icon || eo(e.transport === "smb" ? "smb" : e.location)[0], vo = async (e) => (await G(wt, { initial: e })).path, yo = (e) => ({+var mo = (e) => $n.find(([t]) => t === e)?.[1] ?? e, ho = [...$n, ["smb", "SMB 共享"]], go = (e) => e.library_icon || $a(e.transport === "smb" ? "smb" : e.location)[0], _o = async (e) => (await G(wt, { initial: e })).path, vo = (e) => ({library_id: e.library_id,library: e.library,library_icon: e.library_icon,library_color: e.library_color,library_policy: e.library_policy,library_stages: e.library_stages-}), bo = (e) => e.library_stages ? io.filter((t) => e.library_stages.split(",").includes(t)) : [], xo = (e = "") => ({+}), yo = (e) => e.library_stages ? ro.filter((t) => e.library_stages.split(",").includes(t)) : [], bo = (e = "") => ({path: e,transport: e.startsWith("smb://") ? "smb" : "filesystem",location: "local",@@ -3615,7 +3562,7 @@ var ho = (e) => $n.find(([t]) => t === e)?.[1] ?? e, go = [...$n, ["smb", "SMBlibrary_stages: "",cost: "free"});-function So(e) {+function xo(e) {let t = e.media_sources?.filter((e) => $n.some(([t]) => t === e.location));return t?.length ? t.map((e) => ({transport: e.transport === "smb" || e.path.startsWith("smb://") ? "smb" : "filesystem",@@ -3634,15 +3581,15 @@ function So(e) {root_id: e.root_id,library_id: e.library_id || kn(),cost: e.cost ?? zn(e.location)- })) : (e.media_dirs.length ? e.media_dirs : [""]).map((e) => xo(e));+ })) : (e.media_dirs.length ? e.media_dirs : [""]).map((e) => bo(e));}-var Co = (e) => !(e instanceof qe) || e.status !== 400 ? null : e.body?.errors ?? null;-function wo({ data: e, receipt: t, panel: n }) {+var So = (e) => !(e instanceof qe) || e.status !== 400 ? null : e.body?.errors ?? null;+function Co({ data: e, receipt: t, panel: n }) {let r = !!e.media_sources?.some((e) => rr(e.location));return (0, Z.useEffect)(() => {if (e.editable) {let t = /* @__PURE__ */ new Map();- for (let n of So(e)) t.set(n.library_id, (t.get(n.library_id) ?? 0) + 1);+ for (let n of xo(e)) t.set(n.library_id, (t.get(n.library_id) ?? 0) + 1);An("media", {folders: [...t.values()],cloud: r@@ -3659,7 +3606,7 @@ function wo({ data: e, receipt: t, panel: n }) {}, [e, r]), /* @__PURE__ */ (0, Q.jsxs)("div", {...dr(n),children: [- e.editable ? /* @__PURE__ */ (0, Q.jsx)(To, {+ e.editable ? /* @__PURE__ */ (0, Q.jsx)(wo, {data: e,receipt: t}) : /* @__PURE__ */ (0, Q.jsx)(F, {@@ -3667,20 +3614,20 @@ function wo({ data: e, receipt: t, panel: n }) {title: "只读",children: e.notice}),- e.editable ? null : /* @__PURE__ */ (0, Q.jsx)(Do, { data: e }),- r ? /* @__PURE__ */ (0, Q.jsx)(Xa, { receipt: t }) : null,- e.push_discovery ? /* @__PURE__ */ (0, Q.jsx)(po, {+ e.editable ? null : /* @__PURE__ */ (0, Q.jsx)(Eo, { data: e }),+ r ? /* @__PURE__ */ (0, Q.jsx)(Ya, { receipt: t }) : null,+ e.push_discovery ? /* @__PURE__ */ (0, Q.jsx)(fo, {initial: e.push_discovery,receipt: t}) : null]});}-function To({ data: e, receipt: t }) {+function wo({ data: e, receipt: t }) {let { rows: n, edit: r, add: i, remove: a, errors: o, setErrors: s, picking: c, pick: l, inputRef: u } = ar({- initial: () => So(e),- blank: () => xo(),- pickFolder: vo,+ initial: () => xo(e),+ blank: () => bo(),+ pickFolder: _o,describe: q}), [d, f] = (0, Z.useState)(!1), [p, m] = (0, Z.useState)(!1), [h, g] = (0, Z.useState)(""), [_, v] = (0, Z.useState)({}), [y, b] = (0, Z.useState)(null), x = (0, Z.useRef)(e.revision), S = (0, Z.useRef)(!1), C = Y();Vn();@@ -3697,7 +3644,7 @@ function To({ data: e, receipt: t }) {let ne = (e, t) => {let i = n.find((e) => e.library_id === t);if (i) {- r(e, yo(i));+ r(e, vo(i));return;}let a = kn();@@ -3712,7 +3659,7 @@ function To({ data: e, receipt: t }) {};(0, Z.useEffect)(() => {if (!y) return;- let e = setTimeout(() => location.assign(y.url), Wa);+ let e = setTimeout(() => location.assign(y.url), Ua);return () => clearTimeout(e);}, [y]);let re = (e) => {@@ -3722,7 +3669,7 @@ function To({ data: e, receipt: t }) {m(!0);let n = e.currentTarget;requestAnimationFrame(() => n.querySelector(`[data-media-read-policy="${t}"] button`)?.focus());- } else C.busy || S.current || (g(""), S.current = !0, mo(d).then((e) => {+ } else C.busy || S.current || (g(""), S.current = !0, po(d).then((e) => {S.current = !1, e && ie();}));}, ie = () => {@@ -3735,7 +3682,7 @@ function To({ data: e, receipt: t }) {}, "POST", t), (e) => {x.current = e.revision, s([]), t("已保存配置"), b(e);}, (e) => {- let t = Co(e);+ let t = So(e);s(t?.media_dirs ?? []), (!t || t.port) && g(t?.port || q(e));});};@@ -3762,7 +3709,7 @@ function To({ data: e, receipt: t }) {title: "媒体库与目录",onSubmit: re,children: [/* @__PURE__ */ (0, Q.jsxs)(V, { children: [- /* @__PURE__ */ (0, Q.jsx)(oo, {}),+ /* @__PURE__ */ (0, Q.jsx)(ao, {}),/* @__PURE__ */ (0, Q.jsx)("div", {role: "group","aria-label": "媒体库与目录",@@ -3785,7 +3732,7 @@ function To({ data: e, receipt: t }) {/* @__PURE__ */ (0, Q.jsxs)("div", {"data-library-head": "",children: [- /* @__PURE__ */ (0, Q.jsx)(no, {+ /* @__PURE__ */ (0, Q.jsx)(to, {label: `${f} 图标`,value: e.library_icon,kind: e.transport === "smb" ? "smb" : e.location,@@ -3799,26 +3746,26 @@ function To({ data: e, receipt: t }) {value: e.library,onChange: (e) => w(t, { library: e })}),- /* @__PURE__ */ (0, Q.jsx)(lo, {+ /* @__PURE__ */ (0, Q.jsx)(co, {id: e.library_id,name: e.library,value: e.library_color,onChange: (e) => w(t, { library_color: e })}),- /* @__PURE__ */ (0, Q.jsx)(so, {+ /* @__PURE__ */ (0, Q.jsx)(oo, {name: f,value: d,onChange: (n) => w(t, {library_policy: n,- library_stages: n === "custom" ? e.library_stages || io.join(",") : ""+ library_stages: n === "custom" ? e.library_stages || ro.join(",") : ""})})]}),- d === "custom" ? /* @__PURE__ */ (0, Q.jsx)(co, {+ d === "custom" ? /* @__PURE__ */ (0, Q.jsx)(so, {name: f,- value: bo(e),- onChange: (e) => w(t, { library_stages: io.filter((t) => e.includes(t)).join(",") })+ value: yo(e),+ onChange: (e) => w(t, { library_stages: ro.filter((t) => e.includes(t)).join(",") })}) : null,/* @__PURE__ */ (0, Q.jsxs)("div", {"data-library-folders": "",@@ -3836,12 +3783,12 @@ function To({ data: e, receipt: t }) {picking: c === i,onPick: () => void l(i),onRemove: n.length > 1 ? () => a(i) : void 0,- status: ae(t) ? /* @__PURE__ */ (0, Q.jsx)(Eo, { online: ae(t)?.online }) : null,+ status: ae(t) ? /* @__PURE__ */ (0, Q.jsx)(To, { online: ae(t)?.online }) : null,children: [/* @__PURE__ */ (0, Q.jsxs)(Zn, { children: [/* @__PURE__ */ (0, Q.jsx)(nr, {index: i,value: t.transport === "smb" ? "smb" : t.location,- options: go,+ options: ho,onChange: (e) => {let n = e === "smb";r(i, {@@ -3894,7 +3841,7 @@ function To({ data: e, receipt: t }) {selectedKey: t.library_id,renderValue: /* @__PURE__ */ (0, Q.jsxs)("span", {className: "flex min-w-0 items-center gap-2",- children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: _o(e) }), /* @__PURE__ */ (0, Q.jsx)("span", {+ children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: go(e) }), /* @__PURE__ */ (0, Q.jsx)("span", {className: "truncate",children: f})]@@ -3907,7 +3854,7 @@ function To({ data: e, receipt: t }) {textValue: e.library || "未命名媒体库",children: /* @__PURE__ */ (0, Q.jsxs)("span", {className: "flex min-w-0 items-center gap-2",- children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: _o(e) }), /* @__PURE__ */ (0, Q.jsx)("span", {+ children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: go(e) }), /* @__PURE__ */ (0, Q.jsx)("span", {className: "truncate",children: e.library || "未命名媒体库"})]@@ -4004,7 +3951,7 @@ function To({ data: e, receipt: t }) {"aria-label": `给 ${f} 添加文件夹`,onClick: () => {i(), r(n.length, {- ...yo(e),+ ...vo(e),location: e.location,cost: e.cost});@@ -4024,7 +3971,7 @@ function To({ data: e, receipt: t }) {children: "添加媒体库"}),/* @__PURE__ */ (0, Q.jsx)(N, { children: mt }),- oe ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(tr, {}), /* @__PURE__ */ (0, Q.jsx)(qa, {})] }) : null,+ oe ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(tr, {}), /* @__PURE__ */ (0, Q.jsx)(Ka, {})] }) : null,se.map((e) => /* @__PURE__ */ (0, Q.jsxs)(N, { children: ["未检测到 ",e.name,@@ -4054,18 +4001,18 @@ function To({ data: e, receipt: t }) {})]});}-function Eo({ online: e }) {+function To({ online: e }) {return /* @__PURE__ */ (0, Q.jsx)(or, { online: e });}-function Do({ data: e }) {+function Eo({ data: e }) {let t = e.media_sources, n = Y();return t ? /* @__PURE__ */ (0, Q.jsxs)(L, {guide: "mounts",title: "挂载状态",children: [/* @__PURE__ */ (0, Q.jsx)(ut, { children: t.map((e, t) => /* @__PURE__ */ (0, Q.jsxs)(j, {- term: /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: ir(e.location) }), ho(e.location)] }),- children: [e.path || "未配置挂载点", /* @__PURE__ */ (0, Q.jsx)(Eo, { online: e.online })]+ term: /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(Ht, { mark: ir(e.location) }), mo(e.location)] }),+ children: [e.path || "未配置挂载点", /* @__PURE__ */ (0, Q.jsx)(To, { online: e.online })]}, t)) }),n.error ? /* @__PURE__ */ (0, Q.jsx)(V, {divided: !0,@@ -4081,12 +4028,12 @@ function Do({ data: e }) {}) : null;}// src/react/settings/service-preferences.tsx-var Oo = [+var Do = [["off", "关闭"],["precise", "每 10 秒一张"],["coarse", "每 30 秒一张"]];-function ko({ epoch: e = 0, disabled: t = !1 }) {+function Oo({ epoch: e = 0, disabled: t = !1 }) {let n = X({queryKey: Ut,queryFn: ({ signal: e }) => _n(e),@@ -4109,7 +4056,7 @@ function ko({ epoch: e = 0, disabled: t = !1 }) {onSelectionChange: (e) => {e !== null && r.mutate(String(e));},- children: Oo.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {+ children: Do.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {id: e,children: t}, e))@@ -4129,7 +4076,7 @@ function ko({ epoch: e = 0, disabled: t = !1 }) {}) : null] });}-function Ao({ receipt: e }) {+function ko({ receipt: e }) {let t = Zt();(0, Z.useSyncExternalStore)(t.subscribe, t.version);let n = X({@@ -4141,8 +4088,8 @@ function Ao({ receipt: e }) {guide: "follow-options",title: "关注采集",children: [/* @__PURE__ */ (0, Q.jsxs)(I, { children: [+ /* @__PURE__ */ (0, Q.jsx)(Ao, {}),/* @__PURE__ */ (0, Q.jsx)(jo, {}),- /* @__PURE__ */ (0, Q.jsx)(Mo, {}),/* @__PURE__ */ (0, Q.jsx)(B, {label: "首次采集范围",description: "新关注的来源第一次回看多久以前的内容。",@@ -4187,7 +4134,7 @@ function Ao({ receipt: e }) {}) : null]});}-function jo() {+function Ao() {let e = X({queryKey: lt,queryFn: ({ signal: e }) => pn(e),@@ -4246,7 +4193,7 @@ function jo() {role: "status",children: t.isPending ? "正在保存…" : "正在检查来源更新…"}) }) : null,- /* @__PURE__ */ (0, Q.jsx)(No, {+ /* @__PURE__ */ (0, Q.jsx)(Mo, {kind: "follow",status: n,title: "上次自动检查失败"@@ -4254,7 +4201,7 @@ function jo() {u ? /* @__PURE__ */ (0, Q.jsx)(V, { children: /* @__PURE__ */ (0, Q.jsx)(k, { children: q(u) }) }) : null] });}-function Mo() {+function jo() {let e = X({queryKey: ot,queryFn: ({ signal: e }) => fn(e),@@ -4283,14 +4230,14 @@ function Mo() {role: "status",children: "正在拉取订阅源…"}) }) : null,- /* @__PURE__ */ (0, Q.jsx)(No, {+ /* @__PURE__ */ (0, Q.jsx)(Mo, {kind: "feed",status: t,title: "上次自动拉取失败"})] });}-function No({ kind: e, status: t, title: n }) {+function Mo({ kind: e, status: t, title: n }) {let r = Wn(e);if (!t?.enabled || t.running || !t.last_error) return null;let i = t.consecutive_failures ?? 0, a = xn(t.next_run_at), o = [i > 1 ? `已连续失败 ${i} 次` : "", a ? `下一轮 ${a}` : ""].filter(Boolean).join(","), s = [@@ -4313,7 +4260,7 @@ function No({ kind: e, status: t, title: n }) {}) });}// src/react/settings/media-processing-settings.tsx-function Po({ receipt: e }) {+function No({ receipt: e }) {let t = X({queryKey: bt,queryFn: ({ signal: e }) => hn(e)@@ -4334,7 +4281,7 @@ function Po({ receipt: e }) {})})}) }),- /* @__PURE__ */ (0, Q.jsx)(ko, { disabled: !t.data || t.data.metadata_only || !!n.busy }),+ /* @__PURE__ */ (0, Q.jsx)(Oo, { disabled: !t.data || t.data.metadata_only || !!n.busy }),/* @__PURE__ */ (0, Q.jsx)(I, { children: /* @__PURE__ */ (0, Q.jsx)(B, {label: "抽帧解码方式",description: "用于生成封面、九宫格和时间轴。",@@ -4373,7 +4320,7 @@ function Po({ receipt: e }) {]});}-function Fo({ receipt: e }) {+function Po({ receipt: e }) {let t = X({queryKey: bt,queryFn: ({ signal: e }) => hn(e)@@ -4421,7 +4368,7 @@ function Fo({ receipt: e }) {});}// src/react/boardui/components/base/textarea/textarea.tsx-var Io = Rn({+var Fo = Rn({field: "relative flex w-full flex-col rounded-2lg bg-background-tertiary-default text-foreground-icon-tertiary ring-2 ring-inset ring-transparent transition-[background-color,box-shadow,color] duration-[var(--input-transition-ms)] ease",fieldSize: {medium: "p-2",@@ -4434,8 +4381,8 @@ var Io = Rn({},footer: "flex w-full items-start justify-between gap-3",count: "ms-auto shrink-0 pt-px text-caption-1-medium text-text-tertiary tabular-nums"-}), Lo = 20;-function Ro({ size: e, rows: t = 3, autoResize: n = !1, maxRows: r, resize: i = "vertical", fieldClassName: a, className: o, ref: s, groupRef: c, onInput: l, ...u }) {+}), Io = 20;+function Lo({ size: e, rows: t = 3, autoResize: n = !1, maxRows: r, resize: i = "vertical", fieldClassName: a, className: o, ref: s, groupRef: c, onInput: l, ...u }) {let d = (0, Z.useContext)(Kt), f = e ?? d.size ?? "medium", p = (0, Z.useRef)(null), m = (e) => {p.current = e, typeof s == "function" ? s(e) : s && (s.current = e);}, h = () => {@@ -4445,14 +4392,14 @@ function Ro({ size: e, rows: t = 3, autoResize: n = !1, maxRows: r, resize: i =e.style.height = "", e.style.maxHeight = "", e.style.overflowY = "";return;}- let i = parseFloat(window.getComputedStyle(e).lineHeight) || Lo, a = r ? r * i : Infinity;+ let i = parseFloat(window.getComputedStyle(e).lineHeight) || Io, a = r ? r * i : Infinity;e.style.height = "0px";let o = Math.max(e.scrollHeight, t * i);e.style.height = `${Math.min(o, a)}px`, e.style.maxHeight = r ? `${a}px` : "", e.style.overflowY = o > a ? "auto" : "hidden";};return (0, Z.useLayoutEffect)(h), /* @__PURE__ */ (0, Q.jsx)(Re, {ref: c,- className: ({ isFocusWithin: e, isHovered: t, isDisabled: n, isInvalid: r }) => sn(Io.field, Io.fieldSize[f], t && !e && !n && !r && "ring-border-button-hover", e && !n && !r && "ring-border-button-active", n && "bg-input-disabled-background text-input-disabled-foreground", r && "bg-background-tertiary-error text-foreground-icon-error", d.fieldClassName, a),+ className: ({ isFocusWithin: e, isHovered: t, isDisabled: n, isInvalid: r }) => sn(Fo.field, Fo.fieldSize[f], t && !e && !n && !r && "ring-border-button-hover", e && !n && !r && "ring-border-button-active", n && "bg-input-disabled-background text-input-disabled-foreground", r && "bg-background-tertiary-error text-foreground-icon-error", d.fieldClassName, a),children: /* @__PURE__ */ (0, Q.jsx)(Ve, {ref: m,rows: t,@@ -4460,12 +4407,12 @@ function Ro({ size: e, rows: t = 3, autoResize: n = !1, maxRows: r, resize: i =onInput: (e) => {h(), l?.(e);},- className: sn(Io.textarea, Io.resize[n ? "none" : i], d.inputClassName, o)+ className: sn(Fo.textarea, Fo.resize[n ? "none" : i], d.inputClassName, o)})});}-Ro.displayName = "TextareaBase";-function zo({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResize: a, maxRows: o, resize: s, maxLength: c, showCount: l = !1, fieldClassName: u, ref: d, groupRef: f, className: p, value: m, defaultValue: h, onChange: g, ..._ }) {+Lo.displayName = "TextareaBase";+function Ro({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResize: a, maxRows: o, resize: s, maxLength: c, showCount: l = !1, fieldClassName: u, ref: d, groupRef: f, className: p, value: m, defaultValue: h, onChange: g, ..._ }) {let [v, y] = (0, Z.useState)(() => (h ?? "").length), b = m === void 0 ? v : m.length;return /* @__PURE__ */ (0, Q.jsx)(Gt, {..._,@@ -4483,7 +4430,7 @@ function zo({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResizetooltip: n,children: e}),- /* @__PURE__ */ (0, Q.jsx)(Ro, {+ /* @__PURE__ */ (0, Q.jsx)(Lo, {ref: d,groupRef: f,placeholder: r,@@ -4495,22 +4442,22 @@ function zo({ label: e, hint: t, tooltip: n, placeholder: r, rows: i, autoResizefieldClassName: u}),(t || l) && /* @__PURE__ */ (0, Q.jsxs)("div", {- className: Io.footer,+ className: Fo.footer,children: [t && /* @__PURE__ */ (0, Q.jsx)(ft, {isInvalid: m,children: t}), l && /* @__PURE__ */ (0, Q.jsx)("span", {- className: sn(Io.count, m && "text-text-error-primary"),+ className: sn(Fo.count, m && "text-text-error-primary"),children: c ? `${b}/${c}` : b})]})] })});}-zo.displayName = "Textarea";+Ro.displayName = "Textarea";// src/react/settings/code-pattern-settings.tsx-var Bo = "^\\+{3}\\s*(?<code>FC2-PPV-\\d+)\n\\[(?<code>[A-Z]+-\\d+)\\]";-function Vo({ receipt: e }) {+var zo = "^\\+{3}\\s*(?<code>FC2-PPV-\\d+)\n\\[(?<code>[A-Z]+-\\d+)\\]";+function Bo({ receipt: e }) {let t = X({queryKey: Pt,queryFn: ({ signal: e }) => gn(e)@@ -4525,7 +4472,7 @@ function Vo({ receipt: e }) {On.setQueryData(Pt, t), r(null), e("已保存配置");});},- children: [/* @__PURE__ */ (0, Q.jsxs)(V, { children: [/* @__PURE__ */ (0, Q.jsx)(N, { children: "内置规则认不出番号时,按这里的规则从文件名里取。每行一条正则表达式,番号写在 (?<code>…) 里,没有命名组就取第一个括号。规则在下一次处理时对还没有番号的视频生效。" }), /* @__PURE__ */ (0, Q.jsx)(zo, {+ children: [/* @__PURE__ */ (0, Q.jsxs)(V, { children: [/* @__PURE__ */ (0, Q.jsx)(N, { children: "内置规则认不出番号时,按这里的规则从文件名里取。每行一条正则表达式,番号写在 (?<code>…) 里,没有命名组就取第一个括号。规则在下一次处理时对还没有番号的视频生效。" }), /* @__PURE__ */ (0, Q.jsx)(Ro, {id: "codePatternSetting","aria-label": "番号识别规则",rows: 3,@@ -4533,7 +4480,7 @@ function Vo({ receipt: e }) {maxRows: 12,spellCheck: "false",autoComplete: "off",- placeholder: Bo,+ placeholder: zo,value: a,isDisabled: !t.data,isInvalid: !!o,@@ -4547,7 +4494,7 @@ function Vo({ receipt: e }) {});}// src/react/settings/password-pair.tsx-function Ho({ label: e, password: t, confirmation: n, onPassword: r, onConfirmation: i, disabled: a = !1, passwordError: o, passwordHint: s, confirmationError: c, confirmationInvalid: l = !1 }) {+function Vo({ label: e, password: t, confirmation: n, onPassword: r, onConfirmation: i, disabled: a = !1, passwordError: o, passwordHint: s, confirmationError: c, confirmationInvalid: l = !1 }) {return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(P, {id: "access-password",type: "password",@@ -4577,12 +4524,12 @@ function Ho({ label: e, password: t, confirmation: n, onPassword: r, onConfirmat})] });}// src/react/settings/access-settings.tsx-var Uo = {+var Ho = {legacy: "当前使用系统生成的访问口令。改设自己的密码,或关闭登录要求。",locked: "访问设置无法读取,请在本机检查配置文件。",password: "已设置密码。新设备需要登录,登录时勾选「保持登录」可保持 30 天。"};-function Wo({ initial: e, receipt: t, devices: n }) {+function Uo({ initial: e, receipt: t, devices: n }) {let [r, i] = (0, Z.useState)(e), [a, o] = (0, Z.useState)(""), [s, c] = (0, Z.useState)(""), [l, u] = (0, Z.useState)(""), [d, f] = (0, Z.useState)(!1), [p, m] = (0, Z.useState)({}), h = (0, Z.useRef)(null), g = Y(), _ = (e) => {e.preventDefault();let n = {};@@ -4599,7 +4546,7 @@ function Wo({ initial: e, receipt: t, devices: n }) {let t = e instanceof qe ? e.body : null, n = t?.errors || t?.detail?.errors;n ? m(n) : g.setError(q(e));});- }, v = Uo[r.mode], y = r.mode !== "locked";+ }, v = Ho[r.mode], y = r.mode !== "locked";return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsxs)(L, {guide: "access",title: "访问密码",@@ -4631,7 +4578,7 @@ function Wo({ initial: e, receipt: t, devices: n }) {isInvalid: !!p.current_password,hint: p.current_password}) : null,- y && !d ? /* @__PURE__ */ (0, Q.jsx)(Ho, {+ y && !d ? /* @__PURE__ */ (0, Q.jsx)(Vo, {label: r.mode === "password" ? "新访问密码" : "设置访问密码",password: s,confirmation: l,@@ -4656,27 +4603,27 @@ function Wo({ initial: e, receipt: t, devices: n }) {}), n && (r.mode === "password" || r.mode === "legacy") ? n(r) : null] });}// src/react/settings/device-sessions.tsx-var Go = "/api/configuration/access/sessions", Ko = (e) => e.device || "未识别的浏览器", qo = {+var Wo = "/api/configuration/access/sessions", Go = (e) => e.device || "未识别的浏览器", Ko = {glyph: pt,brand: "apple"-}, Jo = {+}, qo = {glyph: bn,brand: "android"-}, Yo = {+}, Jo = {iPhone: {- platform: qo,+ platform: Ko,terminal: Yt},iPad: {- platform: qo,+ platform: Ko,terminal: at},Android: {- platform: Jo,+ platform: qo,terminal: Yt},"Android 平板": {- platform: Jo,+ platform: qo,terminal: at},ChromeOS: {@@ -4691,73 +4638,73 @@ var Go = "/api/configuration/access/sessions", Ko = (e) => e.device || "未识terminal: Jn},macOS: {- platform: qo,+ platform: Ko,terminal: Jn},Linux: { terminal: Jn }-}, Xo = "inline size-4 -mt-0.5 mr-1 align-middle";-function Zo({ platform: e }) {+}, Yo = "inline size-4 -mt-0.5 mr-1 align-middle";+function Xo({ platform: e }) {if ("browser" in e) return /* @__PURE__ */ (0, Q.jsx)(cr, {name: e.browser,- className: Xo+ className: Yo});let { glyph: t, brand: n } = e;return /* @__PURE__ */ (0, Q.jsx)(t, {"aria-hidden": !0,"data-platform-mark": n,- className: Xo+ className: Yo});}-function Qo({ row: e }) {- if (!e.device) return Ko(e);- let t = e.device.split(" · "), n = Yo[t.at(-1) ?? ""] ? t.pop() : "", r = t.join(" · "), i = n ? Yo[n].platform : void 0;+function Zo({ row: e }) {+ if (!e.device) return Go(e);+ let t = e.device.split(" · "), n = Jo[t.at(-1) ?? ""] ? t.pop() : "", r = t.join(" · "), i = n ? Jo[n].platform : void 0;return /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [r ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [lr(r) ? /* @__PURE__ */ (0, Q.jsx)(cr, {name: r,- className: Xo+ className: Yo}) : null, r] }) : null,r && n ? " · " : null,- n ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [i ? /* @__PURE__ */ (0, Q.jsx)(Zo, { platform: i }) : null, n] }) : null+ n ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [i ? /* @__PURE__ */ (0, Q.jsx)(Xo, { platform: i }) : null, n] }) : null] });}-function $o({ row: e }) {- let t = Yo[e.device.split(" · ").at(-1) ?? ""]?.terminal ?? cn;+function Qo({ row: e }) {+ let t = Jo[e.device.split(" · ").at(-1) ?? ""]?.terminal ?? cn;return /* @__PURE__ */ (0, Q.jsx)(t, {"aria-hidden": !0,className: "size-5 shrink-0 text-foreground-icon-secondary"});}-function es({ row: e, children: t }) {+function $o({ row: e, children: t }) {return /* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex min-h-13 w-full items-center justify-between gap-4 border-b border-separator-border py-2.5 pr-2.5 last:border-b-0",children: [/* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex min-w-0 items-center gap-3",- children: [/* @__PURE__ */ (0, Q.jsx)($o, { row: e }), /* @__PURE__ */ (0, Q.jsxs)("div", {+ children: [/* @__PURE__ */ (0, Q.jsx)(Qo, { row: e }), /* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex min-w-0 flex-col",children: [/* @__PURE__ */ (0, Q.jsx)("p", {className: "text-body-regular text-text-primary",- children: /* @__PURE__ */ (0, Q.jsx)(Qo, { row: e })+ children: /* @__PURE__ */ (0, Q.jsx)(Zo, { row: e })}), /* @__PURE__ */ (0, Q.jsx)("p", {className: "text-body-2-regular text-text-secondary",- children: rs(e)+ children: ns(e)})]})]}), t]});}-function ts(e, t = Date.now() / 1e3) {+function es(e, t = Date.now() / 1e3) {let n = Math.max(0, t - e);return n < 60 ? "刚刚" : n < 3600 ? `${Math.floor(n / 60)} 分钟前` : n < 86400 ? `${Math.floor(n / 3600)} 小时前` : n < 2592e3 ? `${Math.floor(n / 86400)} 天前` : (/* @__PURE__ */ new Date(e * 1e3)).toLocaleDateString("zh-CN");}-function ns(e) {+function ts(e) {return e.network === "loopback" ? "运行 Peach 的电脑" : e.network ? e.remote ? `公网入口 · ${e.network}` : e.network : "";}-var rs = (e) => [`最近活动 ${ts(e.last_seen)}`, ns(e)].filter(Boolean).join(" · ");-function is({ revision: e, receipt: t }) {+var ns = (e) => [`最近活动 ${es(e.last_seen)}`, ts(e)].filter(Boolean).join(" · ");+function rs({ revision: e, receipt: t }) {let n = X({queryKey: ["access-sessions", e],refetchOnMount: "always",- queryFn: ({ signal: e }) => W(Go, e)+ queryFn: ({ signal: e }) => W(Wo, e)});return n.error ? /* @__PURE__ */ (0, Q.jsx)(L, {title: "已登录的设备",@@ -4765,12 +4712,12 @@ function is({ revision: e, receipt: t }) {}) : n.isFetching || !n.data ? /* @__PURE__ */ (0, Q.jsx)(It, {label: "正在读取已登录的设备",html: ln- }) : /* @__PURE__ */ (0, Q.jsx)(as, {+ }) : /* @__PURE__ */ (0, Q.jsx)(is, {initial: n.data,receipt: t});}-function as({ initial: e, receipt: t }) {+function is({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e);(0, Z.useEffect)(() => r(e), [e]);let i = n.sessions.filter((e) => !e.current);@@ -4782,10 +4729,10 @@ function as({ initial: e, receipt: t }) {}, [n, i.length]);let a = (e) => void rn({title: "撤销这台设备的登录",- body: `${Ko(e)}(${rs(e)})下次打开 Peach 需要重新输入访问密码。`,+ body: `${Go(e)}(${ns(e)})下次打开 Peach 需要重新输入访问密码。`,confirmLabel: "撤销登录",onConfirm: async () => {- r(await G(`${Go}/revoke`, {+ r(await G(`${Wo}/revoke`, {revision: n.revision,id: e.id})), t("已撤销登录");@@ -4794,7 +4741,7 @@ function as({ initial: e, receipt: t }) {return /* @__PURE__ */ (0, Q.jsxs)(L, {title: "已登录的设备",children: [- n.sessions.length ? /* @__PURE__ */ (0, Q.jsx)(I, { children: n.sessions.map((e) => /* @__PURE__ */ (0, Q.jsx)(es, {+ n.sessions.length ? /* @__PURE__ */ (0, Q.jsx)(I, { children: n.sessions.map((e) => /* @__PURE__ */ (0, Q.jsx)($o, {row: e,children: e.current ? /* @__PURE__ */ (0, Q.jsx)(et, {color: "blue",@@ -4803,7 +4750,7 @@ function as({ initial: e, receipt: t }) {}) : n.manageable ? /* @__PURE__ */ (0, Q.jsx)(E, {size: "small",variant: "secondary",- "aria-label": `撤销 ${Ko(e)} 的登录`,+ "aria-label": `撤销 ${Go(e)} 的登录`,onClick: () => a(e),children: "撤销"}) : null@@ -4821,7 +4768,7 @@ function as({ initial: e, receipt: t }) {body: `除本机以外的 ${i.length} 台设备下次打开 Peach 需要重新输入访问密码。`,confirmLabel: "撤销登录",onConfirm: async () => {- let e = await G(`${Go}/revoke`, {+ let e = await G(`${Wo}/revoke`, {revision: n.revision,scope: "others"});@@ -4835,7 +4782,7 @@ function as({ initial: e, receipt: t }) {});}// src/react/components/configuration-fields.tsx-function os({ id: e, label: t, value: n, onChange: r, options: i, isDisabled: a, isInvalid: o, children: s }) {+function as({ id: e, label: t, value: n, onChange: r, options: i, isDisabled: a, isInvalid: o, children: s }) {let c = `${e}-label`;return /* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex flex-col gap-1.5",@@ -4864,7 +4811,7 @@ function os({ id: e, label: t, value: n, onChange: r, options: i, isDisabled: a,]});}-function ss({ prefix: e, suffix: t, ...n }) {+function os({ prefix: e, suffix: t, ...n }) {let r = () => /* @__PURE__ */ (0, Q.jsx)("span", {className: "shrink-0 pr-1 text-body-regular text-text-secondary",children: t@@ -4879,18 +4826,18 @@ function ss({ prefix: e, suffix: t, ...n }) {});}// src/react/settings/port-settings.tsx-var cs = [{+var ss = [{value: "0.0.0.0",label: "同一局域网的设备"}, {value: "127.0.0.1",label: "只有这台电脑"}];-function ls({ data: e, receipt: t }) {+function cs({ data: e, receipt: t }) {let n = e.network, r = n ? n.editable : e.editable && e.port_editable !== !1, [i, a] = (0, Z.useState)(n?.host ?? "127.0.0.1"), [o, s] = (0, Z.useState)(n?.mdns_name ?? "peach"), [c, l] = (0, Z.useState)(String(e.port)), [u, d] = (0, Z.useState)({}), [f, p] = (0, Z.useState)(null), m = Y();return (0, Z.useEffect)(() => {if (!f) return;- let e = setTimeout(() => location.assign(f.url), Wa);+ let e = setTimeout(() => location.assign(f.url), Ua);return () => clearTimeout(e);}, [f]), f ? /* @__PURE__ */ (0, Q.jsx)(L, {guide: "port",@@ -4926,33 +4873,33 @@ function ls({ data: e, receipt: t }) {});} : void 0,children: [/* @__PURE__ */ (0, Q.jsxs)(V, { children: [- n ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(us, {+ n ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(ls, {label: "本机地址",value: n.local_url,receipt: t}), n.lan_url || n.ip_url ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [- /* @__PURE__ */ (0, Q.jsx)(us, {+ /* @__PURE__ */ (0, Q.jsx)(ls, {label: "手机连接地址",value: n.lan_url || n.ip_url,receipt: t}),- n.lan_url && n.ip_url ? /* @__PURE__ */ (0, Q.jsx)(us, {+ n.lan_url && n.ip_url ? /* @__PURE__ */ (0, Q.jsx)(ls, {label: "备用 IP 地址",value: n.ip_url,receipt: t}) : null,/* @__PURE__ */ (0, Q.jsxs)(N, { children: ["手机与电脑连接同一 Wi-Fi。", n.ip_url && n.lan_url ? "名称地址打不开时,可尝试备用 IP 地址。" : ""] })] }) : /* @__PURE__ */ (0, Q.jsx)(N, { children: n.scope === "local" ? "当前只允许这台电脑访问,手机无法连接。" : "局域网连接地址未取得,请检查电脑的网络连接和服务启动配置。" })] }) : null,- r ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [n?.editable ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(os, {+ r ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [n?.editable ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(as, {id: "configHost",label: "谁可以访问",value: i,onChange: a,- options: cs,+ options: ss,isDisabled: !!m.busy,isInvalid: !!u.host,children: u.host ? /* @__PURE__ */ (0, Q.jsx)(k, { children: u.host }) : null- }), i === "0.0.0.0" ? /* @__PURE__ */ (0, Q.jsx)(ss, {+ }), i === "0.0.0.0" ? /* @__PURE__ */ (0, Q.jsx)(os, {id: "configMdnsName",label: "局域网访问地址",value: o,@@ -4966,7 +4913,7 @@ function ls({ data: e, receipt: t }) {validationBehavior: "aria",isInvalid: !!u.mdns_name,hint: u.mdns_name || void 0- }) : null] }) : null, /* @__PURE__ */ (0, Q.jsx)(ss, {+ }) : null] }) : null, /* @__PURE__ */ (0, Q.jsx)(os, {id: "configPort",label: "端口",prefix: "localhost:",@@ -4994,7 +4941,7 @@ function ls({ data: e, receipt: t }) {}) : null]});}-function us({ label: e, value: t, receipt: n }) {+function ls({ label: e, value: t, receipt: n }) {let r = Y();return /* @__PURE__ */ (0, Q.jsxs)("div", {className: "flex min-w-0 flex-col gap-2",@@ -5019,12 +4966,12 @@ function us({ label: e, value: t, receipt: n }) {});}// src/react/settings/peach-proxy-fields.tsx-var ds = [+var us = [["environment", "跟随环境"],["direct", "直连"],["proxy", "自定义"]];-function fs({ mode: e, onChange: t, labelledBy: n }) {+function ds({ mode: e, onChange: t, labelledBy: n }) {return /* @__PURE__ */ (0, Q.jsx)(R, {"aria-label": n ? void 0 : "连接方式","aria-labelledby": n,@@ -5032,13 +4979,13 @@ function fs({ mode: e, onChange: t, labelledBy: n }) {onSelectionChange: (e) => {e !== null && t(String(e));},- children: ds.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {+ children: us.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(z, {id: e,children: t}, e))});}-function ps({ id: e, value: t, onChange: n, saved: r = !1, error: i }) {+function fs({ id: e, value: t, onChange: n, saved: r = !1, error: i }) {return /* @__PURE__ */ (0, Q.jsx)(P, {id: e,type: "password",@@ -5054,11 +5001,11 @@ function ps({ id: e, value: t, onChange: n, saved: r = !1, error: i }) {});}// src/react/settings/tunnel-settings.tsx-var ms = 2e3, hs = [["quick", "临时链接"], ["named", "命名隧道"]], gs = {+var ps = 2e3, ms = [["quick", "临时链接"], ["named", "命名隧道"]], hs = {quick: "临时预览用,地址随机,重启后会变。启动前要先设置访问密码。",named: "使用你在 Cloudflare 绑定的固定域名。启动前要先设置访问密码。"};-function _s({ revision: e, initial: t, receipt: n }) {+function gs({ revision: e, initial: t, receipt: n }) {let [r, i] = (0, Z.useState)(t), [a, o] = (0, Z.useState)(e), [s, c] = (0, Z.useState)(t.mode), [l, u] = (0, Z.useState)(t.hostname), [d, f] = (0, Z.useState)(""), [p, m] = (0, Z.useState)({}), h = Y(), g = r.state === "starting" || r.state === "running", _ = r.named_available && s === "named";(0, Z.useEffect)(() => {if (r.state !== "starting") return;@@ -5066,7 +5013,7 @@ function _s({ revision: e, initial: t, receipt: n }) {un(e.signal).then((t) => {!e.signal.aborted && t.tunnel && (On.setQueryData(Ze, t), i(t.tunnel), o(t.revision));}).catch(() => void 0);- }, ms);+ }, ps);return () => {e.abort(), window.clearInterval(t);};@@ -5103,13 +5050,13 @@ function _s({ revision: e, initial: t, receipt: n }) {isDisabled: g,onChange: (e) => c(e),className: Nt,- children: hs.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(Ge, {+ children: ms.map(([e, t]) => /* @__PURE__ */ (0, Q.jsx)(Ge, {value: e,className: Mt,children: t}, e))}) : null,- /* @__PURE__ */ (0, Q.jsx)(N, { children: gs[_ ? "named" : "quick"] }),+ /* @__PURE__ */ (0, Q.jsx)(N, { children: hs[_ ? "named" : "quick"] }),_ ? /* @__PURE__ */ (0, Q.jsxs)(Q.Fragment, { children: [/* @__PURE__ */ (0, Q.jsx)(P, {id: "tunnel-hostname",label: "公开主机名",@@ -5169,36 +5116,36 @@ function _s({ revision: e, initial: t, receipt: n }) {});}// src/react/settings/network-settings.tsx-function vs({ data: e, receipt: t, panel: n, issues: r }) {+function _s({ data: e, receipt: t, panel: n, issues: r }) {return /* @__PURE__ */ (0, Q.jsxs)("div", {...dr(n),children: [r,- e.network || e.editable && e.port_editable !== !1 && !e.section_errors?.media_sources ? /* @__PURE__ */ (0, Q.jsx)(ls, {+ e.network || e.editable && e.port_editable !== !1 && !e.section_errors?.media_sources ? /* @__PURE__ */ (0, Q.jsx)(cs, {data: e,receipt: t}) : null,- e.access ? /* @__PURE__ */ (0, Q.jsx)(Wo, {+ e.access ? /* @__PURE__ */ (0, Q.jsx)(Uo, {initial: e.access,receipt: t,- devices: (e) => /* @__PURE__ */ (0, Q.jsx)(is, {+ devices: (e) => /* @__PURE__ */ (0, Q.jsx)(rs, {revision: e.revision,receipt: t})}) : null,- e.tunnel ? /* @__PURE__ */ (0, Q.jsx)(_s, {+ e.tunnel ? /* @__PURE__ */ (0, Q.jsx)(gs, {revision: e.revision,initial: e.tunnel,receipt: t}) : null,- e.peach_proxy ? /* @__PURE__ */ (0, Q.jsx)(ys, {+ e.peach_proxy ? /* @__PURE__ */ (0, Q.jsx)(vs, {initial: e.peach_proxy,receipt: t}) : null]});}-function ys({ initial: e, receipt: t }) {+function vs({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(e.mode), [o, s] = (0, Z.useState)(""), c = Y();return /* @__PURE__ */ (0, Q.jsxs)(L, {id: "peachProxy",@@ -5216,7 +5163,7 @@ function ys({ initial: e, receipt: t }) {/* @__PURE__ */ (0, Q.jsx)(I, { children: /* @__PURE__ */ (0, Q.jsx)(B, {label: "连接方式",description: "Peach 访问外网和采集来源时使用。",- children: /* @__PURE__ */ (0, Q.jsx)(fs, {+ children: /* @__PURE__ */ (0, Q.jsx)(ds, {mode: i,onChange: a})@@ -5224,7 +5171,7 @@ function ys({ initial: e, receipt: t }) {i === "proxy" || n.needs_selection || c.error ? /* @__PURE__ */ (0, Q.jsxs)(V, {divided: !0,children: [- i === "proxy" ? /* @__PURE__ */ (0, Q.jsx)(ps, {+ i === "proxy" ? /* @__PURE__ */ (0, Q.jsx)(fs, {id: "peachProxyAddress",value: o,onChange: s,@@ -5247,11 +5194,11 @@ function ys({ initial: e, receipt: t }) {});}// src/react/follow-manage/credentials.tsx-var bs = "将清除这个来源在本机和共享副本中的登录凭据。", xs = "其他系统用户可以读取此凭据文件。请在运行 Peach 的 Mac 或 Linux 电脑上,将文件权限设为仅当前用户可读写(0600)。";-function Ss(e, t) {+var ys = "将清除这个来源在本机和共享副本中的登录凭据。", bs = "其他系统用户可以读取此凭据文件。请在运行 Peach 的 Mac 或 Linux 电脑上,将文件权限设为仅当前用户可读写(0600)。";+function xs(e, t) {return (e.shared_fields || []).includes(t) ? "来自共享,留空表示不改" : e.fields.includes(t) ? "已保存,留空表示不改" : "未填写";}-function Cs({ row: e }) {+function Ss({ row: e }) {if (an(e)) return /* @__PURE__ */ (0, Q.jsx)(et, {variant: "caption",color: "lime",@@ -5264,7 +5211,7 @@ function Cs({ row: e }) {children: $e[e.requirement] || ""});}-function ws({ row: e, readOnly: t, toast: n }) {+function Cs({ row: e, readOnly: t, toast: n }) {let [r, i] = (0, Z.useState)({}), [a, o] = (0, Z.useState)(""), s = an(e), c = Hn({mutationFn: (t) => Pn(e.provider, t),onSuccess: (e, t) => {@@ -5291,7 +5238,7 @@ function ws({ row: e, readOnly: t, toast: n }) {children: (e.needs || []).map((n) => /* @__PURE__ */ (0, Q.jsx)(P, {type: "password",label: n,- placeholder: Ss(e, n),+ placeholder: xs(e, n),autoComplete: "off",spellCheck: "false",isDisabled: t,@@ -5311,7 +5258,7 @@ function ws({ row: e, readOnly: t, toast: n }) {...K(c.isPending),onClick: () => void rn({title: "清除来源凭据",- body: bs,+ body: ys,confirmLabel: "清除来源凭据",danger: !0,onConfirm: () => c.mutateAsync({})@@ -5338,7 +5285,7 @@ function ws({ row: e, readOnly: t, toast: n }) {]});}-function Ts({ row: e, readOnly: t, toast: n }) {+function ws({ row: e, readOnly: t, toast: n }) {let r = /* @__PURE__ */ (0, Q.jsxs)("span", {className: "flex min-w-0 flex-wrap items-center gap-2",children: [@@ -5350,7 +5297,7 @@ function Ts({ row: e, readOnly: t, toast: n }) {className: "min-w-0 text-body-medium wrap-anywhere text-text-primary",children: e.provider_label}),- /* @__PURE__ */ (0, Q.jsx)(Cs, { row: e }),+ /* @__PURE__ */ (0, Q.jsx)(Ss, { row: e }),e.missing.map((e) => /* @__PURE__ */ (0, Q.jsx)(et, {variant: "caption",color: "rose",@@ -5368,7 +5315,7 @@ function Ts({ row: e, readOnly: t, toast: n }) {/* @__PURE__ */ (0, Q.jsx)(O, {summary: an(e) ? "修改凭据" : "填写凭据",defaultOpen: e.requirement === "required" && !an(e),- children: /* @__PURE__ */ (0, Q.jsx)(ws, {+ children: /* @__PURE__ */ (0, Q.jsx)(Cs, {row: e,readOnly: t,toast: n@@ -5377,12 +5324,12 @@ function Ts({ row: e, readOnly: t, toast: n }) {e.world_readable ? /* @__PURE__ */ (0, Q.jsx)(F, {tone: "error",title: "凭据文件权限过宽",- children: xs+ children: bs}) : null]});}-function Es({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {+function Ts({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {let i = e.providers || [], a = i.filter((e) => e.requirement === "required" && !an(e));if ((0, Z.useEffect)(() => {An("credentials", { done: i.filter(an).map((e) => e.provider) });@@ -5420,7 +5367,7 @@ function Es({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {padding: "none",className: "flex flex-col overflow-hidden"}),- children: e.rows.map((e) => /* @__PURE__ */ (0, Q.jsx)(Ts, {+ children: e.rows.map((e) => /* @__PURE__ */ (0, Q.jsx)(ws, {row: e,readOnly: t,toast: n@@ -5450,7 +5397,7 @@ function Es({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {});}// src/react/settings/entry-links-settings.tsx-function Ds({ initial: e, receipt: t }) {+function Es({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e.sites), i = Y(), a = (e, t) => r((n) => n.map((n) => n.key === e ? {...n,host: t@@ -5490,31 +5437,31 @@ function Ds({ initial: e, receipt: t }) {});}// src/react/settings/indexer-settings.tsx-var Os = "/api/configuration/indexers";-function ks({ receipt: e }) {+var Ds = "/api/configuration/indexers";+function Os({ receipt: e }) {let t = X({queryKey: ["indexers"],- queryFn: ({ signal: e }) => W(Os, e),+ queryFn: ({ signal: e }) => W(Ds, e),refetchOnMount: "always"});return t.error ? /* @__PURE__ */ (0, Q.jsx)(k, { children: q(t.error) }) : t.isFetching ? /* @__PURE__ */ (0, Q.jsx)(It, {label: "正在读取资源搜索设置",html: vn- }) : t.data ? /* @__PURE__ */ (0, Q.jsx)(Ms, {+ }) : t.data ? /* @__PURE__ */ (0, Q.jsx)(js, {initial: t.data,receipt: e}) : null;}-function As(e) {+function ks(e) {try {return new globalThis.URL(e).host;} catch {return e;}}-function js({ row: e, index: t }) {+function As({ row: e, index: t }) {let n = [- e.url ? As(e.url) : "未填地址",+ e.url ? ks(e.url) : "未填地址",e.enabled ? "已启用" : "已停用",e.api_key_set && !e.clear_api_key ? "已保存 API key" : e.api_key ? "API key 待保存" : "没有 API key"];@@ -5529,7 +5476,7 @@ function js({ row: e, index: t }) {})]});}-function Ms({ initial: e, receipt: t }) {+function js({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e.indexers), i = Y();(0, Z.useEffect)(() => {An("indexers", { open: e.indexers.map((e) => !e.url) });@@ -5542,7 +5489,7 @@ function Ms({ initial: e, receipt: t }) {guide: "indexers",title: "资源搜索",onSubmit: (e) => {- e.preventDefault(), i.run("save", (e) => G(Os, { indexers: n }, "POST", e), (e) => {+ e.preventDefault(), i.run("save", (e) => G(Ds, { indexers: n }, "POST", e), (e) => {r(e.indexers), t("已保存索引器");});},@@ -5562,7 +5509,7 @@ function Ms({ initial: e, receipt: t }) {className: "min-w-0 border-t border-separator-border pt-2",children: /* @__PURE__ */ (0, Q.jsx)(O, {defaultOpen: !e.url,- summary: /* @__PURE__ */ (0, Q.jsx)(js, {+ summary: /* @__PURE__ */ (0, Q.jsx)(As, {row: e,index: t}),@@ -5647,7 +5594,7 @@ function Ms({ initial: e, receipt: t }) {});}// src/react/settings/source-settings.tsx-function Ns({ data: e, receipt: t, panel: n, issues: r }) {+function Ms({ data: e, receipt: t, panel: n, issues: r }) {let i = X({queryKey: st,queryFn: ({ signal: e }) => dn(e),@@ -5666,7 +5613,7 @@ function Ns({ data: e, receipt: t, panel: n, issues: r }) {children: "采集来源与登录状态"})}),- i.data ? /* @__PURE__ */ (0, Q.jsx)(Es, {+ i.data ? /* @__PURE__ */ (0, Q.jsx)(Ts, {data: i.data,readOnly: !!e.ledger_read_only,toast: t,@@ -5679,9 +5626,9 @@ function Ns({ data: e, receipt: t, panel: n, issues: r }) {label: "正在读取来源凭据",html: on}),- /* @__PURE__ */ (0, Q.jsx)(Ao, { receipt: t }),- /* @__PURE__ */ (0, Q.jsx)(ks, { receipt: t }),- e.entry_links ? /* @__PURE__ */ (0, Q.jsx)(Ds, {+ /* @__PURE__ */ (0, Q.jsx)(ko, { receipt: t }),+ /* @__PURE__ */ (0, Q.jsx)(Os, { receipt: t }),+ e.entry_links ? /* @__PURE__ */ (0, Q.jsx)(Es, {initial: e.entry_links,receipt: t}) : null@@ -5689,7 +5636,7 @@ function Ns({ data: e, receipt: t, panel: n, issues: r }) {});}// src/react/settings/configuration-shape.ts-function Ps(e) {+function Ns(e) {let t = e.downloads;if (!t) return null;let n = t.media_sources ?? [];@@ -5702,7 +5649,7 @@ function Ps(e) {browserLogin: t.pikpak_browser.available};}-function Fs(e) {+function Ps(e) {let t = e.tunnel;return {port: !!(e.editable && e.port_editable !== !1),@@ -5716,7 +5663,7 @@ function Fs(e) {tunnelNote: !!(t && (!t.available || t.state === "starting" || t.state === "running" && t.url))};}-function Is(e) {+function Fs(e) {let t = e.updates, n = e.update_job?.state ?? "idle", r = !t || t.state === "unchecked" && !t.checked_at && n === "idle", i = +!!t?.package_kind + (r ? 0 : +!!t?.checked_at + (t?.state === "unchecked" ? 0 : 1) + (n === "idle" ? 0 : 1)), a = e.automatic_updates, o = e.storage;return {releaseFacts: t?.package_kind ? 5 : 4,@@ -5737,12 +5684,12 @@ function Is(e) {};}// src/react/settings/configuration-page.tsx-function Ls({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r }) {+function Is({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r }) {let i = X({queryKey: Ze,queryFn: ({ signal: e }) => un(e)}), a = i.data;- return a ? /* @__PURE__ */ (0, Q.jsx)(Bs, {+ return a ? /* @__PURE__ */ (0, Q.jsx)(zs, {data: a,receipt: e,reopenTutorial: t,@@ -5761,7 +5708,7 @@ function Ls({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r })})});}-function Rs({ data: e, sections: t, reload: n, refreshing: r }) {+function Ls({ data: e, sections: t, reload: n, refreshing: r }) {return /* @__PURE__ */ (0, Q.jsx)(Q.Fragment, { children: t.map((t) => {let i = e.section_errors?.[t];return i ? /* @__PURE__ */ (0, Q.jsx)(F, {@@ -5778,14 +5725,14 @@ function Rs({ data: e, sections: t, reload: n, refreshing: r }) {}, t) : null;}) });}-var zs = 0;-function Bs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i, reload: a, refreshing: o }) {- let [s] = (0, Z.useState)(() => `board-tabs-${++zs}`), [c, l] = (0, Z.useState)(r), u = (0, Z.useRef)(null), d = (0, Z.useRef)(c);+var Rs = 0;+function zs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i, reload: a, refreshing: o }) {+ let [s] = (0, Z.useState)(() => `board-tabs-${++Rs}`), [c, l] = (0, Z.useState)(r), u = (0, Z.useRef)(null), d = (0, Z.useRef)(c);(0, Z.useEffect)(() => {l(r);}, [r]), (0, Z.useEffect)(() => {- let t = Ps(e);- t && An("downloads", t), An("network", Fs(e)), An("maintenance", Is(e));+ let t = Ns(e);+ t && An("downloads", t), An("network", Ps(e)), An("maintenance", Fs(e));}, [e]), (0, Z.useLayoutEffect)(() => {if (d.current === c) return;d.current = c;@@ -5809,7 +5756,7 @@ function Bs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: ilet h = (0, Z.useRef)([]), g = {data: e,receipt: t- }, _ = (t) => /* @__PURE__ */ (0, Q.jsx)(Rs, {+ }, _ = (t) => /* @__PURE__ */ (0, Q.jsx)(Ls, {data: e,sections: t,reload: a,@@ -5831,15 +5778,15 @@ function Bs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i"library_count","mount_dependencies"]),- !e.section_errors?.media_sources && !e.section_errors?.library_count ? /* @__PURE__ */ (0, Q.jsx)(wo, { ...g }) : null,- /* @__PURE__ */ (0, Q.jsx)(Vo, { receipt: t }),- /* @__PURE__ */ (0, Q.jsx)(Po, { receipt: t })+ !e.section_errors?.media_sources && !e.section_errors?.library_count ? /* @__PURE__ */ (0, Q.jsx)(Co, { ...g }) : null,+ /* @__PURE__ */ (0, Q.jsx)(Bo, { receipt: t }),+ /* @__PURE__ */ (0, Q.jsx)(No, { receipt: t })]})},{title: "来源与订阅",- body: (e) => /* @__PURE__ */ (0, Q.jsx)(Ns, {+ body: (e) => /* @__PURE__ */ (0, Q.jsx)(Ms, {...g,panel: e,issues: _(["entry_links"])@@ -5856,7 +5803,7 @@ function Bs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i}] : [],...y ? [{title: "网络与访问",- body: (e) => /* @__PURE__ */ (0, Q.jsx)(vs, {+ body: (e) => /* @__PURE__ */ (0, Q.jsx)(_s, {...g,panel: e,issues: _(v)@@ -5878,9 +5825,9 @@ function Bs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i"automatic_updates","facts"]),- /* @__PURE__ */ (0, Q.jsx)(Ha, { ...g }),- /* @__PURE__ */ (0, Q.jsx)(Fo, { receipt: t }),- /* @__PURE__ */ (0, Q.jsx)(Aa, {+ /* @__PURE__ */ (0, Q.jsx)(Va, { ...g }),+ /* @__PURE__ */ (0, Q.jsx)(Po, { receipt: t }),+ /* @__PURE__ */ (0, Q.jsx)(Ta, {...g,reopenTutorial: n})@@ -5941,6 +5888,6 @@ function Bs({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i})] }, e))]});}-export { Ls as ConfigurationPage };+export { Is as ConfigurationPage };-//# debugId=7e29bc25-ab84-42e6-a136-b98eb873a38a\ No newline at end of file+//# debugId=291b0207-ad40-4fe7-a5a3-8833eac94686\ No newline at end of filediff --git a/web/dist/peach-app.js b/web/dist/peach-app.jsindex 5d2892795..233339876 100644--- a/web/dist/peach-app.js+++ b/web/dist/peach-app.js@@ -2,7 +2,7 @@(function() {try {var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "38045cab-6795-40b1-ae22-15017c259c77", e._sentryDebugIdIdentifier = "sentry-dbid-38045cab-6795-40b1-ae22-15017c259c77");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "6d777f29-3941-4756-9fe4-adf2e70c29f7", e._sentryDebugIdIdentifier = "sentry-dbid-6d777f29-3941-4756-9fe4-adf2e70c29f7");} catch {}})();var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {@@ -79370,7 +79370,7 @@ async function w6(e, t) {if (n.status === "rejected") throw n.reason;}var T6 = C6(() => import("./peach-app.jav-page-CvsnSwyE.js")), E6 = C6(() => import("./peach-app.stats-page-Domc7MK7.js")), D6 = C6(() => import("./peach-app.taste-page-DBsNS6-3.js")), O6 = C6(() => import("./peach-app.review-page-DL1KGdJQ.js")), k6 = C6(() => import("./peach-app.data-cleanup-page-CZOBqkVd.js")), A6 = C6(() => import("./peach-app.duplicates-page-BHkh7UmS.js")), j6 = C6(() => import("./peach-app.quality-goals-page-Deoy7rhD.js")), M6 = C6(() => import("./peach-app.scraping-page-C4xFEKWF.js")), N6 = C6(async () => {- let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-tx87-zps.js"), import("./peach-app.diagnostics-page-DS1L_wLs.js")]);+ let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-DnmSyP33.js"), import("./peach-app.diagnostics-page-DS1L_wLs.js")]);return {ConfigurationPage: e,DiagnosticsPage: t@@ -84616,4 +84616,4 @@ if (!HBe) throw Error("主界面宿主缺失");VBe(HBe);export { VL as $2ec61d1d4f780267$export$a8a3e93435678ff9, YL as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, lz as $542a13ca2fa5b484$export$5b6b19405a83ff9d, CD as $72abaeab4d80592f$export$78efe591171d7d45, tB as $76d00c5a4edb230a$export$76ccd210b9029917, Qz as $76d00c5a4edb230a$export$816b5d811295e6bc, iB as $76d00c5a4edb230a$export$b59bdbef9ce70de2, oB as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, Zz as $76d00c5a4edb230a$export$f850895b287ef28e, Ghe as $b4f18e3395fe64d7$export$3d96ec278d3efce4, Whe as $b4f18e3395fe64d7$export$3e41faf802a29e71, Vhe as $b4f18e3395fe64d7$export$b2539bed5023c21c, uB as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, Jhe as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, uE as $ea3928288112382f$export$439d29a4e110a164, Sz as $f2ff30fde7b014be$export$3ddf2d174ce01153, kz as $fe21c36db05242bb$export$a98f0dcb43a68a25, Az as $fe21c36db05242bb$export$d7b12c4107be0d61, jge as $l, Gj as ACCENTS, zAe as AMANE_BRIDGE_CHECK_URL, j$ as AMANE_BRIDGE_KEY, BAe as AMANE_BRIDGE_REBUILD_URL, sr as ApiError, WU as ArtSlot, x2 as BATCH_DELETE_TEXT, J as Button, yL as ButtonLink, HB as Bx, o$ as CLEANUP_ENTRY, a$ as CLEANUP_ENTRY_GRID, Zf as CLEANUP_HASH_REDIRECTS, Yf as CLEANUP_TOOLS, vn as CLOUD_LOCATIONS, q1 as CLOUD_PROXY_HELP, Kr as COLUMN_SORT, J$ as CONFIGURATION_KEY, BY as CONFIGURATION_URL, VAe as COOKIE_TEXT_LIMIT, A$ as COVER_JOB_KEY, Yi as CREDENTIAL_STATE, E$ as CUSTOM_SOURCES_KEY, T$ as CUSTOM_SOURCES_URL, iG as CatalogViewToggle, IV as Checkbox, FV as CheckboxGlyph, EV as ChevronSortDown, UU as Chip, $U as CloudDownloadDialog, AH as CollapseChevron, kH as CollapseRegion, $Q as CollectionSummary, bve as CommandSteps, vTe as DEFAULT_CATEGORY, dr as DEFAULT_SORT, TQ as DIAGNOSTICS_KEY, _Ee as DIRECTORY_TEMPLATE_ERROR, oW as DISCOVERY_SORTS, KU as DOWNLOADS_KEY, GU as DOWNLOADS_URL, oY as DUPLICATES_KEY, BJ as DataTableFooter, IJ as DataTableFrame, zJ as DataTableSort, IH as Disclosure, Dye as DownloadsPanel, bge as E3, yTe as ENTITY_REVIEW_KINDS, G1 as ENTRY_LINKS_HELP, K1 as ENTRY_LINKS_HINT, PB as Ea, i_e as EmptyFocusButton, cV as EmptyState, PH as ErrorText, Jge as Eu, xve as ExternalLink, Vr as FEEDS_KEY, JY as FEED_SCHEDULE_KEY, r$ as FIELDSET_FOOT, gIe as FLOW_LABEL_X, t6 as FLOW_VIEWBOX, zr as FOLLOW_CHECK_KEY, Rr as FOLLOW_CREDENTIALS_KEY, R8 as FOLLOW_INITIAL_RANGE_OPTIONS, Lr as FOLLOW_MANAGE_KEY, OZ as FOLLOW_MANAGE_NAV, Br as FOLLOW_RESOLVE_KEY, qY as FOLLOW_SCHEDULE_KEY, wve as Fact, Cve as FactList, FH as FieldLabel, g$ as Fieldset, h$ as FieldsetTitle, zpe as FilterGlass, fL as FilterGlassRows, dL as FilterIconButton, pL as FilterPill, yve as Footer, zB as Gg, mL as GlassPill, KB as HN, NH as Help, $B as HintText, cIe as IDLE_POLL_MS, sTe as IDLE_REPAIR, sL as IconButton, DQ as IndexSearch, iV as Input, rV as InputBase, v$ as IssueRow, lM as JAV_LAYOUTS, B0 as JAV_RECOMMENDATION_GRID, yX as JUNK_KEY, hW as JavHeader, tTe as KEEP_LABELS, uge as L1, Ur as LAYOUTS, W1 as LIBRARY_FOLDER_HELP, YV as LIBRARY_PROCESSING_KEY, MY as LINKS_KEY, NY as LINK_CHECK_KEY, UTe as LINK_KINDS, PY as LINK_PRUNE_KEY, nr as LOC, QB as Label, x$ as LibraryProcessingCard, TV as LibraryShortcuts, dH as LinkButton, Nge as Lo, wH as LoadingDots, Sge as M6, JTe as MEDIA_PROCESSING_KEY, XY as MEDIA_PROCESSING_URL, dY as MEDIA_REPAIR_KEY, uY as MEDIA_REPAIR_URL, yr as MEDIA_SOURCES_KEY, _s as MEDIA_SOURCE_ICONS, gn as MEDIA_SOURCE_OPTIONS, AV as MENU_ITEM, jV as MENU_ITEM_INTERACTIVE, kV as MENU_POPOVER_SURFACE, Fge as Ma, hH as MenuDialog, mK as MixCard, aV as ModalFrame, xx as MotionConfigContext, XB as NR, _$ as NameLink, sV as Note, e_e as OA, $Y as ORGANIZE_KEY, v2 as ORGANIZE_PARAMETER_HINT, _2 as ORGANIZE_SCOPE_HINT, g2 as ORGANIZE_TEXT, nX as ORPHAN_RECORDS_KEY, b2 as ORPHAN_RECORDS_TEXT, LB as OV, SB as P7, gX as PERFORMER_DELETE_KEY, Iye as PHASES, VY as PICK_FOLDER_URL, c$ as PLAIN_STAT_STRIP, C$ as PLAYLISTS_KEY, rMe as POLICY_COLUMNS, aMe as POLICY_COVER_NOTE, iMe as POLICY_MATRIX, U1 as POLICY_SUMMARY, RJ as Pagination, b$ as PathLine, JB as Pf, II as PillTabList, sAe as PlainStat, EH as Progress, gY as QUALITY_GOALS_KEY, qB as RB, L0 as RELEASE_COLUMN_VISIBILITY_KEY, I0 as RELEASE_COLUMN_WIDTHS_KEY, sW as RELEASE_SORTS, NMe as RELEASE_SORT_COLUMNS, u$ as REPAIR_CARD_TEXT, fY as REPAIR_LIBRARIES_KEY, sX as RESOURCE_APPLY_KEY, oX as RESOURCE_SCAN_KEY, y2 as RESOURCE_SYNC_TEXT, pAe as RESULT_PANEL, mAe as RESULT_SECTION, _Te as REVIEW_CATEGORIES, vX as REVIEW_COUNTS_KEY, bTe as REVIEW_DECISION_LABELS, yY as REVIEW_KEY, bY as REVIEW_LABELS, SY as REVIEW_QUEUES, CY as REVIEW_QUEUE_LABELS, FG as RetryNote, Qge as Rf, ZB as Rk, gve as Rows, LAe as SCRAPING_CHECK_URL, O$ as SCRAPING_COVER_URL, k$ as SCRAPING_KEY, IAe as SCRAPING_SETTINGS_URL, nU as SEGMENT, tU as SEGMENTED_TRACK, KY as SETTINGS_KEY, HY as SETTINGS_URL, fr as SORT_DEFAULT_DIR, ur as SORT_OPTIONS, yn as SOURCE_LABELS, E3 as STATS_KEY, aAe as STAT_STRIP, oAe as STAT_STRIP_SIX, hve as Section, hAe as SectionHeading, vve as SectionSkeleton, eU as SegmentedRadioGroup, zve as SegmentedTabList, OG as Segments, LJ as Select, BU as Select$1, Q$ as SelectField, VU as SelectItem, qJ as SelectionActions, Cj as SelectionDock, JJ as SelectionPopover, jH as SettingsCard, mve as SettingsRow, MH as SettingsSectionLabel, kG as Shuffle, Ove as SiteLabel, oG as SortDirectionIcon, AG as SortKeys, cQ as SourceAvatar, BH as SourceLabel, LH as SourceMark, _ve as Stack, cAe as StatCard, y$ as StatusLabel, Yge as Su, i4 as Switch, GI as TASKS_KEY, ZFe as TASTE_REFRESH_KEY, QFe as TASTE_WINDOWS, YY as THUMBNAIL_JOBS_KEY, xX as TRASH_KEY, vpe as TRIGGER_LABELS, TJ as Table, YJ as TableColumnControls, XJ as TableColumnResizer, QJ as TableSelectionHeader, JQ as TagManager, Sve as TaskCenterLink, DH as TaskProgress, tV as TextField, eV as TextFieldContext, FB as Un, $ge as Uz, tW as WANTS_KEY, y4 as WantMagnets, qg as WithPromise, EB as Wt, NB as Xc, YB as Xf, OB as Xl, DB as Xt, wB as _8, o as __commonJSMin, s as __exportAll, l as __toESM, GB as _p, Zge as aB, Ei as addAlias, Ti as addSource, rW as addWant, uS as animate, B as apiGet, V as apiSend, rM as appSettingsStore, IEe as applyConfirmText, hX as applyLeftovers, FEe as applyPlanText, REe as applyText, sM as applyTheme, vy as asNumber, wEe as attachOrphan, ci as authorAvatar, ui as authorGroups, si as authorInitial, oi as authorName, pq as autoResetPageIndex, _o as avatarInner, M3 as bandRows, vEe as baseName, oTe as batchOperate, Pue as beginPlayerGuidePreview, Oj as boundedPreference, rTe as bulkCloudPreferences, fV as busyProps, Xge as cB, EPe as cachedMagnetStates, Vg as calcGeneratorVelocity, DTe as canApprove, vg as cancelFrame, kEe as candidateText, bU as cardClass, SM as cardRatio, NJ as catalogListSkeletonCellHtml, MB as cc, Gi as checkEvidenceGap, Wi as checkFailures, Fi as checkFeeds, qTe as checkLine, Hi as checkReceipt, Ui as checkSummary, UAe as checkText, Ki as checkedText, tK as clickedBlank, Z5 as closeDrawerAfterNav, Jwe as cloudLocations, w0 as cloudProxySkeleton, UC as clsx, Rge as cn, sv as collectMotionValues, Nq as columnVisibilityFeature, bJ as column_getCanSort, gJ as column_getSortFn, TTe as commonReviewSources, QU as composingKey, Af as configurationSection, nIe as configureTasteBrowser, ll as confirmModal, gpe as controlTask, YK as copyInstancePropertiesWithoutMemos, lo as coverUrl, wq as createColumnHelper, AAe as createPlaylist, Xi as credentialDone, b0 as credentialsSkeleton, ITe as currentReviewRow, q as cx, Cge as d6, VB as dZ, NTe as decisionPayload, PTe as decisionReceipt, MTe as defaultChoice, BEe as deletePerformerVideos, MAe as deletePlaylist, O0 as devicesSkeleton, x as diagnosticHeaders, H1 as diagnosticsSkeleton, Gye as discoveryArtwork, cW as discoveryKey, Hye as discoveryScore, u9 as disposeStage, $we as distinctName, Bi as dropSources, qge as du, iTe as duplicateVictims, QI as elapsedText, nn as entityDisplayName, go as entityFaceImg, Pn as entityPath, ti as errorHeadline, lr as errorMessage, z as esc, fq as expandRowModel, hB as f1, bo as facePos, ei as feedIntervalText, P$ as fetchAmaneBridge, vi as fetchCheckJob, Y$ as fetchConfiguration, N$ as fetchCoverJob, _i as fetchCredentials, D$ as fetchCustomSources, _X as fetchDeletePerformers, zEe as fetchDeletePlan, EQ as fetchDiagnostics, lW as fetchDiscoveries, cY as fetchDuplicates, fpe as fetchEarlier, ZTe as fetchFeedSchedule, Mi as fetchFeeds, gi as fetchFollow, XTe as fetchFollowSchedule, CX as fetchJunkSummary, rH as fetchLibraryProcessing, LY as fetchLinkCheck, RY as fetchLinkPrune, IY as fetchLinkStats, YTe as fetchMediaProcessing, pY as fetchMediaRepair, br as fetchMediaSources, eX as fetchOrganize, uEe as fetchOrganizeExample, rX as fetchOrphanRecords, ji as fetchPending, w$ as fetchPlaylists, _Y as fetchQualityGoals, fW as fetchReleases, mY as fetchRepairLibraries, yi as fetchResolveJob, lX as fetchResourceApply, cX as fetchResourceScan, kY as fetchReview, SX as fetchReviewCounts, ZY as fetchSettings, M$ as fetchSources, D3 as fetchStats, bi as fetchSuggestions, qI as fetchTasks, Q3 as fetchTaste, rIe as fetchTasteJob, QTe as fetchThumbnailJobs, wX as fetchTrashSummary, nW as fetchWants, CTe as filterReviewRows, er as firstGrapheme, jK as flexRender, vIe as flowGraph, yIe as flowLabel, _Fe as fmtCount, Jn as fmtDur, Xn as fmtSize, dpe as foldByKind, Ope as foldRoutine, Li as followFeedByName, Hr as followSuggestKey, Ape as followupDetail, upe as followupTally, _g as frame, bB as g4, Iq as getDefaultPaginationState, xM as gridLayout, li as groupByAuthor, Dpe as groupFollowups, EY as groupReviewRows, NEe as hasChanges, uX as hasResourceRoots, YI as hasResultProblems, lIe as historySpan, gB as i2, sIe as importTasteExport, x0 as indexersSkeleton, Lg as interpolate, aW as invalidateWants, ZI as isActive, $r as isBroken, qr as isLayout, vv as isMotionValue, xY as isReviewCategory, kpe as isRoutine, S0 as javBrowserSkeleton, H0 as javContentSkeleton, mM as javLayout, V0 as javTagSkeleton, GEe as junkBreakdown, Xwe as keepGroup, NAe as keepPlaylist, ke as keepPreviousData, pi as keepSelected, O3 as known, lge as l1, gge as l7, Epe as latestOfKind, $n as leadingGraphemes, kFe as lengthRows, Cr as localTime, po as logoUrl, Ii as lookupFeedActor, xB as m7, BB as mM, Dn as mapLimit, Ai as markItem, N3 as max, DFe as mediumRows, ppe as mergeFinished, P3 as min, VTe as mirrorText, uTe as missingToolText, lY as mixedCloudPreferences, nL as momentText, dS as motion, lv as motionValue, rn as nameFallback, Ue as notifyManager, wge as oe, bEe as organizeOutcome, i2 as overlayHost, Jr as pageSizeOf, fi as pageWindow, hr as paginationRange, zi as patchSource, Np as peachHistory, Np as peachHistory$1, jTe as pendingGenres, yFe as percentText, pEe as pickOrganizeFolder, s$ as plainStatClass, yEe as planSummary, k3 as playedFor, xFe as playedItemUrl, KI as pollInterval, Ys as popCount, kAe as posterUrl, vxe as previewLibraryColor, fEe as previewOrganize, pTe as previewUrl, wpe as problemDestination, QV as processingActive, $I as progressText, zH as providerIcon, KTe as pruneText, fX as purgeCount, TEe as purgeOrphan, UB as pv, Kge as qE, H as queryClient, _B as r2, hIe as radarRows, wFe as radialArc, TFe as radialBarSize, CFe as radialCeiling, SFe as radialSlices, LN as randomId, pIe as rankDetail, mIe as rankShares, j3 as reachedShare, eL as readableErrorHeadline, Uye as recommendationScore, LTe as recordGenre, DEe as recordsText, PAe as recreatePlaylist, DAe as refreshPlaylists, El as relayoutCovers, R0 as releaseColumns, uW as releaseFilters, dW as releaseKey, Vi as reloadFollowManage, BTe as reloadReview, cMe as rememberShape, hEe as rememberTemplates, Di as removeAlias, Pi as removeFeed, wi as removeSource, oIe as removeTasteSource, iW as removeWants, Oi as renameAliasGroup, jAe as renamePlaylist, Se as replaceEqualDeep, jFe as replayRows, re as require_jsx_runtime, A as require_react, N as require_react_dom, GK as require_with_selector, zye as resetWants, mr as resolveFollowSort, Wg as resolveStartTime, X_e as restartEffectText, OAe as resumeAssetId, STe as reviewGroupingOptions, TY as reviewQueueData, wY as reviewQueueOf, WEe as reviewSummary, wTe as reviewWindow, kTe as rowEvidence, OY as rowFieldName, Uq as rowPaginationFeature, uJ as rowSelectionFeature, CJ as rowSortingFeature, DY as rowSubject, ATe as rowTags, OTe as rowTitle, pge as s5, ki as saveCredential, PEe as scanLine, rEe as schedulePollInterval, Vye as searchNote, ETe as selectReviewRange, mi as selectionState, Ni as setFeedEnabled, Ci as setSourceEnabled, Pf as settingsPath, zTe as settleReviewRows, Qwe as sharedNamePrefix, Pp as shellNavigate, E8 as showToast, Bn as siteMarkUrl, rq as skipFirstRun, PI as sortCx, Xr as sortLabel, bn as sourceDefaultCost, Ji as sourceIconUrl, LEe as sourceMeta, Bs as spinnerHtml, Fg as spring, uV as spriteGlyph, xi as startCheck, WTe as startLinkCheck, GTe as startLinkPrune, mEe as startOrganize, Si as startResolve, jEe as startResourceApply, AEe as startResourceScan, aIe as startTasteRefresh, iAe as statCardClass, bpe as statusLabel, lTe as statusLine, Qr as statusText, CM as storeJavLayout, FTe as submitDecision, rL as summaryItems, Tq as tableFeatures, iq as tableMemo, di as tableRows, Cpe as taskIssues, Tpe as taskSubject, $3 as tasteDate, dIe as tasteDimensions, uIe as tasteHours, Z3 as tasteKey, eIe as tasteRefetchInterval, tIe as tasteTime, BI as textLang, F0 as tierPlaceholdersHtml, ch as time, kge as tl, hi as toggleGroup, e6 as topScores, Bge as um, Pge as uo, fH as useAction, CZ as useBackgroundJob, rG as useCatalogView, MU as useClientUpdates, bm as useConstant, iL as useEntityNames, uL as useHorizontalScroller, xm as useIsomorphicLayoutEffect, eK as useLibraryTints, It as useMutation, LV as useOverlayScrollbar, Ft as useQuery, ae as useQueryClient, $x as useReducedMotion, nEe as useRunSchedule, eEe as useSaveFollowSchedule, QY as useSaveSettings, iEe as useSaveThumbnailMode, wJ as useTable, UJ as useTablePreferences, _L as useViewGlide, aTe as victimBytes, Age as vl, Bye as wantName, bFe as watchNote, A3 as watchedShare, Ac as wireHorizontalScroller, gEe as withOrganizeJob, Wye as writeJavQuery, xge as z3 };-//# debugId=38045cab-6795-40b1-ae22-15017c259c77\ No newline at end of file+//# debugId=6d777f29-3941-4756-9fe4-adf2e70c29f7\ No newline at end of file