feat(ui): migrate to @recloudstudio/ui, add theme toggle and polish console UX

This commit is contained in:
RhenCloud committed 2026-10-03 22:54:32 +08:00
1 parent a899e16604
commit fbbff669a3
45 files changed
+1489 -1343

No files matched your search

+1
View File
@@ -24,6 +24,7 @@ FEISHU_APP_SECRET=your-app-secret
# Admin # Admin
ADMIN_USER_IDS=your-github-id,your-github-login ADMIN_USER_IDS=your-github-id,your-github-login
# DEBUG_MODE=true # local development only: bypasses all admin authentication
# ALLOW_SELF_SIGNUP=1 # non-admin GitHub users get a personal group on first login (default off) # ALLOW_SELF_SIGNUP=1 # non-admin GitHub users get a personal group on first login (default off)
# AUDIT_RETENTION_DAYS=90 # audit log retention for the scheduled cleanup (default 90) # AUDIT_RETENTION_DAYS=90 # audit log retention for the scheduled cleanup (default 90)
+6 -6
View File
@@ -9,8 +9,8 @@ Core pipeline: GitHub Webhook → Worker (verify + filter + format) → Discord
## Key Decisions ## Key Decisions
- Runtime: Cloudflare Workers via the Nitro `cloudflare_module` preset (`_worker.js`), H3 event handlers in `server/routes/` - Runtime: Cloudflare Workers via the Nitro `cloudflare_module` preset (`_worker.js`), H3 event handlers in `server/routes/`
- UI: Vue 3 + Tailwind CSS v4 (`@tailwindcss/vite`); admin console is a client-side SPA (`routeRules: "/admin/**": { ssr: false }`), home/legal pages render server-side - UI: Vue 3 + Tailwind CSS v4 (`@tailwindcss/vite`) + `@recloudstudio/ui` (Nuxt module, `Rc` prefix); admin console is a client-side SPA (`routeRules: "/admin/**": { ssr: false }`), home/legal pages render server-side
- Styling: all theme colors are RGB-triplet CSS variables in `app/assets/css/main.css` declared as `@theme inline` tokens (so `bg-accent/10` opacity modifiers work); the design tokens switch with `prefers-color-scheme` (unless `<html data-theme="light">`); repeated control patterns are `@apply` component classes in the CSS `@layer components` - Styling: ReCloud UI supplies semantic components and blue theme tokens; `app/assets/css/main.css` retains `--wh-*` RGB-triplet aliases for app-specific Tailwind utilities and bespoke layouts (avoiding collision with ReCloud's `--surface`/`--text`/`--border` hex tokens); theme switching supports auto/light/dark via `useTheme` / `ThemeToggle`, toggling `<html>.dark` with inline anti-flash head script
- Discord interactions: HTTPS Interactions Endpoint (`POST /discord/interactions`, Ed25519-signed) — no Discord Gateway / Durable Object; bot stays offline, messages always sent via REST - Discord interactions: HTTPS Interactions Endpoint (`POST /discord/interactions`, Ed25519-signed) — no Discord Gateway / Durable Object; bot stays offline, messages always sent via REST
- Storage: D1 is the source of truth for config (routes/groups via `d1_routes`/`d1_groups`, see `server/lib/storage/config-store.ts`), send/audit logs, dedup (`dedup_keys`), delivery state (`delivery_state`) and message tracking (`message_tracking` via `server/lib/storage/d1.ts` `canUseD1` gate). KV keeps only cache + short-lived/ephemeral state (tokens, OAuth state, admin sessions, `msg:*`-adjacent locks, per-group secrets `tenant:*`, invites, i18n overrides) with explicit TTLs. R2 parks oversized queue payloads (`webhooks/YYYY/MM/DD/*.json`, `server/lib/storage/payload.ts`) instead of KV. A `storage-prune` scheduled task cleans up expired dedup/delivery/message-tracking rows - Storage: D1 is the source of truth for config (routes/groups via `d1_routes`/`d1_groups`, see `server/lib/storage/config-store.ts`), send/audit logs, dedup (`dedup_keys`), delivery state (`delivery_state`) and message tracking (`message_tracking` via `server/lib/storage/d1.ts` `canUseD1` gate). KV keeps only cache + short-lived/ephemeral state (tokens, OAuth state, admin sessions, `msg:*`-adjacent locks, per-group secrets `tenant:*`, invites, i18n overrides) with explicit TTLs. R2 parks oversized queue payloads (`webhooks/YYYY/MM/DD/*.json`, `server/lib/storage/payload.ts`) instead of KV. A `storage-prune` scheduled task cleans up expired dedup/delivery/message-tracking rows
- Signature verification: Web Crypto API (HMAC-SHA256 for GitHub/Gitea, Ed25519 for Discord, timing-safe secret-token compare for Telegram) - Signature verification: Web Crypto API (HMAC-SHA256 for GitHub/Gitea, Ed25519 for Discord, timing-safe secret-token compare for Telegram)
@@ -18,7 +18,7 @@ Core pipeline: GitHub Webhook → Worker (verify + filter + format) → Discord
- Per-group webhook ingress: optional `POST /webhook/{groupId}` with a per-group secret in KV (`tenant:{groupId}`) — Gitea/classic-GitHub/custom webhooks are verified against the group's secret instead of the operator's global ones; only that group's routes fire. The legacy `POST /webhook` (global secrets, all routes) stays untouched - Per-group webhook ingress: optional `POST /webhook/{groupId}` with a per-group secret in KV (`tenant:{groupId}`) — Gitea/classic-GitHub/custom webhooks are verified against the group's secret instead of the operator's global ones; only that group's routes fire. The legacy `POST /webhook` (global secrets, all routes) stays untouched
- GitHub App tenant isolation: `Group.installationId` binds a group to one GitHub App installation; events whose `payload.installation.id` differs are rejected at dispatch (hard isolation on top of the optional `owners` list). The App's Setup URL points at `GET /auth/github/install`, which renders a choice page (create `inst-{installationId}` or bind to a group the signed-in user owns, verified by role); `POST /auth/github/install/bind` performs the provisioning. `installation.created` webhook events auto-provision as a fallback (create `inst-{installationId}` or bind existing groups whose `owners` match the installing account) - GitHub App tenant isolation: `Group.installationId` binds a group to one GitHub App installation; events whose `payload.installation.id` differs are rejected at dispatch (hard isolation on top of the optional `owners` list). The App's Setup URL points at `GET /auth/github/install`, which renders a choice page (create `inst-{installationId}` or bind to a group the signed-in user owns, verified by role); `POST /auth/github/install/bind` performs the provisioning. `installation.created` webhook events auto-provision as a fallback (create `inst-{installationId}` or bind existing groups whose `owners` match the installing account)
- GitHub OAuth: octokit (token is stored hashed for reverse lookup) - GitHub OAuth: octokit (token is stored hashed for reverse lookup)
- Admin WebUI: `/admin` config console, OAuth-session protected via `ADMIN_USER_IDS` whitelist; left sidebar navigation (Overview / Groups / Send Logs / Audit / Stats) + topbar, deep-linkable routes (`/admin` overview · `/admin/groups` · `/admin/logs` · `/admin/audit` · `/admin/metrics`); the overview dashboard (`AdminHome.vue`) aggregates delivery KPIs, a routes table and recent send logs; the stats page (`MetricsPanel.vue`) renders KPI cards plus per-platform/per-event ok/failed bar legends and a per-status breakdown, and filters by group (`?groupId=`); the route/group editors (`RouteEditor.vue` / `GroupEditor.vue`) are slide-in drawers with an eyebrow header and sectioned form bodies - Admin WebUI: `/admin` config console, OAuth-session protected via `ADMIN_USER_IDS` whitelist (local-only `DEBUG_MODE=true` bypasses authentication); left sidebar navigation (Overview / Groups / Send Logs / Audit / Stats) + topbar, deep-linkable routes (`/admin` overview · `/admin/groups` · `/admin/logs` · `/admin/audit` · `/admin/metrics`); the overview dashboard (`AdminHome.vue`) aggregates delivery KPIs, a routes table and recent send logs; the stats page (`MetricsPanel.vue`) renders KPI cards plus per-platform/per-event ok/failed bar legends and a per-status breakdown, and filters by group (`?groupId=`); the route/group editors (`RouteEditor.vue` / `GroupEditor.vue`) are centered, scrollable `RcDialog` forms with an eyebrow header and sectioned bodies
- Access control: every group has role-based members (`owner` / `admin` / `viewer`); super admins bypass; legacy `adminIds` are read as owners (backward compatible); owners manage members + invites; `owners` field stays super-only - Access control: every group has role-based members (`owner` / `admin` / `viewer`); super admins bypass; legacy `adminIds` are read as owners (backward compatible); owners manage members + invites; `owners` field stays super-only
- Invites: single-use 7-day links (`invite:{token}`) for joining a group as admin/viewer; `ALLOW_SELF_SIGNUP=1` gives access-less users a personal group on first login (self-service SaaS entry) - Invites: single-use 7-day links (`invite:{token}`) for joining a group as admin/viewer; `ALLOW_SELF_SIGNUP=1` gives access-less users a personal group on first login (self-service SaaS entry)
- Audit log: every admin operation (logins, group/route/member/invite changes) recorded in D1 `audit_logs`; pruned by the scheduled trigger after `AUDIT_RETENTION_DAYS` (default 90) - Audit log: every admin operation (logins, group/route/member/invite changes) recorded in D1 `audit_logs`; pruned by the scheduled trigger after `AUDIT_RETENTION_DAYS` (default 90)
@@ -34,7 +34,7 @@ Core pipeline: GitHub Webhook → Worker (verify + filter + format) → Discord
```text ```text
app/ # Vue 3 UI (Nuxt app dir) app/ # Vue 3 UI (Nuxt app dir)
├── app.vue # root component (NuxtPage) ├── app.vue # root component (NuxtPage)
├── assets/css/main.css # Tailwind v4 entry: @import "tailwindcss" + @theme inline tokens (RGB-triplet vars) + @layer components (@apply) + Vue transition glue ├── assets/css/main.css # Tailwind v4 entry: ReCloud-compatible RGB aliases + bespoke layout classes + Vue transition glue
├── pages/ # index (landing), terms, privacy, admin/[...slug] (console SPA) ├── pages/ # index (landing), terms, privacy, admin/[...slug] (console SPA)
├── components/ # ConsolePage (sidebar shell + topbar), AdminHome (overview dashboard), ├── components/ # ConsolePage (sidebar shell + topbar), AdminHome (overview dashboard),
│ # RouteCard/Editor (RouteEditor has FilterNodeEditor AST builder + TagInput chips), │ # RouteCard/Editor (RouteEditor has FilterNodeEditor AST builder + TagInput chips),
@@ -258,7 +258,7 @@ Rule: no functional change ships without its documentation; docs and code must n
- **D1 database**: Binding `DB` (database `webhooker`, id `214a0104-3235-47c0-b7bf-ddda95f3c8ac`) for `send_logs` + `audit_logs` + `discord_links` + `telegram_links` + `d1_groups` + `d1_routes` + `d1_fragments` + `dedup_keys` + `delivery_state` + `message_tracking` tables - **D1 database**: Binding `DB` (database `webhooker`, id `214a0104-3235-47c0-b7bf-ddda95f3c8ac`) for `send_logs` + `audit_logs` + `discord_links` + `telegram_links` + `d1_groups` + `d1_routes` + `d1_fragments` + `dedup_keys` + `delivery_state` + `message_tracking` tables
- **Queue**: optional `QUEUE` producer binding plus consumers `webhooker-delivery` and its DLQ `webhooker-delivery-dlq` (declared in `wrangler.jsonc`); when absent, webhook dispatch stays inline - **Queue**: optional `QUEUE` producer binding plus consumers `webhooker-delivery` and its DLQ `webhooker-delivery-dlq` (declared in `wrangler.jsonc`); when absent, webhook dispatch stays inline
- **R2**: optional `PAYLOAD` binding (bucket `webhooker-payloads`) for oversized queue payloads; without it, oversized payloads fall back to KV `queue:payload:*` - **R2**: optional `PAYLOAD` binding (bucket `webhooker-payloads`) for oversized queue payloads; without it, oversized payloads fall back to KV `queue:payload:*`
- **Access control**: `ADMIN_USER_IDS` (super admins), `ALLOW_SELF_SIGNUP` (optional personal group on first login), `AUDIT_RETENTION_DAYS` (default 90) — all plain env vars, not secrets - **Access control**: `ADMIN_USER_IDS` (super admins), `DEBUG_MODE=true` (local-only authentication bypass), `ALLOW_SELF_SIGNUP` (optional personal group on first login), `AUDIT_RETENTION_DAYS` (default 90) — all plain env vars, not secrets
- **Discord**: `DISCORD_PUBLIC_KEY` (Interactions Endpoint signature verification, from Discord Developer Portal) and `DISCORD_APPLICATION_ID` (optional, auto-resolved via `GET /oauth2/applications/@me` when omitted) are required for interactions - **Discord**: `DISCORD_PUBLIC_KEY` (Interactions Endpoint signature verification, from Discord Developer Portal) and `DISCORD_APPLICATION_ID` (optional, auto-resolved via `GET /oauth2/applications/@me` when omitted) are required for interactions
- **Telegram**: `TELEGRAM_TOKEN` (Bot API token from BotFather) required for Telegram routes; `TELEGRAM_WEBHOOK_SECRET` (optional secret token for `POST /telegram/webhook` verification); avatars are sent as a link-preview card via the built-in `GET /api/richheader` (overridable with `TELEGRAM_RICH_HEADER_HOST`) - **Telegram**: `TELEGRAM_TOKEN` (Bot API token from BotFather) required for Telegram routes; `TELEGRAM_WEBHOOK_SECRET` (optional secret token for `POST /telegram/webhook` verification); avatars are sent as a link-preview card via the built-in `GET /api/richheader` (overridable with `TELEGRAM_RICH_HEADER_HOST`)
- **Webhook providers**: `GITEA_WEBHOOK_SECRET` (required to receive Gitea webhooks; Gitea signs `X-Gitea-Signature` with the hex HMAC-SHA256 of the body) - **Webhook providers**: `GITEA_WEBHOOK_SECRET` (required to receive Gitea webhooks; Gitea signs `X-Gitea-Signature` with the hex HMAC-SHA256 of the body)
@@ -284,7 +284,7 @@ bunx wrangler deploy
Full list of secrets used: `GITHUB_WEBHOOK_SECRET`, `GITEA_WEBHOOK_SECRET`, Full list of secrets used: `GITHUB_WEBHOOK_SECRET`, `GITEA_WEBHOOK_SECRET`,
`GITHUB_APP_ID`, `GITHUB_PRIVATE_KEY` `GITHUB_APP_ID`, `GITHUB_PRIVATE_KEY`
(PKCS#8 PEM), `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, `DISCORD_TOKEN`, (PKCS#8 PEM), `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, `DISCORD_TOKEN`,
`DISCORD_PUBLIC_KEY`, `TELEGRAM_TOKEN`, `TELEGRAM_WEBHOOK_SECRET`, `ADMIN_USER_IDS`, `DISCORD_PUBLIC_KEY`, `TELEGRAM_TOKEN`, `TELEGRAM_WEBHOOK_SECRET`, `ADMIN_USER_IDS`, `DEBUG_MODE`,
plus optional `BASE_URL`, `DISCORD_APPLICATION_ID`, `TELEGRAM_RICH_HEADER_HOST`, plus optional `BASE_URL`, `DISCORD_APPLICATION_ID`, `TELEGRAM_RICH_HEADER_HOST`,
`NUXT_PUBLIC_DOCS_URL`, `NUXT_PUBLIC_REPO_URL`, `NUXT_PUBLIC_LEGAL_CONTACT`. See `.env.example` and `docs/guide/configuration.md`. `NUXT_PUBLIC_DOCS_URL`, `NUXT_PUBLIC_REPO_URL`, `NUXT_PUBLIC_LEGAL_CONTACT`. See `.env.example` and `docs/guide/configuration.md`.
+4 -1
View File
@@ -16,7 +16,7 @@ GitHub / Gitea webhook → Discord / Telegram / Feishu dispatcher. Receives webh
- `workflow_run` / `check_run` progress is edited **in place** (single message updated as the run advances) on Discord, Telegram, and Feishu — `check_run` tracks by check name + commit SHA so deployments that issue a fresh run id per phase (e.g. Cloudflare Pages) still edit the same message; `workflow_run` embeds a colored per-job code block (🟢 success, 🔴 failure, running/queued inline) - `workflow_run` / `check_run` progress is edited **in place** (single message updated as the run advances) on Discord, Telegram, and Feishu — `check_run` tracks by check name + commit SHA so deployments that issue a fresh run id per phase (e.g. Cloudflare Pages) still edit the same message; `workflow_run` embeds a colored per-job code block (🟢 success, 🔴 failure, running/queued inline)
- **Per-group webhook log channel** — point a group at a Discord channel/thread, Telegram chat/topic, or Feishu chat and every webhook the group's routes dispatch is summarized there (✅/❌ per route × target) - **Per-group webhook log channel** — point a group at a Discord channel/thread, Telegram chat/topic, or Feishu chat and every webhook the group's routes dispatch is summarized there (✅/❌ per route × target)
- GitHub OAuth for user actions (comment, edit comment, delete comment, merge, close, react) - GitHub OAuth for user actions (comment, edit comment, delete comment, merge, close, react)
- **Web UI config console** (`/admin`) — manage routes and groups with GitHub OAuth + admin whitelist, view send logs - **Web UI config console** (`/admin`) — ReCloud UI-based console with centered route/group dialogs; manage routes and groups with GitHub OAuth + admin whitelist, view send logs
- **Discord Interactions Endpoint** (Ed25519-verified) for `/gh` slash commands, message context-menu commands, PR merge/close buttons, and comment modals - **Discord Interactions Endpoint** (Ed25519-verified) for `/gh` slash commands, message context-menu commands, PR merge/close buttons, and comment modals
- **Telegram `/gh` commands** (login/logout/comment/merge/close) via the Telegram webhook, with avatar link-preview cards - **Telegram `/gh` commands** (login/logout/comment/merge/close) via the Telegram webhook, with avatar link-preview cards
- Cloudflare D1 for config (routes/groups), send logs, platform account links, dedup, delivery state and message tracking + KV for ephemeral state/cache/security tokens, + optional R2 for oversized payloads - Cloudflare D1 for config (routes/groups), send logs, platform account links, dedup, delivery state and message tracking + KV for ephemeral state/cache/security tokens, + optional R2 for oversized payloads
@@ -74,6 +74,7 @@ bunx wrangler dev # Start local dev server
| `FEISHU_APP_SECRET` | Feishu app secret — required for Feishu routes | | `FEISHU_APP_SECRET` | Feishu app secret — required for Feishu routes |
| `BASE_URL` | Public URL for OAuth callbacks and the Telegram webhook sync | | `BASE_URL` | Public URL for OAuth callbacks and the Telegram webhook sync |
| `ADMIN_USER_IDS` | Comma-separated GitHub user IDs (or logins) allowed to access `/admin` | | `ADMIN_USER_IDS` | Comma-separated GitHub user IDs (or logins) allowed to access `/admin` |
| `DEBUG_MODE` | Local development only: set to exact `true` to bypass all `/admin` authentication |
| `ALLOW_SELF_SIGNUP` | `1` to give access-less GitHub users a personal group on first login (default off) | | `ALLOW_SELF_SIGNUP` | `1` to give access-less GitHub users a personal group on first login (default off) |
| `AUDIT_RETENTION_DAYS` | Audit-log retention in days for the scheduled cleanup (default 90) | | `AUDIT_RETENTION_DAYS` | Audit-log retention in days for the scheduled cleanup (default 90) |
| `NUXT_PUBLIC_DOCS_URL` | Optional docs site URL used by the landing page | | `NUXT_PUBLIC_DOCS_URL` | Optional docs site URL used by the landing page |
@@ -112,6 +113,8 @@ The built-in config console lets you manage routes and groups in the browser (ad
2. Visit `/admin` and sign in with GitHub. Users with no access get `403` — unless `ALLOW_SELF_SIGNUP=1` (they receive a personal group) or they follow a group invite link. 2. Visit `/admin` and sign in with GitHub. Users with no access get `403` — unless `ALLOW_SELF_SIGNUP=1` (they receive a personal group) or they follow a group invite link.
3. Changes are written to D1 immediately, the config cache is invalidated, and the webhook pipeline picks them up on the next run. 3. Changes are written to D1 immediately, the config cache is invalidated, and the webhook pipeline picks them up on the next run.
For local-only debugging, `DEBUG_MODE=true` bypasses GitHub OAuth and grants full console access. Never set it in a deployed environment.
Sign out at `/admin/logout`. Every group has `members` with a role (`owner` / `admin` / `viewer`); all admin operations are recorded in the D1 `audit_logs` table. Sign out at `/admin/logout`. Every group has `members` with a role (`owner` / `admin` / `viewer`); all admin operations are recorded in the D1 `audit_logs` table.
### Filter Types ### Filter Types
+4 -1
View File
@@ -16,7 +16,7 @@ GitHub / Gitea webhook → Discord / Telegram / 飞书 分发服务。通过 Clo
- `workflow_run` / `check_run` 进度**原地编辑**同一条消息(运行推进时更新),Discord、Telegram 与飞书均支持 —— `check_run` 以 check 名 + commit SHA 追踪,因此每个阶段都换新 run id 的部署(如 Cloudflare Pages)仍会编辑同一条消息;`workflow_run` 内嵌带颜色的逐作业代码块(🟢 成功、🔴 失败、运行中/排队中不着色) - `workflow_run` / `check_run` 进度**原地编辑**同一条消息(运行推进时更新),Discord、Telegram 与飞书均支持 —— `check_run` 以 check 名 + commit SHA 追踪,因此每个阶段都换新 run id 的部署(如 Cloudflare Pages)仍会编辑同一条消息;`workflow_run` 内嵌带颜色的逐作业代码块(🟢 成功、🔴 失败、运行中/排队中不着色)
- **分组级 Webhook 日志频道** —— 为分组指定一个 Discord 频道/子区、Telegram 群组/话题或飞书群聊,该分组路由每次分发 webhook 都会向其中发送摘要(每条「路由 × 目标」一行,✅/❌ 结果) - **分组级 Webhook 日志频道** —— 为分组指定一个 Discord 频道/子区、Telegram 群组/话题或飞书群聊,该分组路由每次分发 webhook 都会向其中发送摘要(每条「路由 × 目标」一行,✅/❌ 结果)
- GitHub OAuth 用户授权(评论、编辑评论、删除评论、合并、关闭、反应) - GitHub OAuth 用户授权(评论、编辑评论、删除评论、合并、关闭、反应)
- **Web 配置控制台**(`/admin`)— 通过 GitHub OAuth + 管理员白名单管理路由与分组、查看发送日志 - **Web 配置控制台**(`/admin`)— 基于 ReCloud UI,使用居中路由/分组对话框;通过 GitHub OAuth + 管理员白名单管理路由与分组、查看发送日志
- **Discord Interactions Endpoint**(Ed25519 验签)支持 `/gh` 斜杠命令、消息右键菜单命令、PR 合并/关闭按钮与评论 modal - **Discord Interactions Endpoint**(Ed25519 验签)支持 `/gh` 斜杠命令、消息右键菜单命令、PR 合并/关闭按钮与评论 modal
- **Telegram `/gh` 命令**(login/logout/comment/merge/close),通过 Telegram webhook 接收,头像以链接预览卡片呈现 - **Telegram `/gh` 命令**(login/logout/comment/merge/close),通过 Telegram webhook 接收,头像以链接预览卡片呈现
- Cloudflare D1 存储配置(路由/分组)、发送日志、平台账号绑定、去重、投递状态与消息更新追踪 + KV 存储临时状态/缓存/安全令牌 + 可选 R2 存储超大负载 - Cloudflare D1 存储配置(路由/分组)、发送日志、平台账号绑定、去重、投递状态与消息更新追踪 + KV 存储临时状态/缓存/安全令牌 + 可选 R2 存储超大负载
@@ -74,6 +74,7 @@ bunx wrangler dev # 启动本地开发服务器
| `FEISHU_APP_SECRET` | 飞书应用密钥 —— 飞书路由必需 | | `FEISHU_APP_SECRET` | 飞书应用密钥 —— 飞书路由必需 |
| `BASE_URL` | 公网地址(用于 OAuth 回调与 Telegram webhook 同步) | | `BASE_URL` | 公网地址(用于 OAuth 回调与 Telegram webhook 同步) |
| `ADMIN_USER_IDS` | 允许访问 `/admin` 的 GitHub 用户 ID(或登录名),逗号分隔 | | `ADMIN_USER_IDS` | 允许访问 `/admin` 的 GitHub 用户 ID(或登录名),逗号分隔 |
| `DEBUG_MODE` | 仅本地开发:精确设为 `true` 时跳过全部 `/admin` 身份验证 |
| `ALLOW_SELF_SIGNUP` | 设为 `1` 时,无权限的 GitHub 用户首次登录自动获得个人分组(默认关闭) | | `ALLOW_SELF_SIGNUP` | 设为 `1` 时,无权限的 GitHub 用户首次登录自动获得个人分组(默认关闭) |
| `AUDIT_RETENTION_DAYS` | 定时清理时审计日志的保留天数(默认 90) | | `AUDIT_RETENTION_DAYS` | 定时清理时审计日志的保留天数(默认 90) |
| `NUXT_PUBLIC_DOCS_URL` | 可选;落地页使用的文档站点 URL | | `NUXT_PUBLIC_DOCS_URL` | 可选;落地页使用的文档站点 URL |
@@ -112,6 +113,8 @@ bunx wrangler dev # 启动本地开发服务器
2. 访问 `/admin` 并用 GitHub 登录。无任何权限的用户收到 `403`——除非开启 `ALLOW_SELF_SIGNUP=1`(自动获得个人分组)或通过分组邀请链接加入。 2. 访问 `/admin` 并用 GitHub 登录。无任何权限的用户收到 `403`——除非开启 `ALLOW_SELF_SIGNUP=1`(自动获得个人分组)或通过分组邀请链接加入。
3. 修改会立即写入 D1,配置缓存随之失效,webhook 管线随即生效。 3. 修改会立即写入 D1,配置缓存随之失效,webhook 管线随即生效。
仅限本地调试时,可设 `DEBUG_MODE=true` 跳过 GitHub OAuth 并获得完整控制台权限。部署环境切勿设置此变量。
在 `/admin/logout` 退出登录。每个分组都有带角色的 `members`(`owner` / `admin` / `viewer`);所有管理操作(登录、分组/路由/成员/邀请变更)都会写入 D1 `audit_logs` 表。 在 `/admin/logout` 退出登录。每个分组都有带角色的 `members`(`owner` / `admin` / `viewer`);所有管理操作(登录、分组/路由/成员/邀请变更)都会写入 D1 `audit_logs` 表。
### 过滤器类型 ### 过滤器类型
+118 -115
View File
@@ -1,10 +1,6 @@
@import "tailwindcss"; @import "tailwindcss";
/* --------------------------------------------------------------------------- /* ReCloud UI-compatible RGB aliases for app-specific Tailwind utilities. */
* Theme tokens — RGB triplets so Tailwind opacity modifiers (bg-accent/10)
* work against them; values switch automatically with prefers-color-scheme
* (unless an explicit data-theme="light" is set on <html>).
* ------------------------------------------------------------------------- */
@theme inline { @theme inline {
--font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
@@ -12,35 +8,34 @@
--radius: 12px; --radius: 12px;
--shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06); --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
--shadow-card-hover: 0 8px 24px -12px rgba(15, 23, 42, 0.25); --shadow-card-hover: 0 8px 24px -12px rgba(15, 23, 42, 0.25);
--shadow-accent-lg: 0 12px 28px -10px rgb(var(--accent)); --shadow-accent-lg: 0 12px 28px -10px rgb(var(--wh-accent));
--shadow-drawer: -16px 0 48px rgba(15, 23, 42, 0.12);
--shadow-modal: 0 12px 40px rgba(15, 23, 42, 0.25); --shadow-modal: 0 12px 40px rgba(15, 23, 42, 0.25);
--animate-rise: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; --animate-rise: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
--color-bg: rgb(var(--bg)); --color-bg: rgb(var(--wh-bg));
--color-surface: rgb(var(--surface)); --color-surface: rgb(var(--wh-surface));
--color-surface-2: rgb(var(--surface-2)); --color-surface-2: rgb(var(--wh-surface-2));
--color-surface-3: rgb(var(--surface-3)); --color-surface-3: rgb(var(--wh-surface-3));
--color-border: rgb(var(--border)); --color-border: rgb(var(--wh-border));
--color-border-strong: rgb(var(--border-strong)); --color-border-strong: rgb(var(--wh-border-strong));
--color-text: rgb(var(--text)); --color-text: rgb(var(--wh-text));
--color-muted: rgb(var(--muted)); --color-muted: rgb(var(--wh-muted));
--color-faint: rgb(var(--faint)); --color-faint: rgb(var(--wh-faint));
--color-accent: rgb(var(--accent)); --color-accent: rgb(var(--wh-accent));
--color-accent-strong: rgb(var(--accent-strong)); --color-accent-strong: rgb(var(--wh-accent-strong));
--color-accent-dim: rgb(var(--accent-dim)); --color-accent-dim: rgb(var(--wh-accent-dim));
--color-accent-text: rgb(var(--accent-text)); --color-accent-text: rgb(var(--wh-accent-text));
--color-accent-border: rgb(var(--accent-border)); --color-accent-border: rgb(var(--wh-accent-border));
--color-ok: rgb(var(--ok)); --color-ok: rgb(var(--wh-ok));
--color-ok-dim: rgb(var(--ok-dim)); --color-ok-dim: rgb(var(--wh-ok-dim));
--color-warn: rgb(var(--warn)); --color-warn: rgb(var(--wh-warn));
--color-warn-dim: rgb(var(--warn-dim)); --color-warn-dim: rgb(var(--wh-warn-dim));
--color-bad: rgb(var(--bad)); --color-bad: rgb(var(--wh-bad));
--color-bad-dim: rgb(var(--bad-dim)); --color-bad-dim: rgb(var(--wh-bad-dim));
--color-info: rgb(var(--info)); --color-info: rgb(var(--wh-info));
--color-info-dim: rgb(var(--info-dim)); --color-info-dim: rgb(var(--wh-info-dim));
--color-body-text: rgb(var(--body-text)); --color-body-text: rgb(var(--wh-body-text));
--color-code-bg: rgb(var(--code-bg)); --color-code-bg: rgb(var(--wh-code-bg));
} }
@keyframes rise { @keyframes rise {
@@ -56,72 +51,71 @@
:root { :root {
color-scheme: light; color-scheme: light;
--header-bg: rgba(255, 255, 255, 0.82); --wh-header-bg: rgba(255, 255, 255, 0.82);
--scrim: rgba(15, 23, 42, 0.4); --wh-scrim: rgba(15, 23, 42, 0.4);
--knob: #ffffff; --wh-knob: #ffffff;
--dot: rgba(15, 23, 42, 0.05); --wh-dot: rgba(15, 23, 42, 0.05);
--shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06); --wh-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
--bg: 246 247 249; --wh-bg: 248 250 252;
--surface: 255 255 255; --wh-surface: 255 255 255;
--surface-2: 243 244 246; --wh-surface-2: 248 250 252;
--surface-3: 236 238 242; --wh-surface-3: 241 245 249;
--border: 230 232 236; --wh-border: 226 232 240;
--border-strong: 212 216 222; --wh-border-strong: 203 213 225;
--text: 15 23 42; --wh-text: 15 23 42;
--muted: 91 100 114; --wh-muted: 71 85 105;
--faint: 154 163 178; --wh-faint: 100 116 139;
--accent: 79 70 229; --wh-accent: 37 99 235;
--accent-strong: 67 56 202; --wh-accent-strong: 29 78 216;
--accent-dim: 238 242 255; --wh-accent-dim: 239 246 255;
--accent-text: 55 48 163; --wh-accent-text: 30 64 175;
--accent-border: 224 231 255; --wh-accent-border: 191 219 254;
--ok: 22 163 74; --wh-ok: 22 163 74;
--ok-dim: 236 253 243; --wh-ok-dim: 240 253 244;
--warn: 180 83 9; --wh-warn: 217 119 6;
--warn-dim: 254 243 199; --wh-warn-dim: 255 251 235;
--bad: 220 38 38; --wh-bad: 220 38 38;
--bad-dim: 254 242 242; --wh-bad-dim: 254 242 242;
--info: 37 99 235; --wh-info: 37 99 235;
--info-dim: 239 246 255; --wh-info-dim: 239 246 255;
--body-text: 48 54 61; --wh-body-text: 48 54 61;
--code-bg: 240 241 243; --wh-code-bg: 240 241 243;
} }
@media (prefers-color-scheme: dark) { :root.dark,
:root:not([data-theme="light"]) { :root[data-theme="dark"] {
color-scheme: dark; color-scheme: dark;
--header-bg: rgba(15, 20, 28, 0.82); --wh-header-bg: rgba(15, 20, 28, 0.82);
--scrim: rgba(2, 6, 12, 0.6); --wh-scrim: rgba(2, 6, 12, 0.6);
--knob: #dfe4ee; --wh-knob: #dfe4ee;
--dot: rgba(148, 163, 184, 0.08); --wh-dot: rgba(148, 163, 184, 0.08);
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5); --wh-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
--bg: 11 15 23; --wh-bg: 2 6 23;
--surface: 19 26 36; --wh-surface: 15 23 42;
--surface-2: 26 34 48; --wh-surface-2: 30 41 59;
--surface-3: 35 45 61; --wh-surface-3: 51 65 85;
--border: 39 49 67; --wh-border: 51 65 85;
--border-strong: 56 70 96; --wh-border-strong: 71 85 105;
--text: 230 233 239; --wh-text: 241 245 249;
--muted: 154 166 184; --wh-muted: 148 163 184;
--faint: 107 119 137; --wh-faint: 100 116 139;
--accent: 99 102 241; --wh-accent: 96 165 250;
--accent-strong: 129 140 248; --wh-accent-strong: 147 197 253;
--accent-dim: 28 33 64; --wh-accent-dim: 30 58 138;
--accent-text: 199 210 254; --wh-accent-text: 191 219 254;
--accent-border: 47 55 102; --wh-accent-border: 30 64 175;
--ok: 34 197 94; --wh-ok: 34 197 94;
--ok-dim: 16 36 26; --wh-ok-dim: 16 36 26;
--warn: 251 191 36; --wh-warn: 251 191 36;
--warn-dim: 42 36 16; --wh-warn-dim: 42 36 16;
--bad: 240 82 82; --wh-bad: 240 82 82;
--bad-dim: 42 22 24; --wh-bad-dim: 42 22 24;
--info: 59 130 246; --wh-info: 59 130 246;
--info-dim: 23 37 84; --wh-info-dim: 23 37 84;
--body-text: 195 202 214; --wh-body-text: 195 202 214;
--code-bg: 26 34 48; --wh-code-bg: 26 34 48;
}
} }
@layer base { @layer base {
@@ -140,7 +134,7 @@
inset: 0; inset: 0;
z-index: 0; z-index: 0;
pointer-events: none; pointer-events: none;
background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-image: radial-gradient(var(--wh-dot) 1px, transparent 1px);
background-size: 22px 22px; background-size: 22px 22px;
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 40%); mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 40%);
} }
@@ -154,7 +148,7 @@
.header { .header {
@apply sticky top-0 z-20 flex items-center justify-between gap-4 px-8 py-3.5 border-b border-border; @apply sticky top-0 z-20 flex items-center justify-between gap-4 px-8 py-3.5 border-b border-border;
background: var(--header-bg); background: var(--wh-header-bg);
backdrop-filter: blur(12px); backdrop-filter: blur(12px);
} }
@@ -426,7 +420,7 @@
width: 16px; width: 16px;
height: 16px; height: 16px;
border-radius: 50%; border-radius: 50%;
background: var(--knob); background: var(--wh-knob);
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
transition: transform 0.18s; transition: transform 0.18s;
} }
@@ -506,19 +500,38 @@
@apply rounded-[5px] bg-accent-dim px-1.5 py-px font-mono text-accent; @apply rounded-[5px] bg-accent-dim px-1.5 py-px font-mono text-accent;
} }
/* ---- Drawer / overlay ---- */ /* ---- Modal editors (RcDialog wrapper) ---- */
.overlay { .editor-dialog {
@apply fixed inset-0 z-40 backdrop-blur-[2px]; display: flex !important;
background: var(--scrim); flex-direction: column !important;
gap: 0 !important;
max-height: calc(100dvh - 2rem) !important;
overflow: hidden !important;
padding: 0 !important;
} }
.editor { .editor-dialog > div:first-child {
@apply fixed bottom-0 right-0 top-0 z-50 flex w-[min(520px,100vw)] flex-col border-l border-border bg-surface shadow-drawer; margin-bottom: 0 !important;
flex-shrink: 0 !important;
}
.editor-dialog > div:nth-child(2) {
flex: 1 1 0% !important;
min-height: 0 !important;
display: flex !important;
flex-direction: column !important;
padding: 0 !important;
}
.editor-dialog > div:nth-child(3) {
margin-top: 0 !important;
flex-shrink: 0 !important;
padding: 0 !important;
} }
.editor-head { .editor-head {
@apply flex items-center justify-between gap-3 border-b border-border px-6 py-4; @apply flex items-center justify-between gap-3 border-b border-border px-6 py-4;
background: var(--header-bg); background: var(--wh-header-bg);
backdrop-filter: blur(12px); backdrop-filter: blur(12px);
} }
@@ -541,7 +554,7 @@
.editor-body { .editor-body {
@apply flex-1 overflow-y-auto px-6 py-5; @apply flex-1 overflow-y-auto px-6 py-5;
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: var(--scrim) transparent; scrollbar-color: var(--wh-scrim) transparent;
} }
.editor-section { .editor-section {
@@ -972,7 +985,7 @@
.modal-overlay { .modal-overlay {
@apply fixed inset-0 z-[60] flex items-center justify-center p-6 backdrop-blur-[2px]; @apply fixed inset-0 z-[60] flex items-center justify-center p-6 backdrop-blur-[2px];
background: var(--scrim); background: var(--wh-scrim);
} }
.detail-head { .detail-head {
@@ -1264,13 +1277,3 @@
.fade-leave-to { .fade-leave-to {
opacity: 0; opacity: 0;
} }
.slide-enter-active,
.slide-leave-active {
transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.slide-enter-from,
.slide-leave-to {
transform: translateX(100%);
}
+40 -168
View File
@@ -1,6 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { DeliveryMetrics, Group, Route, SendRecord } from "~/types"; import type { DeliveryMetrics, Group, SendRecord } from "~/types";
import { collectEvents } from "~/composables/useFilterNode";
const props = defineProps<{ const props = defineProps<{
groups: Group[]; groups: Group[];
@@ -14,39 +13,6 @@ const props = defineProps<{
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const routesByGroup = ref<Record<string, Route[]>>({});
const routesLoading = ref(false);
const allRoutes = computed(() => {
const out: Array<Route & { group?: Group }> = [];
for (const g of props.groups) {
for (const r of routesByGroup.value[g.id] ?? []) out.push({ ...r, group: g });
}
return out;
});
async function loadRoutes() {
if (!props.groups.length) return;
routesLoading.value = true;
const entries = await Promise.all(
props.groups.map(async (g) => {
try {
const data = await apiFetch<{ routes?: Route[] }>(
`/admin/api/groups/${encodeURIComponent(g.id)}/routes`,
);
return [g.id, data.routes ?? []] as const;
} catch {
return [g.id, []] as const;
}
}),
);
routesByGroup.value = Object.fromEntries(entries);
routesLoading.value = false;
}
onMounted(loadRoutes);
watch(() => props.groups, loadRoutes);
const kpis = computed(() => { const kpis = computed(() => {
const m = props.metrics; const m = props.metrics;
const total = m?.total ?? 0; const total = m?.total ?? 0;
@@ -102,24 +68,13 @@ function fmtTime(ts: number): string {
if (d < 86_400_000) return `${Math.round(d / 3_600_000)}h`; if (d < 86_400_000) return `${Math.round(d / 3_600_000)}h`;
return `${Math.round(d / 86_400_000)}d`; return `${Math.round(d / 86_400_000)}d`;
} }
function platformLabel(p?: string): string {
if (p === "telegram") return "TG";
if (p === "feishu") return "FS";
if (p === "discord") return "DC";
return "—";
}
function routeEvents(r: Route): string[] {
return collectEvents(r.ast ?? { all: r.filters });
}
</script> </script>
<template> <template>
<div class="space-y-6"> <div class="space-y-6">
<!-- KPI cards --> <!-- KPI cards -->
<section class="grid grid-cols-2 gap-4 xl:grid-cols-4"> <section class="grid grid-cols-2 gap-4 xl:grid-cols-4">
<div v-for="k in kpis" :key="k.label" class="rounded border border-border bg-surface p-5"> <RcCard v-for="k in kpis" :key="k.label" variant="outline" padding="md" class="p-5">
<div class="text-[11px] font-bold uppercase tracking-[1.5px] text-faint">{{ k.label }}</div> <div class="text-[11px] font-bold uppercase tracking-[1.5px] text-faint">{{ k.label }}</div>
<div <div
class="mt-2 text-2xl font-extrabold tracking-tight [font-variant-numeric:tabular-nums]" class="mt-2 text-2xl font-extrabold tracking-tight [font-variant-numeric:tabular-nums]"
@@ -127,132 +82,49 @@ function routeEvents(r: Route): string[] {
> >
{{ metricsLoading ? "—" : k.value }} {{ metricsLoading ? "—" : k.value }}
</div> </div>
</div> </RcCard>
</section> </section>
<div class="grid grid-cols-1 gap-6 xl:grid-cols-3"> <!-- Recent send logs -->
<!-- Routes overview --> <RcCard variant="outline" padding="none">
<section class="rounded border border-border bg-surface xl:col-span-2"> <div class="flex items-center justify-between border-b border-border px-5 py-4">
<div class="flex items-center justify-between border-b border-border px-5 py-4"> <h2 class="text-sm font-bold tracking-tight">{{ t("overview.recent") }}</h2>
<h2 class="text-sm font-bold tracking-tight">{{ t("overview.routes") }}</h2> <RcButton variant="link" size="xs" @click="router.replace('/admin/logs')">
<span class="text-xs text-faint [font-variant-numeric:tabular-nums]">{{ {{ t("overview.viewAll") }}
allRoutes.length </RcButton>
}}</span> </div>
</div>
<div v-if="routesLoading" class="px-5 py-12 text-center text-faint"> <div v-if="logsLoading" class="flex justify-center px-5 py-12 text-faint">
{{ t("status.loading") }} <RcSpinner size="sm" />
</div> </div>
<div v-else-if="!allRoutes.length" class="px-5 py-12 text-center text-muted"> <RcEmptyState v-else-if="!logs.length" :title="t('metrics.empty')" class="px-5 py-12" />
<p class="mb-3">{{ t("routes.emptyGroup") }}</p>
<button class="btn btn-accent btn-sm" @click="router.replace('/admin/groups')">
{{ t("routes.createFirst") }}
</button>
</div>
<div v-else class="overflow-x-auto"> <ul v-else class="divide-y divide-border">
<table class="w-full min-w-[560px] text-left text-[13px]"> <li
<thead> v-for="log in logs.slice(0, 10)"
<tr :key="log.id ?? `${log.ts}-${log.target}`"
class="border-b border-border text-[10px] font-bold uppercase tracking-[1.2px] text-faint" class="flex items-center gap-3 px-5 py-3"
>
<span class="dot" :class="log.ok ? 'ok' : 'bad'" />
<div class="min-w-0 flex-1">
<div class="flex items-center gap-2">
<RcBadge
variant="soft"
size="xs"
class="uppercase tracking-wide"
:class="eventBadge(log.event)"
> >
<th class="px-5 py-2.5">Route</th> {{ log.event }}
<th class="px-3 py-2.5">Group</th> </RcBadge>
<th class="px-3 py-2.5">Events</th> <span class="truncate text-[12px] text-muted">{{ log.repo || log.target }}</span>
<th class="px-3 py-2.5">Targets</th>
<th class="px-5 py-2.5 text-right">State</th>
</tr>
</thead>
<tbody>
<tr
v-for="r in allRoutes.slice(0, 8)"
:key="r.id"
class="cursor-pointer border-b border-border transition-colors last:border-0 hover:bg-surface-2"
@click="router.replace('/admin/groups')"
>
<td class="px-5 py-3">
<div class="font-semibold text-text">{{ r.name || r.id }}</div>
<div class="font-mono text-[11px] text-faint">{{ r.id }}</div>
</td>
<td class="px-3 py-3 text-muted">{{ r.group?.name || "—" }}</td>
<td class="px-3 py-3">
<div class="flex flex-wrap gap-1">
<span
v-for="ev in routeEvents(r).slice(0, 2)"
:key="ev"
class="rounded-full bg-accent-dim px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-accent"
>
{{ ev }}
</span>
<span v-if="routeEvents(r).length > 2" class="text-[10px] text-faint">
+{{ routeEvents(r).length - 2 }}
</span>
</div>
</td>
<td class="px-3 py-3">
<div class="flex items-center gap-1">
<span
v-for="tg in r.targets.slice(0, 3)"
:key="tg.channelId ?? tg.chatId ?? platformLabel(tg.platform)"
class="rounded border border-border bg-surface-2 px-1.5 py-0.5 font-mono text-[10px] text-muted"
>
{{ platformLabel(tg.platform) }}
</span>
<span v-if="r.targets.length > 3" class="text-[10px] text-faint">
+{{ r.targets.length - 3 }}
</span>
</div>
</td>
<td class="px-5 py-3 text-right">
<span class="dot" :class="r.enabled ? 'ok' : 'bad'" />
</td>
</tr>
</tbody>
</table>
</div>
</section>
<!-- Recent send logs -->
<section class="rounded border border-border bg-surface">
<div class="flex items-center justify-between border-b border-border px-5 py-4">
<h2 class="text-sm font-bold tracking-tight">{{ t("overview.recent") }}</h2>
<button class="text-xs font-semibold text-accent" @click="router.replace('/admin/logs')">
{{ t("overview.viewAll") }}
</button>
</div>
<div v-if="logsLoading" class="px-5 py-12 text-center text-faint">
{{ t("status.loading") }}
</div>
<div v-else-if="!logs.length" class="px-5 py-12 text-center text-faint">
{{ t("metrics.empty") }}
</div>
<ul v-else class="divide-y divide-border">
<li
v-for="log in logs.slice(0, 10)"
:key="log.id ?? `${log.ts}-${log.target}`"
class="flex items-center gap-3 px-5 py-3"
>
<span class="dot" :class="log.ok ? 'ok' : 'bad'" />
<div class="min-w-0 flex-1">
<div class="flex items-center gap-2">
<span
class="rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide"
:class="eventBadge(log.event)"
>
{{ log.event }}
</span>
<span class="truncate text-[12px] text-muted">{{ log.repo || log.target }}</span>
</div>
<div class="mt-0.5 truncate font-mono text-[11px] text-faint">{{ log.target }}</div>
</div> </div>
<span class="text-[11px] font-medium text-faint [font-variant-numeric:tabular-nums]"> <div class="mt-0.5 truncate font-mono text-[11px] text-faint">{{ log.target }}</div>
{{ fmtTime(log.ts) }} </div>
</span> <span class="text-[11px] font-medium text-faint [font-variant-numeric:tabular-nums]">
</li> {{ fmtTime(log.ts) }}
</ul> </span>
</section> </li>
</div> </ul>
</RcCard>
</div> </div>
</template> </template>
+30
View File
@@ -0,0 +1,30 @@
<template>
<img
src="/logo.svg"
:width="size"
:height="size"
alt="WebHooker"
class="app-logo"
:style="{ width: `${size}px`, height: `${size}px` }"
/>
</template>
<script setup lang="ts">
withDefaults(
defineProps<{
size?: number;
}>(),
{
size: 32,
},
);
</script>
<style scoped>
.app-logo {
display: inline-block;
flex-shrink: 0;
vertical-align: middle;
border-radius: 22%;
}
</style>
+23 -4
View File
@@ -1,13 +1,32 @@
<template> <template>
<div class="toasts"> <div class="recloud-toasts" aria-live="polite" aria-atomic="true">
<TransitionGroup name="toast"> <TransitionGroup name="toast">
<div v-for="t in toasts" :key="t.id" class="toast" :class="t.kind" @click="dismiss(t.id)"> <RcCard
{{ t.msg }} v-for="t in toasts"
</div> :key="t.id"
:variant="t.kind === 'bad' ? 'soft' : 'outline'"
padding="sm"
class="recloud-toast"
:class="t.kind"
role="status"
@click="dismiss(t.id)"
>
<component :is="t.kind === 'bad' ? CircleAlert : CircleCheck" :size="18" />
<span>{{ t.msg }}</span>
<X :size="15" class="toast-close" />
</RcCard>
</TransitionGroup> </TransitionGroup>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { CircleAlert, CircleCheck, X } from "lucide-vue-next";
const { toasts, dismiss } = useToasts(); const { toasts, dismiss } = useToasts();
</script> </script>
<style scoped>
.recloud-toasts { position: fixed; z-index: 70; right: 1rem; bottom: 1rem; display: grid; width: min(calc(100vw - 2rem), 390px); gap: .65rem; }
.recloud-toast { display: flex; align-items: center; gap: .7rem; cursor: pointer; box-shadow: 0 16px 38px rgb(var(--wh-text) / .14); } .recloud-toast :deep(.rc-card-body) { display: flex; width: 100%; align-items: center; gap: .7rem; padding: .1rem; } .recloud-toast :deep(svg) { flex: none; color: rgb(var(--wh-ok)); } .recloud-toast.bad :deep(svg) { color: rgb(var(--wh-bad)); } .recloud-toast span { flex: 1; font-size: .8rem; font-weight: 700; } .recloud-toast .toast-close { color: rgb(var(--wh-faint)); }
.toast-enter-active, .toast-leave-active { transition: opacity 180ms ease, transform 180ms ease; } .toast-enter-from, .toast-leave-to { opacity: 0; transform: translateX(16px); }
</style>
+20 -15
View File
@@ -4,25 +4,25 @@
<span class="kpi-label">{{ t("audit.title") }}</span> <span class="kpi-label">{{ t("audit.title") }}</span>
<div class="log-filters"> <div class="log-filters">
<label class="filter-label">{{ t("audit.filterGroup") }}</label> <label class="filter-label">{{ t("audit.filterGroup") }}</label>
<select <RcSelect
class="filter-select" class="filter-select"
:value="selectedGroupId" :model-value="selectedGroupId || 'all'"
:options="groupOptions"
:disabled="loading" :disabled="loading"
@change="onGroupFilter" @update:model-value="onGroupFilter"
> />
<option value="">{{ t("audit.allGroups") }}</option>
<option v-for="g in groups" :key="g.id" :value="g.id">
{{ g.name || g.id }}
</option>
</select>
</div> </div>
<button class="btn btn-ghost btn-sm" :disabled="loading" @click="refresh"> <RcButton variant="ghost" size="sm" :disabled="loading" @click="refresh">
{{ t("audit.refresh") }} {{ t("audit.refresh") }}
</button> </RcButton>
</div> </div>
<p v-if="error" class="err">{{ error }}</p> <p v-if="error" class="err">{{ error }}</p>
<p v-else-if="!loading && !entries.length" class="empty-log">{{ t("audit.empty") }}</p> <RcEmptyState
v-else-if="!loading && !entries.length"
:title="t('audit.empty')"
class="empty-log"
/>
<div class="log-list"> <div class="log-list">
<article v-for="e in entries" :key="e.id ?? e.ts" class="log-entry"> <article v-for="e in entries" :key="e.id ?? e.ts" class="log-entry">
@@ -57,7 +57,7 @@ import type { AuditEntry, Group } from "~/types";
const { t } = useI18n(); const { t } = useI18n();
defineProps<{ const props = defineProps<{
entries: AuditEntry[]; entries: AuditEntry[];
loading: boolean; loading: boolean;
error: string; error: string;
@@ -74,8 +74,13 @@ function refresh(): void {
emit("refresh"); emit("refresh");
} }
function onGroupFilter(e: Event): void { const groupOptions = computed(() => [
emit("update:selectedGroupId", (e.target as HTMLSelectElement).value); { label: t("audit.allGroups"), value: "all" },
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
]);
function onGroupFilter(value: string): void {
emit("update:selectedGroupId", value === "all" ? "" : value);
emit("filter"); emit("filter");
} }
</script> </script>
+108 -155
View File
@@ -1,122 +1,65 @@
<template> <template>
<div class="flex min-h-screen bg-bg text-text"> <div class="console-shell">
<!-- Sidebar --> <aside class="console-sidebar">
<aside <NuxtLink class="console-brand" to="/">
class="sticky top-0 z-30 flex h-screen w-[240px] flex-shrink-0 flex-col border-r border-border bg-surface max-lg:hidden" <AppLogo :size="32" />
> <span><strong>WebHooker</strong><small>{{ t("app.tagline") }}</small></span>
<div class="flex items-center gap-3 px-5 py-5"> </NuxtLink>
<div class="brand-mark" aria-hidden="true"> <p class="console-nav-label">{{ t("app.tagline") }}</p>
<svg <nav class="console-nav">
viewBox="0 0 64 64"
class="h-[22px] w-[22px]"
fill="none"
stroke="currentColor"
stroke-width="6"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M41 23 V35.5 A10.5 10.5 0 0 1 20 35.5 L28 25.5" />
<circle cx="41" cy="18" r="4.5" fill="currentColor" stroke="none" />
</svg>
</div>
<div>
<div class="text-sm font-extrabold tracking-tight">WebHooker</div>
<div class="text-[10px] font-semibold uppercase tracking-[2px] text-faint">
{{ t("app.tagline") }}
</div>
</div>
</div>
<nav class="flex-1 space-y-0.5 px-3">
<button <button
v-for="n in nav" v-for="n in nav"
:key="n.id" :key="n.id"
class="flex w-full items-center gap-3 rounded-[8px] px-3 py-2 text-[13px] font-semibold transition-colors" class="console-nav-item"
:class=" :class="{ active: n.id === activeNav }"
n.id === activeNav
? 'bg-accent-dim text-accent'
: 'text-muted hover:bg-surface-2 hover:text-text'
"
@click="switchView(n.id)" @click="switchView(n.id)"
> >
<span <component :is="navIcon(n.id)" :size="17" :stroke-width="1.8" />
class="h-1.5 w-1.5 rounded-full"
:class="n.id === activeNav ? 'bg-accent' : 'bg-border-strong'"
/>
{{ n.label }} {{ n.label }}
</button> </button>
</nav> </nav>
<div class="console-sidebar-footer">
<div class="border-t border-border px-3 py-4"> <a href="/admin/logout"><LogOut :size="16" />{{ t("app.signOut") }}</a>
<a
class="block rounded-[8px] px-3 py-2 text-[13px] font-semibold text-muted transition-colors hover:bg-surface-2"
href="/admin/logout"
>
{{ t("app.signOut") }}
</a>
</div> </div>
</aside> </aside>
<!-- Main column --> <div class="console-main">
<div class="flex min-w-0 flex-1 flex-col"> <header class="console-topbar">
<header
class="sticky top-0 z-20 flex items-center justify-between gap-4 border-b border-border px-6 py-3"
style="background: var(--header-bg); backdrop-filter: blur(12px)"
>
<div> <div>
<h1 class="text-[15px] font-extrabold tracking-tight">{{ pageTitle }}</h1> <p class="console-kicker">WebHooker / {{ activeNav }}</p>
<p v-if="needLogin" class="text-[11px] text-faint">{{ t("login.title") }}</p> <h1>{{ pageTitle }}</h1>
<p v-else class="text-[11px] text-faint">
{{ loadingAny ? t("status.loading") : t("status.connected") }}
</p>
</div> </div>
<div class="flex items-center gap-2"> <div class="console-actions">
<button v-if="view === 'overview'" class="btn btn-ghost btn-sm" @click="refreshOverview"> <RcBadge v-if="!needLogin && loadingAny" variant="soft" size="sm" dot class="console-status">
{{ t("metrics.refresh") }} {{ t("status.loading") }}
</button> </RcBadge>
<button class="btn btn-ghost btn-sm" @click="toggle">{{ t("app.langToggle") }}</button> <RcButton v-if="view === 'overview'" variant="ghost" size="sm" @click="refreshOverview"><RefreshCw :size="15" />{{ t("metrics.refresh") }}</RcButton>
<button <ThemeToggle />
<RcButton variant="ghost" size="sm" @click="toggle"><Languages :size="15" />{{ t("app.langToggle") }}</RcButton>
<RcButton
v-if="!needLogin && selectedGroup && canEditRoutes(selectedGroup.id)" v-if="!needLogin && selectedGroup && canEditRoutes(selectedGroup.id)"
class="btn btn-accent btn-sm"
@click="openNew" @click="openNew"
> ><Plus :size="16" />{{ t("app.newRoute") }}</RcButton>
{{ t("app.newRoute") }} <RcButton
</button>
<button
v-if="!needLogin && !selectedGroup && view === 'groups' && isSuper" v-if="!needLogin && !selectedGroup && view === 'groups' && isSuper"
class="btn btn-accent btn-sm"
@click="openNewGroup" @click="openNewGroup"
> ><Plus :size="16" />{{ t("app.newGroup") }}</RcButton>
{{ t("app.newGroup") }}
</button>
</div> </div>
</header> </header>
<!-- Mobile nav --> <div class="console-mobile-nav"><RcTabs :model-value="activeNav" :items="mobileNav" @update:model-value="switchView($event as View)" /></div>
<nav class="flex gap-1 overflow-x-auto border-b border-border px-4 py-2 lg:hidden">
<button
v-for="n in nav"
:key="n.id"
class="whitespace-nowrap rounded-[7px] px-3 py-1.5 text-[13px] font-semibold transition-colors"
:class="n.id === activeNav ? 'bg-accent-dim text-accent' : 'text-muted'"
@click="switchView(n.id)"
>
{{ n.label }}
</button>
</nav>
<main class="mx-auto w-full max-w-[1180px] px-6 pb-24 pt-6 max-sm:px-4"> <main class="console-content">
<div v-if="needLogin" class="login"> <div v-if="needLogin" class="console-login">
<div class="login-card"> <RcCard variant="outline" padding="lg" class="console-login-card">
<template #header><LockKeyhole :size="24" /></template>
<h2>{{ t("login.title") }}</h2> <h2>{{ t("login.title") }}</h2>
<p v-if="forbidden">{{ t("login.forbidden") }}</p> <p>{{ forbidden ? t("login.forbidden") : t("login.prompt") }}</p>
<p v-else>{{ t("login.prompt") }}</p> <a href="/admin/login"><RcButton size="lg"><LogIn :size="17" />{{ t("login.button") }}</RcButton></a>
<a class="btn btn-accent btn-lg" href="/admin/login">{{ t("login.button") }}</a> </RcCard>
</div>
</div> </div>
<template v-else> <template v-else>
<!-- Overview dashboard -->
<AdminHome <AdminHome
v-if="view === 'overview'" v-if="view === 'overview'"
:key="refreshKey" :key="refreshKey"
@@ -128,22 +71,13 @@
:metrics-loading="metricsLoading" :metrics-loading="metricsLoading"
/> />
<!-- Group detail view -->
<template v-else-if="selectedGroup"> <template v-else-if="selectedGroup">
<section class="toolbar"> <section class="console-context-bar">
<div class="crumbs"> <div>
<button class="btn btn-ghost btn-sm" @click="exitGroup"> <RcButton variant="ghost" size="sm" @click="exitGroup"><ArrowLeft :size="15" />{{ t("group.back") }}</RcButton>
{{ t("group.back") }} <p>{{ t("group.routesIn", { name: selectedGroup.name }) }}</p>
</button>
<span class="kpi-label">{{
t("group.routesIn", { name: selectedGroup.name })
}}</span>
<span class="kpi">{{ groupRoutes.length }}</span>
</div>
<div class="status">
<span class="dot" :class="groupRoutesLoading ? '' : 'ok'"></span>
<span>{{ groupRoutesLoading ? t("status.loading") : t("status.connected") }}</span>
</div> </div>
<RcBadge :variant="groupRoutesLoading ? 'soft' : 'success'" size="sm" dot>{{ groupRoutes.length }}</RcBadge>
</section> </section>
<p v-if="groupRoutesError" class="err">{{ groupRoutesError }}</p> <p v-if="groupRoutesError" class="err">{{ groupRoutesError }}</p>
@@ -164,15 +98,10 @@
/> />
</section> </section>
<section v-if="!groupRoutesLoading && !groupRoutes.length" class="empty"> <section v-if="!groupRoutesLoading && !groupRoutes.length" class="console-empty">
<p>{{ t("routes.emptyGroup") }}</p> <RcEmptyState :title="t('routes.emptyGroup')">
<button <RcButton v-if="canEditRoutes(selectedGroup.id)" @click="openNew"><Plus :size="16" />{{ t("routes.createFirst") }}</RcButton>
v-if="canEditRoutes(selectedGroup.id)" </RcEmptyState>
class="btn btn-accent"
@click="openNew"
>
{{ t("routes.createFirst") }}
</button>
</section> </section>
<MembersPanel <MembersPanel
@@ -189,48 +118,39 @@
/> />
</template> </template>
<!-- Top-level views -->
<template v-else-if="view === 'groups'"> <template v-else-if="view === 'groups'">
<section class="toolbar"> <section class="console-context-bar">
<div> <div><p>{{ t("kpi.groups") }}</p><strong>{{ groups.length }}</strong></div>
<span class="kpi-label">{{ t("kpi.groups") }}</span> <RcBadge v-if="groupsLoading" variant="soft" size="sm" dot>{{ t("status.loading") }}</RcBadge>
<span class="kpi">{{ groups.length }}</span>
</div>
<div class="status">
<span class="dot" :class="groupsLoading ? '' : 'ok'"></span>
<span>{{ groupsLoading ? t("status.loading") : t("status.connected") }}</span>
</div>
</section> </section>
<p v-if="groupsError" class="err">{{ groupsError }}</p> <p v-if="groupsError" class="err">{{ groupsError }}</p>
<section class="routes"> <section class="routes">
<article <RcCard
v-for="(g, i) in groups" v-for="(g, i) in groups"
:key="g.id" :key="g.id"
class="card cursor-pointer" variant="outline"
:hoverable="true"
padding="md"
class="console-group-card"
:style="{ animationDelay: i * 45 + 'ms' }" :style="{ animationDelay: i * 45 + 'ms' }"
@click="enterGroup(g)" @click="enterGroup(g)"
> >
<div class="card-head"> <template #header><div class="card-head"><div class="card-title">
<div class="card-title">
<span class="route-name">{{ g.name || t("route.untitled") }}</span> <span class="route-name">{{ g.name || t("route.untitled") }}</span>
<span class="route-id">{{ g.id }}</span> <span class="route-id">{{ g.id }}</span>
<span v-if="roleOf(g.id)" class="badge lang">{{ <RcBadge v-if="roleOf(g.id)" variant="brand" size="xs">{{ t("role.badge", { role: t("roles." + roleOf(g.id)) }) }}</RcBadge>
t("role.badge", { role: t("roles." + roleOf(g.id)) })
}}</span>
</div> </div>
<div v-if="canEditGroup(g.id)" class="card-actions" @click.stop> <div v-if="canEditGroup(g.id)" class="card-actions" @click.stop>
<button <RcButton
class="icon-btn" variant="ghost" size="icon"
:title="t('groupEditor.editTitle')" :title="t('groupEditor.editTitle')"
@click="openEditGroup(g)" @click="openEditGroup(g)"
> ><Pencil :size="15" /></RcButton>
✎ <RcButton variant="ghost" color="error" size="icon" @click="onDeleteGroup(g)"><Trash2 :size="15" /></RcButton>
</button>
<button class="icon-btn danger" @click="onDeleteGroup(g)">✕</button>
</div> </div>
</div> </div></template>
<div class="target"> <div class="target">
<span <span
><b>{{ t("groups.members") }}</b ><b>{{ t("groups.members") }}</b
@@ -245,27 +165,17 @@
}}</code></span }}</code></span
> >
</div> </div>
<div class="group-open mt-2.5 text-right text-xs font-medium text-accent"> <template #footer><span class="console-open"><ArrowRight :size="15" />{{ t("groups.open") }}</span></template>
{{ t("groups.open") }} </RcCard>
</div>
</article>
</section> </section>
<section v-if="!groupsLoading && !groups.length" class="empty"> <section v-if="!groupsLoading && !groups.length" class="console-empty">
<p>{{ t("groups.empty") }}</p> <RcEmptyState :title="t('groups.empty')"><RcButton v-if="isSuper" @click="openNewGroup"><Plus :size="16" />{{ t("groups.createFirst") }}</RcButton></RcEmptyState>
<button v-if="isSuper" class="btn btn-accent" @click="openNewGroup">
{{ t("groups.createFirst") }}
</button>
</section> </section>
</template> </template>
<template v-else-if="view === 'logs'"> <template v-else-if="view === 'logs'">
<section class="toolbar"> <section v-if="logsLoading" class="console-context-bar"><RcBadge variant="soft" size="sm" dot>{{ t("status.loading") }}</RcBadge></section>
<div class="status">
<span class="dot" :class="logsLoading ? '' : 'ok'"></span>
<span>{{ logsLoading ? t("status.loading") : t("status.connected") }}</span>
</div>
</section>
<SendLogs <SendLogs
:logs="logs" :logs="logs"
:loading="logsLoading" :loading="logsLoading"
@@ -328,6 +238,23 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {
Activity,
ArrowLeft,
ArrowRight,
ClipboardList,
Gauge,
Languages,
Layers3,
LockKeyhole,
LogIn,
LogOut,
Pencil,
Plus,
RefreshCw,
ShieldCheck,
Trash2,
} from "lucide-vue-next";
import type { Group, Route } from "~/types"; import type { Group, Route } from "~/types";
import { useAuditApi } from "~/composables/useAudit"; import { useAuditApi } from "~/composables/useAudit";
import WebhookPanel from "~/components/WebhookPanel.vue"; import WebhookPanel from "~/components/WebhookPanel.vue";
@@ -370,6 +297,19 @@ const nav = computed(() => [
{ id: "metrics" as View, label: t("tab.metrics"), path: "/admin/metrics" }, { id: "metrics" as View, label: t("tab.metrics"), path: "/admin/metrics" },
]); ]);
const mobileNav = computed(() => nav.value.map(({ id, label }) => ({ value: id, label, icon: navIcon(id) })));
function navIcon(id: View) {
const icons = {
overview: Gauge,
groups: Layers3,
logs: Activity,
audit: ClipboardList,
metrics: ShieldCheck,
} satisfies Record<View, typeof Gauge>;
return icons[id];
}
const activeNav = computed<View>(() => view.value ?? "overview"); const activeNav = computed<View>(() => view.value ?? "overview");
const pageTitle = computed(() => { const pageTitle = computed(() => {
@@ -652,3 +592,16 @@ async function onDeleteGroup(group: Group): Promise<void> {
} }
} }
</script> </script>
<style scoped>
.console-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: rgb(var(--wh-bg)); color: rgb(var(--wh-text)); }
.console-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; border-right: 1px solid rgb(var(--wh-border)); background: linear-gradient(165deg, rgb(var(--wh-surface)), rgb(var(--wh-surface-2))); padding: 1.25rem .85rem; }
.console-brand { display: flex; align-items: center; gap: .7rem; padding: .45rem .55rem 1.75rem; color: rgb(var(--wh-text)); text-decoration: none; } .console-brand :deep(svg) { color: rgb(var(--wh-accent)); } .console-brand span { display: grid; gap: .1rem; } .console-brand strong { font-size: 1rem; letter-spacing: -.04em; } .console-brand small, .console-nav-label, .console-kicker { color: rgb(var(--wh-faint)); font-size: .62rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.console-nav-label { margin: 0 .65rem .45rem; } .console-nav { display: grid; gap: .2rem; } .console-nav-item { display: flex; align-items: center; gap: .7rem; width: 100%; border: 0; border-radius: .65rem; background: transparent; padding: .7rem; color: rgb(var(--wh-muted)); font: inherit; font-size: .82rem; font-weight: 700; text-align: left; transition: background-color 150ms ease, color 150ms ease; cursor: pointer; } .console-nav-item:hover { background: rgb(var(--wh-surface-2)); color: rgb(var(--wh-text)); } .console-nav-item.active { background: rgb(var(--wh-accent)); color: white; box-shadow: 0 8px 18px rgb(var(--wh-accent) / .2); }
.console-sidebar-footer { display: grid; gap: .9rem; margin-top: auto; padding: .9rem .55rem .25rem; border-top: 1px solid rgb(var(--wh-border)); } .console-sidebar-footer a { display: inline-flex; align-items: center; gap: .55rem; color: rgb(var(--wh-muted)); font-size: .8rem; font-weight: 700; text-decoration: none; } .console-sidebar-footer a:hover { color: rgb(var(--wh-bad)); }
.console-main { min-width: 0; } .console-topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgb(var(--wh-border)); background: color-mix(in srgb, rgb(var(--wh-bg)) 87%, transparent); padding: .8rem clamp(1rem, 3vw, 2.5rem); backdrop-filter: blur(18px); } .console-topbar h1 { margin: .1rem 0 0; font-size: 1.15rem; letter-spacing: -.035em; } .console-kicker { margin: 0; } .console-actions { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; } .console-status { white-space: nowrap; }
.console-mobile-nav { display: none; } .console-content { width: min(100% - 2rem, 1240px); margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem) 0 5rem; } .console-login { display: grid; min-height: 62vh; place-items: center; } .console-login-card { width: min(100%, 430px); text-align: center; } .console-login-card :deep(.rc-card-header) { justify-content: center; color: rgb(var(--wh-accent)); } .console-login-card h2 { margin: .35rem 0 .65rem; font-size: 1.35rem; letter-spacing: -.035em; } .console-login-card p { margin: 0 0 1.4rem; color: rgb(var(--wh-muted)); }
.console-context-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid rgb(var(--wh-border)); border-radius: .85rem; background: rgb(var(--wh-surface) / .6); } .console-context-bar > div { display: flex; align-items: center; gap: .8rem; } .console-context-bar p { margin: 0; color: rgb(var(--wh-muted)); font-size: .8rem; font-weight: 700; } .console-context-bar strong { font-size: 1.25rem; letter-spacing: -.04em; } .console-empty { padding: 4rem 1rem; } .console-group-card { cursor: pointer; } .console-open { display: inline-flex; align-items: center; gap: .35rem; color: rgb(var(--wh-accent)); font-size: .75rem; font-weight: 800; }
@media (max-width: 900px) { .console-shell { display: block; } .console-sidebar { display: none; } .console-mobile-nav { display: block; border-bottom: 1px solid rgb(var(--wh-border)); padding: .5rem 1rem; overflow-x: auto; } .console-mobile-nav :deep(.rc-tabs) { min-width: max-content; } }
@media (max-width: 620px) { .console-topbar { align-items: flex-start; flex-direction: column; } .console-actions { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: .05rem; } .console-status { display: none; } .console-content { width: min(100% - 1.25rem, 1240px); } }
</style>
+30 -29
View File
@@ -15,6 +15,9 @@ const emit = defineEmits<{ (e: "remove"): void }>();
const { t } = useI18n(); const { t } = useI18n();
const NODE_KINDS = ["all", "any"] as const; const NODE_KINDS = ["all", "any"] as const;
const filterTypeOptions = computed(() => FILTER_TYPES.map((value) => ({ label: t("filter." + value), value })));
const filterOpOptions = computed(() => FILTER_OPS.map((value) => ({ label: t("filterOp." + value), value })));
const nodeKindOptions = computed(() => NODE_KINDS.map((value) => ({ label: t("filterNode." + value), value })));
function addChild(kind: "leaf" | "all" | "any" | "not"): void { function addChild(kind: "leaf" | "all" | "any" | "not"): void {
props.node.children.push(blankNode(kind)); props.node.children.push(blankNode(kind));
@@ -33,25 +36,22 @@ function unwrapNot(): void {
<template> <template>
<div class="node-editor" :class="{ 'node-nested': depth > 0 }"> <div class="node-editor" :class="{ 'node-nested': depth > 0 }">
<div v-if="node.kind === 'leaf'" class="leaf-row"> <div v-if="node.kind === 'leaf'" class="leaf-row">
<select v-model="node.leaf.type" class="node-select"> <RcSelect v-model="node.leaf.type" class="node-select" :options="filterTypeOptions" />
<option v-for="ft in FILTER_TYPES" :key="ft" :value="ft">{{ t("filter." + ft) }}</option>
</select>
<input <RcInput
v-if="node.leaf.type === 'field'" v-if="node.leaf.type === 'field'"
v-model="node.leaf.path" v-model="node.leaf.path"
class="input node-path" class="input node-path"
:placeholder="t('routeEditor.pathPlaceholder')" :placeholder="t('routeEditor.pathPlaceholder')"
/> />
<select <RcSelect
v-if="node.leaf.type !== 'keyword'" v-if="node.leaf.type !== 'keyword'"
v-model="node.leaf.op" v-model="node.leaf.op"
class="node-select" class="node-select"
:options="filterOpOptions"
:title="t('routeEditor.op')" :title="t('routeEditor.op')"
> />
<option v-for="op in FILTER_OPS" :key="op" :value="op">{{ t("filterOp." + op) }}</option>
</select>
<TagInput <TagInput
v-if="node.leaf.type === 'keyword' || node.leaf.op !== 'exists'" v-if="node.leaf.type === 'keyword' || node.leaf.op !== 'exists'"
@@ -60,46 +60,45 @@ function unwrapNot(): void {
:placeholder="t('routeEditor.valuesPlaceholder')" :placeholder="t('routeEditor.valuesPlaceholder')"
/> />
<label class="inline node-exclude" :title="t('routeEditor.not')"> <RcCheckbox v-model="node.leaf.exclude" class="node-exclude" :label="t('routeEditor.not')" :title="t('routeEditor.not')" />
<input v-model="node.leaf.exclude" type="checkbox" />
<span>{{ t("routeEditor.not") }}</span>
</label>
<button <RcButton
v-if="deletable" v-if="deletable"
type="button" type="button"
variant="destructive"
size="icon"
class="icon-btn danger" class="icon-btn danger"
:title="t('routeEditor.remove')" :title="t('routeEditor.remove')"
@click="emit('remove')" @click="emit('remove')"
> >
✕ ✕
</button> </RcButton>
</div> </div>
<div v-else-if="node.kind === 'all' || node.kind === 'any'" class="node-group"> <div v-else-if="node.kind === 'all' || node.kind === 'any'" class="node-group">
<div class="node-group-head"> <div class="node-group-head">
<select v-model="node.kind" class="node-combo"> <RcSelect v-model="node.kind" class="node-combo" :options="nodeKindOptions" />
<option v-for="k in NODE_KINDS" :key="k" :value="k">{{ t("filterNode." + k) }}</option>
</select>
<div class="node-actions"> <div class="node-actions">
<button type="button" class="btn btn-ghost node-add" @click="addChild('leaf')"> <RcButton type="button" variant="ghost" size="xs" class="node-add" @click="addChild('leaf')">
+ {{ t("routeEditor.addLeaf") }} + {{ t("routeEditor.addLeaf") }}
</button> </RcButton>
<button type="button" class="btn btn-ghost node-add" @click="addChild('all')"> <RcButton type="button" variant="ghost" size="xs" class="node-add" @click="addChild('all')">
+ {{ t("routeEditor.addGroup") }} + {{ t("routeEditor.addGroup") }}
</button> </RcButton>
<button type="button" class="btn btn-ghost node-add" @click="addChild('not')"> <RcButton type="button" variant="ghost" size="xs" class="node-add" @click="addChild('not')">
+ {{ t("routeEditor.addNot") }} + {{ t("routeEditor.addNot") }}
</button> </RcButton>
<button <RcButton
v-if="deletable" v-if="deletable"
type="button" type="button"
variant="destructive"
size="icon"
class="icon-btn danger" class="icon-btn danger"
:title="t('routeEditor.remove')" :title="t('routeEditor.remove')"
@click="emit('remove')" @click="emit('remove')"
> >
✕ ✕
</button> </RcButton>
</div> </div>
</div> </div>
<div class="node-children"> <div class="node-children">
@@ -119,18 +118,20 @@ function unwrapNot(): void {
<div class="node-group-head"> <div class="node-group-head">
<span class="node-combo node-combo-label">{{ t("filterNode.not") }}</span> <span class="node-combo node-combo-label">{{ t("filterNode.not") }}</span>
<div class="node-actions"> <div class="node-actions">
<button type="button" class="btn btn-ghost node-add" @click="unwrapNot"> <RcButton type="button" variant="ghost" size="xs" class="node-add" @click="unwrapNot">
{{ t("filterNode.unwrap") }} {{ t("filterNode.unwrap") }}
</button> </RcButton>
<button <RcButton
v-if="deletable" v-if="deletable"
type="button" type="button"
variant="destructive"
size="icon"
class="icon-btn danger" class="icon-btn danger"
:title="t('routeEditor.remove')" :title="t('routeEditor.remove')"
@click="emit('remove')" @click="emit('remove')"
> >
✕ ✕
</button> </RcButton>
</div> </div>
</div> </div>
<div class="node-children"> <div class="node-children">
+256 -235
View File
@@ -1,240 +1,235 @@
<template> <template>
<Teleport to="body"> <RcDialog
<Transition name="fade"> :open="open"
<div v-if="open" class="overlay" @click.self="close"></div> :title="isEdit ? t('groupEditor.editTitle') : t('groupEditor.newTitle')"
</Transition> class="editor-dialog flex flex-col gap-0 max-h-[calc(100dvh-2rem)] overflow-hidden p-0 max-w-2xl"
<Transition name="slide"> @update:open="onOpenChange"
<aside v-if="open" class="editor" role="dialog" aria-modal="true"> >
<div class="editor-head"> <template #header>
<div class="editor-heading"> <div class="editor-head">
<span class="editor-eyebrow">{{ t("groupEditor.eyebrow") }}</span> <div class="editor-heading">
<h2>{{ isEdit ? t("groupEditor.editTitle") : t("groupEditor.newTitle") }}</h2> <span class="editor-eyebrow">{{ t("groupEditor.eyebrow") }}</span>
<h2>{{ isEdit ? t("groupEditor.editTitle") : t("groupEditor.newTitle") }}</h2>
</div>
</div>
</template>
<form class="editor-body" @submit.prevent="save">
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionBasic") }}</h3>
<div class="row2">
<div class="field">
<label>{{ t("groupEditor.name") }}</label>
<RcInput
v-model="form.name"
type="text"
:placeholder="t('groupEditor.namePlaceholder')"
required
/>
</div>
<div class="field">
<label>{{ t("groupEditor.id") }}</label>
<RcInput
v-model="form.id"
type="text"
:placeholder="t('groupEditor.idPlaceholder')"
required
/>
<div class="hint">
{{ isEdit ? t("groupEditor.renameHint") : t("groupEditor.idHint") }}
</div>
</div> </div>
<button class="icon-btn" :title="t('groupEditor.close')" @click="close">✕</button>
</div> </div>
<form class="editor-body" @submit.prevent="save"> </section>
<section class="editor-section"> <section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionBasic") }}</h3> <h3 class="editor-section-title">{{ t("groupEditor.sectionPreferences") }}</h3>
<div class="row2"> <div class="row2">
<div class="field"> <div class="field">
<label>{{ t("groupEditor.name") }}</label> <label>{{ t("groupEditor.language") }}</label>
<input <RcInput
v-model="form.name" v-model="form.lang"
type="text" type="text"
class="input" :placeholder="t('groupEditor.langPlaceholder')"
:placeholder="t('groupEditor.namePlaceholder')" />
required <div class="hint">{{ t("groupEditor.langHint") }}</div>
/> </div>
</div> <div class="field">
<div class="field"> <label
<label>{{ t("groupEditor.id") }}</label> >{{ t("groupEditor.emoji") }}
<input <span class="lbl-note">{{ t("groupEditor.emojiNote") }}</span></label
v-model="form.id" >
type="text" <RcSwitch v-model="form.emoji" :label="t('groupEditor.emojiLabel')" />
class="input" </div>
:placeholder="t('groupEditor.idPlaceholder')"
required
/>
<div class="hint">
{{ isEdit ? t("groupEditor.renameHint") : t("groupEditor.idHint") }}
</div>
</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionPreferences") }}</h3>
<div class="row2">
<div class="field">
<label>{{ t("groupEditor.language") }}</label>
<input
v-model="form.lang"
type="text"
class="input"
:placeholder="t('groupEditor.langPlaceholder')"
/>
<div class="hint">{{ t("groupEditor.langHint") }}</div>
</div>
<div class="field">
<label
>{{ t("groupEditor.emoji") }}
<span class="lbl-note">{{ t("groupEditor.emojiNote") }}</span></label
>
<label class="inline">
<input v-model="form.emoji" type="checkbox" />
<span>{{ t("groupEditor.emojiLabel") }}</span>
</label>
</div>
</div>
<div class="field">
<label
>{{ t("groupEditor.forgeSources") }}
<span class="lbl-note">{{ t("groupEditor.forgeSourcesNote") }}</span></label
>
<div v-for="(s, i) in form.forgeSources" :key="i" class="forge-source-row">
<input
v-model="s.host"
type="text"
class="input f-host"
:placeholder="t('groupEditor.forgeSourcesHost')"
/>
<select v-model="s.type" class="select forge-type">
<option value="github">GitHub</option>
<option value="gitea">Gitea</option>
</select>
<button
type="button"
class="icon-btn danger"
@click="form.forgeSources.splice(i, 1)"
>
✕
</button>
<input
v-model="s.name"
type="text"
class="input f-name"
:placeholder="t('groupEditor.forgeSourcesName')"
/>
</div>
<button type="button" class="btn btn-ghost add-filter" @click="addForgeSource">
{{ t("groupEditor.forgeSourcesAdd") }}
</button>
<div class="hint">{{ t("groupEditor.forgeSourcesHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionAccess") }}</h3>
<div class="field">
<label
>{{ t("groupEditor.membersNote") }}
<span class="lbl-note">{{ t("groupEditor.membersHint") }}</span></label
>
<p class="hint">
{{ t("groupEditor.membersGoPanel") }}
</p>
</div>
<div v-if="superAdmin" class="field">
<label
>{{ t("groupEditor.owners") }}
<span class="lbl-note">{{ t("groupEditor.ownersNote") }}</span></label
>
<input
v-model="form.owners"
type="text"
class="input"
:placeholder="t('groupEditor.ownersPlaceholder')"
/>
<div class="hint">{{ t("groupEditor.ownersHint") }}</div>
</div>
<div v-else class="field">
<label
>{{ t("groupEditor.owners") }}
<span class="lbl-note">{{ t("groupEditor.ownersSuperOnly") }}</span></label
>
<input v-model="ownersReadonly" type="text" class="input opacity-60" disabled />
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionProviders") }}</h3>
<div class="field">
<label
>{{ t("groupEditor.providers") }}
<span class="lbl-note">{{ t("groupEditor.providersNote") }}</span></label
>
<div class="flex flex-wrap gap-4">
<label class="inline">
<input
type="checkbox"
:checked="form.providers.includes('github')"
@change="toggleProvider('github', $event)"
/>
<span>GitHub</span>
</label>
<label class="inline">
<input
type="checkbox"
:checked="form.providers.includes('gitea')"
@change="toggleProvider('gitea', $event)"
/>
<span>Gitea</span>
</label>
</div>
<div class="hint">{{ t("groupEditor.providersHint") }}</div>
</div>
<div class="field">
<label
>{{ t("groupEditor.installationId") }}
<span class="lbl-note">{{ t("groupEditor.installationIdNote") }}</span></label
>
<input
v-model="form.installationId"
type="text"
class="input"
inputmode="numeric"
:placeholder="t('groupEditor.installationIdPlaceholder')"
/>
<div class="hint">{{ t("groupEditor.installationIdHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionLog") }}</h3>
<div class="field">
<label
>{{ t("groupEditor.logTarget") }}
<span class="lbl-note">{{ t("groupEditor.logTargetNote") }}</span></label
>
<select v-model="form.logPlatform" class="select">
<option value="">{{ t("groupEditor.logDisabled") }}</option>
<option value="discord">Discord</option>
<option value="telegram">Telegram</option>
<option value="feishu">{{ t("groupEditor.logFeishu") }}</option>
</select>
<template v-if="form.logPlatform === 'discord'">
<input
v-model="form.logChannelId"
type="text"
class="input mt-2"
:placeholder="t('routeEditor.channelPlaceholder')"
/>
<input
v-model="form.logThreadId"
type="text"
class="input mt-2"
:placeholder="t('routeEditor.threadPlaceholder')"
/>
</template>
<template
v-else-if="form.logPlatform === 'telegram' || form.logPlatform === 'feishu'"
>
<input
v-model="form.logChatId"
type="text"
class="input mt-2"
:placeholder="t('routeEditor.chatPlaceholder')"
/>
<input
v-if="form.logPlatform === 'telegram'"
v-model="form.logTopicId"
type="text"
class="input mt-2"
:placeholder="t('routeEditor.topicPlaceholder')"
/>
</template>
<div class="hint">{{ t("groupEditor.logTargetHint") }}</div>
</div>
</section>
<div class="err">{{ formError }}</div>
</form>
<div class="editor-foot">
<button class="btn btn-ghost" type="button" @click="close">
{{ t("groupEditor.cancel") }}
</button>
<button class="btn btn-accent" type="button" :disabled="saving" @click="save">
{{ t("groupEditor.save") }}
</button>
</div> </div>
</aside> <div class="field">
</Transition> <label
</Teleport> >{{ t("groupEditor.forgeSources") }}
<span class="lbl-note">{{ t("groupEditor.forgeSourcesNote") }}</span></label
>
<div v-for="(s, i) in form.forgeSources" :key="i" class="forge-source-row">
<RcInput
v-model="s.host"
type="text"
class="[grid-area:host]"
:placeholder="t('groupEditor.forgeSourcesHost')"
/>
<RcSelect
v-model="s.type"
class="w-[110px] [grid-area:type]"
:options="[
{ label: 'GitHub', value: 'github' },
{ label: 'Gitea', value: 'gitea' },
]"
/>
<RcButton
type="button"
variant="destructive"
size="icon"
class="[grid-area:del] justify-self-end"
@click="form.forgeSources.splice(i, 1)"
>
✕
</RcButton>
<RcInput
v-model="s.name"
type="text"
class="[grid-area:name]"
:placeholder="t('groupEditor.forgeSourcesName')"
/>
</div>
<RcButton type="button" variant="ghost" class="add-filter" @click="addForgeSource">
{{ t("groupEditor.forgeSourcesAdd") }}
</RcButton>
<div class="hint">{{ t("groupEditor.forgeSourcesHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionAccess") }}</h3>
<div class="field">
<label
>{{ t("groupEditor.membersNote") }}
<span class="lbl-note">{{ t("groupEditor.membersHint") }}</span></label
>
<p class="hint">
{{ t("groupEditor.membersGoPanel") }}
</p>
</div>
<div v-if="superAdmin" class="field">
<label
>{{ t("groupEditor.owners") }}
<span class="lbl-note">{{ t("groupEditor.ownersNote") }}</span></label
>
<RcTagInput
v-model="owners"
separator=","
:placeholder="t('groupEditor.ownersPlaceholder')"
/>
<div class="hint">{{ t("groupEditor.ownersHint") }}</div>
</div>
<div v-else class="field">
<label
>{{ t("groupEditor.owners") }}
<span class="lbl-note">{{ t("groupEditor.ownersSuperOnly") }}</span></label
>
<RcInput v-model="ownersReadonly" type="text" class="opacity-60" disabled />
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionProviders") }}</h3>
<div class="field">
<label
>{{ t("groupEditor.providers") }}
<span class="lbl-note">{{ t("groupEditor.providersNote") }}</span></label
>
<div class="flex flex-wrap gap-4">
<RcCheckbox
:model-value="form.providers.includes('github')"
label="GitHub"
@update:model-value="toggleProvider('github', $event)"
/>
<RcCheckbox
:model-value="form.providers.includes('gitea')"
label="Gitea"
@update:model-value="toggleProvider('gitea', $event)"
/>
</div>
<div class="hint">{{ t("groupEditor.providersHint") }}</div>
</div>
<div class="field">
<label
>{{ t("groupEditor.installationId") }}
<span class="lbl-note">{{ t("groupEditor.installationIdNote") }}</span></label
>
<RcInput
v-model="form.installationId"
type="text"
inputmode="numeric"
:placeholder="t('groupEditor.installationIdPlaceholder')"
/>
<div class="hint">{{ t("groupEditor.installationIdHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("groupEditor.sectionLog") }}</h3>
<div class="field">
<label
>{{ t("groupEditor.logTarget") }}
<span class="lbl-note">{{ t("groupEditor.logTargetNote") }}</span></label
>
<RcSelect
:model-value="form.logPlatform || 'none'"
:options="[
{ label: t('groupEditor.logDisabled'), value: 'none' },
{ label: 'Discord', value: 'discord' },
{ label: 'Telegram', value: 'telegram' },
{ label: t('groupEditor.logFeishu'), value: 'feishu' },
]"
@update:model-value="form.logPlatform = ($event === 'none' ? '' : $event) as '' | 'discord' | 'telegram' | 'feishu'"
/>
<template v-if="form.logPlatform === 'discord'">
<RcInput
v-model="form.logChannelId"
type="text"
class="mt-2"
:placeholder="t('routeEditor.channelPlaceholder')"
/>
<RcInput
v-model="form.logThreadId"
type="text"
class="mt-2"
:placeholder="t('routeEditor.threadPlaceholder')"
/>
</template>
<template v-else-if="form.logPlatform === 'telegram' || form.logPlatform === 'feishu'">
<RcInput
v-model="form.logChatId"
type="text"
class="mt-2"
:placeholder="t('routeEditor.chatPlaceholder')"
/>
<RcInput
v-if="form.logPlatform === 'telegram'"
v-model="form.logTopicId"
type="text"
class="mt-2"
:placeholder="t('routeEditor.topicPlaceholder')"
/>
</template>
<div class="hint">{{ t("groupEditor.logTargetHint") }}</div>
</div>
</section>
<div class="err">{{ formError }}</div>
</form>
<template #footer>
<div class="editor-foot">
<RcButton variant="ghost" type="button" @click="close">
{{ t("groupEditor.cancel") }}
</RcButton>
<RcButton variant="primary" type="button" :loading="saving" @click="save">
{{ t("groupEditor.save") }}
</RcButton>
</div>
</template>
</RcDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -273,12 +268,21 @@ const form = reactive({
logChatId: "", logChatId: "",
logTopicId: "", logTopicId: "",
}); });
const owners = computed({
get: () =>
form.owners
.split(",")
.map((owner) => owner.trim())
.filter(Boolean),
set: (values: string[]) => {
form.owners = values.join(", ");
},
});
function addForgeSource(): void { function addForgeSource(): void {
form.forgeSources.push({ host: "", type: "github" }); form.forgeSources.push({ host: "", type: "github" });
} }
function toggleProvider(p: "github" | "gitea", e: Event): void { function toggleProvider(p: "github" | "gitea", checked: boolean): void {
const checked = (e.target as HTMLInputElement).checked;
form.providers = checked form.providers = checked
? [...new Set([...form.providers, p])] ? [...new Set([...form.providers, p])]
: form.providers.filter((x) => x !== p); : form.providers.filter((x) => x !== p);
@@ -313,6 +317,10 @@ function close(): void {
emit("close"); emit("close");
} }
function onOpenChange(open: boolean): void {
if (!open) close();
}
function save(): void { function save(): void {
formError.value = ""; formError.value = "";
const id = form.id.trim(); const id = form.id.trim();
@@ -394,3 +402,16 @@ function save(): void {
}); });
} }
</script> </script>
<style scoped>
:deep(.editor-foot) {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
border-top: 1px solid rgb(var(--wh-border));
background: rgb(var(--wh-surface));
padding: 1rem 1.5rem;
box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.18);
}
</style>
+34 -49
View File
@@ -1,44 +1,27 @@
<template> <template>
<div class="mx-auto max-w-[760px] px-5 pb-20 pt-12"> <main class="legal-shell">
<header class="mb-7 flex flex-wrap items-center justify-between gap-4"> <header class="legal-header">
<NuxtLink <NuxtLink class="legal-brand" :to="q('/')"><AppLogo :size="28" /><span>WebHooker</span></NuxtLink>
class="text-base font-extrabold tracking-[-0.01em] text-text no-underline" <nav aria-label="Legal navigation">
:to="q('/terms')" <NuxtLink v-for="item in links" :key="item.key" :to="q(item.path)">
>Web<span class="text-accent">Hooker</span></NuxtLink <RcBadge :variant="active === item.key ? 'brand' : 'subtle'" size="sm">{{ item.label }}</RcBadge>
>
<nav class="flex gap-2">
<NuxtLink
class="rounded-full border border-transparent px-3.5 py-1.5 text-[13px] text-muted no-underline transition-colors hover:text-text"
:class="active === 'terms' ? 'border-accent-border bg-accent-dim text-accent' : ''"
:to="q('/terms')"
>
{{ t("服务条款", "Terms") }}
</NuxtLink>
<NuxtLink
class="rounded-full border border-transparent px-3.5 py-1.5 text-[13px] text-muted no-underline transition-colors hover:text-text"
:class="active === 'privacy' ? 'border-accent-border bg-accent-dim text-accent' : ''"
:to="q('/privacy')"
>
{{ t("隐私政策", "Privacy") }}
</NuxtLink> </NuxtLink>
</nav> </nav>
</header> </header>
<article <section class="legal-heading">
class="rounded-xl border border-border bg-surface px-10 py-9 shadow-[0_1px_3px_var(--shadow)]" <p>{{ t("WebHooker 服务规范", "WebHooker service policy") }}</p>
> <h1>{{ title }}</h1>
<h1 class="mb-1.5 text-[26px] font-extrabold tracking-[-0.02em]">{{ title }}</h1> <span>{{ t("最后更新", "Last updated") }} · {{ updated }}</span>
<p class="mb-6 text-[13px] text-muted">{{ t("最后更新", "Last updated") }}: {{ updated }}</p> </section>
<div class="legal-body" v-html="body" /> <RcCard variant="outline" padding="lg" class="legal-card"><article class="legal-body" v-html="body" /></RcCard>
</article> <footer class="legal-footer">
<footer class="mt-6 flex flex-wrap items-center justify-between gap-3"> <NuxtLink :to="q('/')">{{ t("返回首页", "Back to home") }}</NuxtLink>
<span class="text-[13px] text-muted">WebHooker · GitHub → Discord</span> <div class="legal-footer-actions">
<NuxtLink <ThemeToggle show-label />
class="rounded-full border border-border bg-surface px-3.5 py-1.5 text-[13px] text-muted no-underline transition-colors hover:text-text" <NuxtLink :to="altLink">{{ lang === "zh" ? "English" : "中文" }}</NuxtLink>
:to="altLink" </div>
>{{ lang === "zh" ? "English" : "中文" }}</NuxtLink
>
</footer> </footer>
</div> </main>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -46,23 +29,25 @@ import { computed } from "vue";
import { pickLang, type Lang } from "~/utils/legal"; import { pickLang, type Lang } from "~/utils/legal";
const props = defineProps<{ active: "terms" | "privacy"; title: string; body: string }>(); const props = defineProps<{ active: "terms" | "privacy"; title: string; body: string }>();
const route = useRoute(); const route = useRoute();
const config = useRuntimeConfig();
const lang = computed<Lang>(() => pickLang(String(route.query.lang ?? ""))); const lang = computed<Lang>(() => pickLang(String(route.query.lang ?? "")));
const altLang = computed(() => (lang.value === "zh" ? "en" : "zh")); const altLang = computed(() => (lang.value === "zh" ? "en" : "zh"));
const updated = computed(() => "2026-08-01"); const updated = "2026-08-01";
const t = (zh: string, en: string): string => (lang.value === "zh" ? zh : en); const t = (zh: string, en: string): string => (lang.value === "zh" ? zh : en);
const q = (p: string): string => `${p}?lang=${lang.value}`; const q = (path: string): string => `${path}?lang=${lang.value}`;
const altLink = computed(() => const links = computed(() => [
q(props.active === "terms" ? "/terms" : "/privacy").replace( { key: "terms" as const, path: "/terms", label: t("服务条款", "Terms") },
`lang=${lang.value}`, { key: "privacy" as const, path: "/privacy", label: t("隐私政策", "Privacy") },
`lang=${altLang.value}`, ]);
), const altLink = computed(() => `${props.active === "terms" ? "/terms" : "/privacy"}?lang=${altLang.value}`);
);
useHead({ title: `${props.title} · WebHooker` }); useHead({ title: `${props.title} · WebHooker` });
void config;
</script> </script>
<style scoped>
.legal-shell { position: relative; z-index: 1; width: min(100% - 2rem, 860px); margin: 0 auto; padding: 2rem 0 4rem; } .legal-header, .legal-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; } .legal-brand { display: inline-flex; align-items: center; gap: .6rem; color: rgb(var(--wh-text)); font-size: 1rem; font-weight: 800; text-decoration: none; letter-spacing: -.035em; } .legal-brand :deep(svg) { color: rgb(var(--wh-accent)); } nav { display: flex; gap: .35rem; } nav a { text-decoration: none; }
.legal-heading { max-width: 640px; padding: clamp(4rem, 11vw, 7rem) 0 clamp(2rem, 6vw, 3.5rem); } .legal-heading p { margin: 0 0 .75rem; color: rgb(var(--wh-accent)); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; } .legal-heading h1 { margin: 0; font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: -.06em; line-height: 1; } .legal-heading span { display: block; margin-top: 1rem; color: rgb(var(--wh-faint)); font-size: .78rem; }
.legal-card { box-shadow: 0 24px 60px rgb(var(--wh-text) / .06); } .legal-body :deep(h2) { margin: 2.25rem 0 .75rem; font-size: 1.1rem; letter-spacing: -.02em; } .legal-body :deep(h2:first-child) { margin-top: 0; } .legal-body :deep(p), .legal-body :deep(li) { color: rgb(var(--wh-body-text)); line-height: 1.8; } .legal-body :deep(a) { color: rgb(var(--wh-accent)); } .legal-body :deep(ul) { padding-left: 1.25rem; }
.legal-footer { margin-top: 1.5rem; color: rgb(var(--wh-muted)); font-size: .78rem; } .legal-footer-actions { display: flex; align-items: center; gap: .75rem; } .legal-footer a { color: inherit; text-decoration: none; } .legal-footer a:hover { color: rgb(var(--wh-accent)); }
@media (max-width: 520px) { .legal-shell { width: min(100% - 1.5rem, 860px); } .legal-header { align-items: flex-start; flex-direction: column; } }
</style>
+34 -35
View File
@@ -1,5 +1,5 @@
<template> <template>
<section class="members-panel"> <RcCard variant="outline" padding="md" class="members-panel">
<div class="panel-head"> <div class="panel-head">
<h3>{{ t("members.title") }}</h3> <h3>{{ t("members.title") }}</h3>
<span class="lbl-note">{{ t("members.note") }}</span> <span class="lbl-note">{{ t("members.note") }}</span>
@@ -10,46 +10,42 @@
<ul class="member-list"> <ul class="member-list">
<li v-for="m in members" :key="m.login.toLowerCase()" class="member-row"> <li v-for="m in members" :key="m.login.toLowerCase()" class="member-row">
<span class="member-login">{{ m.login }}</span> <span class="member-login">{{ m.login }}</span>
<select <RcSelect
v-if="canEdit" v-if="canEdit"
class="filter-select" class="filter-select"
:value="m.role" :model-value="m.role"
:options="roleOptions"
:disabled="saving" :disabled="saving"
@change="onRoleChange(m, $event)" @update:model-value="onRoleChange(m, $event)"
> />
<option value="owner">{{ t("roles.owner") }}</option> <RcBadge v-else size="xs" class="role-pill" :class="m.role">{{ t("roles." + m.role) }}</RcBadge>
<option value="admin">{{ t("roles.admin") }}</option> <RcButton
<option value="viewer">{{ t("roles.viewer") }}</option>
</select>
<span v-else class="role-pill" :class="m.role">{{ t("roles." + m.role) }}</span>
<button
v-if="canEdit" v-if="canEdit"
type="button"
variant="destructive"
size="icon"
class="icon-btn danger" class="icon-btn danger"
:disabled="saving" :disabled="saving"
:title="t('members.remove')" :title="t('members.remove')"
@click="removeMember(m)" @click="removeMember(m)"
> >
✕ ✕
</button> </RcButton>
</li> </li>
</ul> </ul>
<div v-if="canEdit" class="member-add"> <div v-if="canEdit" class="member-add">
<input <RcInput
v-model="newLogin" v-model="newLogin"
type="text" type="text"
:placeholder="t('members.addPlaceholder')" :placeholder="t('members.addPlaceholder')"
class="text-input" class="text-input"
@keydown.enter.prevent="addMember" @keydown.enter.prevent="addMember"
/> />
<select v-model="newRole" class="filter-select"> <RcSelect v-model="newRole" class="filter-select" :options="roleOptions" />
<option value="owner">{{ t("roles.owner") }}</option> <RcButton type="button" size="sm" :disabled="saving" @click="addMember">
<option value="admin">{{ t("roles.admin") }}</option>
<option value="viewer">{{ t("roles.viewer") }}</option>
</select>
<button class="btn btn-accent btn-sm" :disabled="saving" @click="addMember">
{{ t("members.addBtn") }} {{ t("members.addBtn") }}
</button> </RcButton>
</div> </div>
<div v-if="canEdit" class="invite-box"> <div v-if="canEdit" class="invite-box">
@@ -58,30 +54,27 @@
<span class="lbl-note">{{ t("members.inviteNote") }}</span> <span class="lbl-note">{{ t("members.inviteNote") }}</span>
</h4> </h4>
<div class="invite-create"> <div class="invite-create">
<select v-model="inviteRole" class="filter-select"> <RcSelect v-model="inviteRole" class="filter-select" :options="inviteRoleOptions" />
<option value="admin">{{ t("roles.admin") }}</option> <RcButton type="button" size="sm" :disabled="saving || inviting" @click="createInvite">
<option value="viewer">{{ t("roles.viewer") }}</option>
</select>
<button class="btn btn-accent btn-sm" :disabled="saving || inviting" @click="createInvite">
{{ t("members.createInvite") }} {{ t("members.createInvite") }}
</button> </RcButton>
</div> </div>
<ul v-if="invites.length" class="invite-list"> <ul v-if="invites.length" class="invite-list">
<li v-for="inv in invites" :key="inv.token" class="invite-row"> <li v-for="inv in invites" :key="inv.token" class="invite-row">
<code class="invite-token">{{ shortToken(inv.token) }}</code> <code class="invite-token">{{ shortToken(inv.token) }}</code>
<span class="role-pill" :class="inv.role">{{ t("roles." + inv.role) }}</span> <RcBadge size="xs" class="role-pill" :class="inv.role">{{ t("roles." + inv.role) }}</RcBadge>
<span class="invite-exp">{{ fmtExp(inv.expiresAt) }}</span> <span class="invite-exp">{{ fmtExp(inv.expiresAt) }}</span>
<button class="btn btn-ghost btn-sm" @click="copyInvite(inv)"> <RcButton type="button" variant="ghost" size="sm" @click="copyInvite(inv)">
{{ copied === inv.token ? t("members.copied") : t("members.copyLink") }} {{ copied === inv.token ? t("members.copied") : t("members.copyLink") }}
</button> </RcButton>
<button class="icon-btn danger" @click="revoke(inv)">{{ t("members.revoke") }}</button> <RcButton type="button" variant="destructive" size="sm" class="icon-btn danger" @click="revoke(inv)">{{ t("members.revoke") }}</RcButton>
</li> </li>
</ul> </ul>
<p v-else class="empty-log">{{ t("members.noInvites") }}</p> <p v-else class="empty-log">{{ t("members.noInvites") }}</p>
</div> </div>
<div class="err">{{ formError }}</div> <div class="err">{{ formError }}</div>
</section> </RcCard>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -103,6 +96,12 @@ const inviteRole = ref<"admin" | "viewer">("admin");
const inviting = ref(false); const inviting = ref(false);
const formError = ref(""); const formError = ref("");
const { copied, copy } = useCopy(2000); const { copied, copy } = useCopy(2000);
const roleOptions = computed(() => [
{ label: t("roles.owner"), value: "owner" },
{ label: t("roles.admin"), value: "admin" },
{ label: t("roles.viewer"), value: "viewer" },
]);
const inviteRoleOptions = computed(() => roleOptions.value.filter((option) => option.value !== "owner"));
watch( watch(
() => props.group, () => props.group,
@@ -122,13 +121,13 @@ function ownerCount(): number {
return members.value.filter((m) => m.role === "owner").length; return members.value.filter((m) => m.role === "owner").length;
} }
function onRoleChange(m: GroupMember, e: Event): void { function onRoleChange(m: GroupMember, role: string): void {
const role = (e.target as HTMLSelectElement).value as GroupRole; const nextRole = role as GroupRole;
if (role === "viewer" && m.role === "owner" && ownerCount() === 1) { if (nextRole === "viewer" && m.role === "owner" && ownerCount() === 1) {
formError.value = t("members.errLastOwner"); formError.value = t("members.errLastOwner");
return; return;
} }
m.role = role; m.role = nextRole;
emitSave(); emitSave();
} }
+36 -26
View File
@@ -3,7 +3,7 @@ import type { DeliveryMetrics, Group, MetricsBreakdown } from "~/types";
const { t } = useI18n(); const { t } = useI18n();
defineProps<{ const props = defineProps<{
metrics: DeliveryMetrics | null; metrics: DeliveryMetrics | null;
loading: boolean; loading: boolean;
error: string; error: string;
@@ -19,6 +19,11 @@ const emit = defineEmits<{
const sortBy = ref<"total" | "failed" | "rate">("total"); const sortBy = ref<"total" | "failed" | "rate">("total");
const groupOptions = computed(() => [
{ label: t("metrics.allGroups"), value: "all" },
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
]);
function pct(value: number): string { function pct(value: number): string {
return `${(value * 100).toFixed(1)}%`; return `${(value * 100).toFixed(1)}%`;
} }
@@ -28,8 +33,8 @@ function pctOf(count: number, total: number): string {
return `${((count / total) * 100).toFixed(0)}%`; return `${((count / total) * 100).toFixed(0)}%`;
} }
function onGroupFilter(e: Event): void { function onGroupFilter(value: string): void {
emit("update:selectedGroupId", (e.target as HTMLSelectElement).value); emit("update:selectedGroupId", value === "all" ? "" : value);
emit("filter"); emit("filter");
} }
@@ -113,40 +118,38 @@ function cycleSort(): void {
<span class="kpi-label">{{ t("metrics.title") }}</span> <span class="kpi-label">{{ t("metrics.title") }}</span>
<div class="log-filters"> <div class="log-filters">
<label class="filter-label">{{ t("metrics.filterGroup") }}</label> <label class="filter-label">{{ t("metrics.filterGroup") }}</label>
<select <RcSelect
class="filter-select" class="filter-select"
:value="selectedGroupId" :model-value="selectedGroupId || 'all'"
:options="groupOptions"
:disabled="loading" :disabled="loading"
@change="onGroupFilter" @update:model-value="onGroupFilter"
> />
<option value="">{{ t("metrics.allGroups") }}</option>
<option v-for="g in groups" :key="g.id" :value="g.id">
{{ g.name || g.id }}
</option>
</select>
</div> </div>
<button class="btn btn-ghost btn-sm" :disabled="loading" @click="emit('refresh')"> <RcButton variant="ghost" size="sm" :disabled="loading" @click="emit('refresh')">
{{ t("metrics.refresh") }} {{ t("metrics.refresh") }}
</button> </RcButton>
</div> </div>
<p v-if="error" class="err">{{ error }}</p> <p v-if="error" class="err">{{ error }}</p>
<p v-else-if="!loading && !metrics" class="empty-log">{{ t("metrics.empty") }}</p> <RcEmptyState v-else-if="!loading && !metrics" :title="t('metrics.empty')" class="empty-log" />
<template v-else-if="metrics"> <template v-else-if="metrics">
<div class="metric-kpis"> <div class="metric-kpis">
<div <RcCard
v-for="k in summary(metrics)" v-for="k in summary(metrics)"
:key="k.label" :key="k.label"
variant="outline"
padding="md"
class="metric-kpi" class="metric-kpi"
:class="TONE[k.tone] ?? ''" :class="TONE[k.tone] ?? ''"
> >
<span class="metric-kpi-value">{{ k.value }}</span> <span class="metric-kpi-value">{{ k.value }}</span>
<span class="metric-kpi-label">{{ k.label }}</span> <span class="metric-kpi-label">{{ k.label }}</span>
</div> </RcCard>
</div> </div>
<article v-if="metrics.byPlatform.length" class="metric-block"> <RcCard v-if="metrics.byPlatform.length" variant="outline" padding="md" class="metric-block">
<h3 class="metric-block-title">{{ t("metrics.byPlatform") }}</h3> <h3 class="metric-block-title">{{ t("metrics.byPlatform") }}</h3>
<div <div
v-for="r in rows(metrics.byPlatform, (r) => r.platform ?? 'unknown')" v-for="r in rows(metrics.byPlatform, (r) => r.platform ?? 'unknown')"
@@ -170,12 +173,14 @@ function cycleSort(): void {
</div> </div>
<span class="metric-total">{{ r.total }}</span> <span class="metric-total">{{ r.total }}</span>
</div> </div>
</article> </RcCard>
<article v-if="metrics.byEvent.length" class="metric-block"> <RcCard v-if="metrics.byEvent.length" variant="outline" padding="md" class="metric-block">
<div class="metric-block-head"> <div class="metric-block-head">
<h3 class="metric-block-title">{{ t("metrics.byEvent") }}</h3> <h3 class="metric-block-title">{{ t("metrics.byEvent") }}</h3>
<button class="metric-sort-toggle" @click="cycleSort">{{ sortLabel() }}</button> <RcButton variant="ghost" size="xs" class="metric-sort-toggle" @click="cycleSort">{{
sortLabel()
}}</RcButton>
</div> </div>
<div <div
v-for="r in rows(metrics.byEvent, (r) => r.event ?? 'unknown')" v-for="r in rows(metrics.byEvent, (r) => r.event ?? 'unknown')"
@@ -199,9 +204,9 @@ function cycleSort(): void {
</div> </div>
<span class="metric-total">{{ r.total }}</span> <span class="metric-total">{{ r.total }}</span>
</div> </div>
</article> </RcCard>
<article v-if="metrics.byStatus.length" class="metric-block"> <RcCard v-if="metrics.byStatus.length" variant="outline" padding="md" class="metric-block">
<h3 class="metric-block-title">{{ t("metrics.byStatus") }}</h3> <h3 class="metric-block-title">{{ t("metrics.byStatus") }}</h3>
<div class="metric-status-row"> <div class="metric-status-row">
<span <span
@@ -216,9 +221,14 @@ function cycleSort(): void {
{{ s.status }} · {{ s.count }} {{ s.status }} · {{ s.count }}
</span> </span>
</div> </div>
</article> </RcCard>
<article v-if="metrics.recentFailures.length" class="metric-block"> <RcCard
v-if="metrics.recentFailures.length"
variant="outline"
padding="md"
class="metric-block"
>
<h3 class="metric-block-title">{{ t("metrics.recentFailures") }}</h3> <h3 class="metric-block-title">{{ t("metrics.recentFailures") }}</h3>
<div <div
v-for="f in metrics.recentFailures" v-for="f in metrics.recentFailures"
@@ -232,7 +242,7 @@ function cycleSort(): void {
<span class="log-time">{{ f.target }}</span> <span class="log-time">{{ f.target }}</span>
</div> </div>
</div> </div>
</article> </RcCard>
</template> </template>
</div> </div>
</template> </template>
+32 -25
View File
@@ -1,20 +1,18 @@
<template> <template>
<article class="route-card" :class="{ disabled: !route.enabled }"> <RcCard variant="outline" padding="none" :class="cardClass">
<div class="route-card-main"> <div class="route-card-main">
<div class="route-card-header"> <div class="route-card-header">
<label v-if="!readonly" class="switch"> <RcSwitch v-if="!readonly" :model-value="route.enabled" size="sm" @update:model-value="onToggle" />
<input type="checkbox" :checked="route.enabled" @change="onToggle" />
<span class="track"></span>
</label>
<span v-if="readonly" class="dot" :class="route.enabled ? 'ok' : 'bad'"></span> <span v-if="readonly" class="dot" :class="route.enabled ? 'ok' : 'bad'"></span>
<div class="route-card-title"> <div class="route-card-title">
<span class="route-name">{{ route.name || t("route.untitled") }}</span> <span class="route-name">{{ route.name || t("route.untitled") }}</span>
<span class="route-id">{{ route.id }}</span> <span class="route-id">{{ route.id }}</span>
</div> </div>
<div class="route-card-badges"> <div class="route-card-badges">
<span <RcBadge
v-for="(tg, i) in route.targets" v-for="(tg, i) in route.targets"
:key="i" :key="i"
size="xs"
class="route-badge" class="route-badge"
:class=" :class="
tg.platform === 'telegram' tg.platform === 'telegram'
@@ -41,14 +39,10 @@
? t("route.feishu") ? t("route.feishu")
: "Discord" : "Discord"
}} }}
</span> </RcBadge>
<span v-if="route.fallback" class="route-badge route-badge-fallback">{{ <RcBadge v-if="route.fallback" variant="warning" size="xs" class="route-badge route-badge-fallback">{{ t("route.fallback") }}</RcBadge>
t("route.fallback") <RcBadge v-if="route.stop" variant="destructive" size="xs" class="route-badge route-badge-stop">{{ t("route.stop") }}</RcBadge>
}}</span> <RcBadge v-if="route.discordRoleIds?.length" size="xs" class="route-badge route-badge-role">@roles</RcBadge>
<span v-if="route.stop" class="route-badge route-badge-stop">{{ t("route.stop") }}</span>
<span v-if="route.discordRoleIds?.length" class="route-badge route-badge-role"
>@roles</span
>
</div> </div>
</div> </div>
@@ -84,7 +78,10 @@
</div> </div>
<div v-if="!readonly" class="route-card-actions"> <div v-if="!readonly" class="route-card-actions">
<button <RcButton
type="button"
variant="ghost"
size="icon"
class="route-action-btn" class="route-action-btn"
:disabled="atFirst" :disabled="atFirst"
:title="t('route.moveUp')" :title="t('route.moveUp')"
@@ -102,8 +99,11 @@
> >
<path d="m18 15-6-6-6 6" /> <path d="m18 15-6-6-6 6" />
</svg> </svg>
</button> </RcButton>
<button <RcButton
type="button"
variant="ghost"
size="icon"
class="route-action-btn" class="route-action-btn"
:disabled="atLast" :disabled="atLast"
:title="t('route.moveDown')" :title="t('route.moveDown')"
@@ -121,8 +121,11 @@
> >
<path d="m6 9 6 6 6-6" /> <path d="m6 9 6 6 6-6" />
</svg> </svg>
</button> </RcButton>
<button <RcButton
type="button"
variant="ghost"
size="icon"
class="route-action-btn" class="route-action-btn"
:title="t('routeEditor.editTitle')" :title="t('routeEditor.editTitle')"
@click="$emit('edit', route)" @click="$emit('edit', route)"
@@ -140,8 +143,11 @@
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" /> <path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" />
<path d="m15 5 4 4" /> <path d="m15 5 4 4" />
</svg> </svg>
</button> </RcButton>
<button <RcButton
type="button"
variant="destructive"
size="icon"
class="route-action-btn route-action-btn-danger" class="route-action-btn route-action-btn-danger"
:title="t('routeEditor.close')" :title="t('routeEditor.close')"
@click="$emit('delete', route)" @click="$emit('delete', route)"
@@ -159,9 +165,9 @@
<path d="M18 6 6 18" /> <path d="M18 6 6 18" />
<path d="m6 6 12 12" /> <path d="m6 6 12 12" />
</svg> </svg>
</button> </RcButton>
</div> </div>
</article> </RcCard>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -181,6 +187,7 @@ const summary = computed(() => {
const node: FilterNode = props.route.ast ?? { all: props.route.filters }; const node: FilterNode = props.route.ast ?? { all: props.route.filters };
return describeNode(node, t); return describeNode(node, t);
}); });
const cardClass = computed(() => `route-card${props.route.enabled ? "" : " disabled"}`);
const emit = defineEmits<{ const emit = defineEmits<{
(e: "toggle", route: Route): void; (e: "toggle", route: Route): void;
(e: "edit", route: Route): void; (e: "edit", route: Route): void;
@@ -188,8 +195,8 @@ const emit = defineEmits<{
(e: "move", route: Route, dir: -1 | 1): void; (e: "move", route: Route, dir: -1 | 1): void;
}>(); }>();
function onToggle(event: Event): void { function onToggle(enabled: boolean): void {
const next = { ...props.route, enabled: (event.target as HTMLInputElement).checked }; const next = { ...props.route, enabled };
emit("toggle", next); emit("toggle", next);
} }
</script> </script>
+254 -230
View File
@@ -29,6 +29,16 @@ const emit = defineEmits<{ (e: "close"): void; (e: "save", route: Route): void }
const { t } = useI18n(); const { t } = useI18n();
const isEdit = computed(() => props.route != null); const isEdit = computed(() => props.route != null);
const discordRoles = computed({
get: () =>
form.discordRolesText
.split(",")
.map((role) => role.trim())
.filter(Boolean),
set: (roles: string[]) => {
form.discordRolesText = roles.join(", ");
},
});
const filterError = ref(""); const filterError = ref("");
const targetError = ref(""); const targetError = ref("");
const formError = ref(""); const formError = ref("");
@@ -188,6 +198,10 @@ function close(): void {
emit("close"); emit("close");
} }
function onOpenChange(open: boolean): void {
if (!open) close();
}
async function runTest(): Promise<void> { async function runTest(): Promise<void> {
testError.value = ""; testError.value = "";
testResult.value = null; testResult.value = null;
@@ -315,237 +329,247 @@ watch(
</script> </script>
<template> <template>
<Teleport to="body"> <RcDialog
<Transition name="fade"> :open="open"
<div v-if="open" class="overlay" @click.self="close" /> :title="isEdit ? t('routeEditor.editTitle') : t('routeEditor.newTitle')"
</Transition> class="editor-dialog flex flex-col gap-0 max-h-[calc(100dvh-2rem)] overflow-hidden p-0 max-w-3xl"
<Transition name="slide"> @update:open="onOpenChange"
<aside v-if="open" class="editor" role="dialog" aria-modal="true"> >
<div class="editor-head"> <template #header>
<div class="editor-heading"> <div class="editor-head">
<span class="editor-eyebrow">{{ t("routeEditor.eyebrow") }}</span> <div class="editor-heading">
<h2>{{ isEdit ? t("routeEditor.editTitle") : t("routeEditor.newTitle") }}</h2> <span class="editor-eyebrow">{{ t("routeEditor.eyebrow") }}</span>
<h2>{{ isEdit ? t("routeEditor.editTitle") : t("routeEditor.newTitle") }}</h2>
</div>
</div>
</template>
<form class="editor-body" @submit.prevent="save">
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionBasic") }}</h3>
<div v-if="!isEdit" class="templates">
<RcButton
v-for="tmpl in ROUTE_TEMPLATES"
:key="tmpl.id"
type="button"
variant="ghost"
size="sm"
:class="form.id === tmpl.id ? 'template-chip active' : 'template-chip'"
@click="applyTemplate(tmpl)"
>
{{ t(tmpl.nameKey) }}
</RcButton>
</div>
<div class="field">
<label>{{ t("routeEditor.name") }}</label>
<RcInput v-model="form.name" :placeholder="t('routeEditor.namePlaceholder')" required />
</div>
<div class="field">
<label>{{ t("routeEditor.id") }}</label>
<RcInput v-model="form.id" placeholder="my-route" required />
<div class="hint">{{ t("routeEditor.idHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionOptions") }}</h3>
<div class="field inline">
<RcSwitch v-model="form.enabled" :label="t('routeEditor.enabled')" />
</div>
<div class="field inline">
<RcCheckbox v-model="form.fallback" :label="t('routeEditor.fallback')" />
<span class="lbl-note">{{ t("routeEditor.fallbackHint") }}</span>
</div>
<div class="field inline">
<RcCheckbox v-model="form.stop" :label="t('routeEditor.stop')" />
<span class="lbl-note">{{ t("routeEditor.stopHint") }}</span>
</div>
<div class="field">
<label>{{ t("routeEditor.discordRoles") }}</label>
<RcTagInput
v-model="discordRoles"
separator=","
:placeholder="t('routeEditor.discordRolesPlaceholder')"
/>
<div class="hint">{{ t("routeEditor.discordRolesHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionFilters") }}</h3>
<div class="field">
<label>{{ t("routeEditor.filters") }}</label>
</div>
<div class="field">
<FilterNodeEditor :node="root" />
</div>
<div v-if="filterError" class="err">{{ filterError }}</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.testMatch") }}</h3>
<div class="field">
<RcInput v-model="testEvent" :placeholder="t('routeEditor.testEvent')" />
</div>
<div class="field">
<RcTextarea
v-model="testPayload"
class="test-payload"
:rows="6"
:placeholder="t('routeEditor.testPayloadPlaceholder')"
/>
</div>
<div class="field">
<RcButton type="button" variant="ghost" :loading="testing" @click="runTest">
{{ testing ? "…" : t("routeEditor.testRun") }}
</RcButton>
</div>
<div v-if="testResult" class="test-result" :class="{ ok: testResult.matched }">
<span class="test-badge">
{{
testResult.matched ? t("routeEditor.testMatched") : t("routeEditor.testNotMatched")
}}
</span>
<span class="test-explanation">{{ testResult.explanation }}</span>
</div>
<div v-if="testError" class="err">{{ testError }}</div>
</section>
<section v-if="groupId" class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.fragments") }}</h3>
<div class="fragments-presets">
<span class="hint">{{ t("routeEditor.fragmentsPresets") }}</span>
<div v-for="preset in FRAGMENT_PRESETS" :key="preset.id" class="fragment-row">
<span class="fragment-name">{{ t(preset.nameKey) }}</span>
<RcButton
type="button"
variant="ghost"
size="sm"
class="fragment-action"
@click="insertNode(preset.node)"
>
{{ t("routeEditor.fragmentsInsert") }}
</RcButton>
</div> </div>
<button class="icon-btn" :title="t('routeEditor.close')" @click="close">✕</button>
</div> </div>
<div class="fragments-list">
<form class="editor-body" @submit.prevent="save"> <div v-if="!fragments.length" class="hint">{{ t("routeEditor.fragmentsEmpty") }}</div>
<section class="editor-section"> <div v-for="frag in fragments" :key="frag.id" class="fragment-row">
<h3 class="editor-section-title">{{ t("routeEditor.sectionBasic") }}</h3> <span class="fragment-name">{{ frag.name }}</span>
<div v-if="!isEdit" class="templates"> <RcButton
<button type="button"
v-for="tmpl in ROUTE_TEMPLATES" variant="ghost"
:key="tmpl.id" size="sm"
type="button" class="fragment-action"
class="template-chip" @click="insertFragment(frag)"
:class="{ active: form.id === tmpl.id }" >
@click="applyTemplate(tmpl)" {{ t("routeEditor.fragmentsInsert") }}
> </RcButton>
{{ t(tmpl.nameKey) }} <RcButton
</button> type="button"
</div> variant="destructive"
<div class="field"> size="icon"
<label>{{ t("routeEditor.name") }}</label> :title="t('routeEditor.fragmentsDelete')"
<input @click="deleteFragment(frag)"
v-model="form.name" >
class="input" ✕
:placeholder="t('routeEditor.namePlaceholder')" </RcButton>
required </div>
/>
</div>
<div class="field">
<label>{{ t("routeEditor.id") }}</label>
<input v-model="form.id" class="input" placeholder="my-route" required />
<div class="hint">{{ t("routeEditor.idHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionOptions") }}</h3>
<div class="field inline">
<input v-model="form.enabled" type="checkbox" />
<span>{{ t("routeEditor.enabled") }}</span>
</div>
<div class="field inline">
<input v-model="form.fallback" type="checkbox" />
<span>
{{ t("routeEditor.fallback") }}
<span class="lbl-note">{{ t("routeEditor.fallbackHint") }}</span>
</span>
</div>
<div class="field inline">
<input v-model="form.stop" type="checkbox" />
<span>
{{ t("routeEditor.stop") }}
<span class="lbl-note">{{ t("routeEditor.stopHint") }}</span>
</span>
</div>
<div class="field">
<label>{{ t("routeEditor.discordRoles") }}</label>
<input
v-model="form.discordRolesText"
class="input"
:placeholder="t('routeEditor.discordRolesPlaceholder')"
/>
<div class="hint">{{ t("routeEditor.discordRolesHint") }}</div>
</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionFilters") }}</h3>
<div class="field">
<label>{{ t("routeEditor.filters") }}</label>
</div>
<div class="field">
<FilterNodeEditor :node="root" />
</div>
<div v-if="filterError" class="err">{{ filterError }}</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.testMatch") }}</h3>
<div class="field">
<input v-model="testEvent" class="input" :placeholder="t('routeEditor.testEvent')" />
</div>
<div class="field">
<textarea
v-model="testPayload"
class="input test-payload"
rows="6"
:placeholder="t('routeEditor.testPayloadPlaceholder')"
/>
</div>
<div class="field">
<button type="button" class="btn btn-ghost" :disabled="testing" @click="runTest">
{{ testing ? "…" : t("routeEditor.testRun") }}
</button>
</div>
<div v-if="testResult" class="test-result" :class="{ ok: testResult.matched }">
<span class="test-badge">
{{
testResult.matched
? t("routeEditor.testMatched")
: t("routeEditor.testNotMatched")
}}
</span>
<span class="test-explanation">{{ testResult.explanation }}</span>
</div>
<div v-if="testError" class="err">{{ testError }}</div>
</section>
<section v-if="groupId" class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.fragments") }}</h3>
<div class="fragments-presets">
<span class="hint">{{ t("routeEditor.fragmentsPresets") }}</span>
<div v-for="preset in FRAGMENT_PRESETS" :key="preset.id" class="fragment-row">
<span class="fragment-name">{{ t(preset.nameKey) }}</span>
<button
type="button"
class="btn btn-ghost fragment-action"
@click="insertNode(preset.node)"
>
{{ t("routeEditor.fragmentsInsert") }}
</button>
</div>
</div>
<div class="fragments-list">
<div v-if="!fragments.length" class="hint">{{ t("routeEditor.fragmentsEmpty") }}</div>
<div v-for="frag in fragments" :key="frag.id" class="fragment-row">
<span class="fragment-name">{{ frag.name }}</span>
<button
type="button"
class="btn btn-ghost fragment-action"
@click="insertFragment(frag)"
>
{{ t("routeEditor.fragmentsInsert") }}
</button>
<button
type="button"
class="icon-btn danger"
:title="t('routeEditor.fragmentsDelete')"
@click="deleteFragment(frag)"
>
✕
</button>
</div>
</div>
<div class="field fragment-save">
<input
v-model="fragmentName"
class="input"
:placeholder="t('routeEditor.fragmentsNamePlaceholder')"
/>
<button type="button" class="btn btn-ghost" @click="saveAsFragment">
{{ t("routeEditor.fragmentsSave") }}
</button>
</div>
<div v-if="fragmentError" class="err">{{ fragmentError }}</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionTargets") }}</h3>
<div v-for="(tg, i) in form.targets" :key="i" class="target-row">
<select v-model="tg.platform" class="tg-select">
<option value="discord">Discord</option>
<option value="telegram">Telegram</option>
<option value="feishu">{{ t("routeEditor.platformFeishu") }}</option>
</select>
<template v-if="tg.platform === 'discord'">
<input
v-model="tg.channelId"
class="input tg-in1"
:placeholder="t('routeEditor.channelPlaceholder')"
/>
<input
v-model="tg.threadId"
class="input tg-in2"
:placeholder="t('routeEditor.threadPlaceholder')"
/>
</template>
<template v-else-if="tg.platform === 'telegram'">
<input
v-model="tg.chatId"
class="input tg-in1"
:placeholder="t('routeEditor.chatPlaceholder')"
/>
<input
v-model="tg.topicId"
class="input tg-in2"
:placeholder="t('routeEditor.topicPlaceholder')"
/>
</template>
<template v-else>
<input
v-model="tg.chatId"
class="input tg-in1"
:placeholder="t('routeEditor.feishuChatPlaceholder')"
/>
</template>
<button
type="button"
class="icon-btn danger tg-del"
:title="t('routeEditor.remove')"
@click="form.targets.splice(i, 1)"
>
✕
</button>
</div>
<button type="button" class="btn btn-ghost add-filter" @click="addTarget">
{{ t("routeEditor.addTarget") }}
</button>
<div v-if="targetError" class="err">{{ targetError }}</div>
</section>
<div v-if="formError" class="err">{{ formError }}</div>
</form>
<div class="editor-foot">
<button class="btn btn-ghost" @click="close">{{ t("routeEditor.cancel") }}</button>
<button class="btn btn-accent" :disabled="saving" @click="save">
{{ t("routeEditor.save") }}
</button>
</div> </div>
</aside> <div class="field fragment-save">
</Transition> <RcInput
</Teleport> v-model="fragmentName"
:placeholder="t('routeEditor.fragmentsNamePlaceholder')"
/>
<RcButton type="button" variant="ghost" @click="saveAsFragment">
{{ t("routeEditor.fragmentsSave") }}
</RcButton>
</div>
<div v-if="fragmentError" class="err">{{ fragmentError }}</div>
</section>
<section class="editor-section">
<h3 class="editor-section-title">{{ t("routeEditor.sectionTargets") }}</h3>
<div v-for="(tg, i) in form.targets" :key="i" class="target-row">
<RcSelect
v-model="tg.platform"
class="[grid-area:select]"
:options="[
{ label: 'Discord', value: 'discord' },
{ label: 'Telegram', value: 'telegram' },
{ label: t('routeEditor.platformFeishu'), value: 'feishu' },
]"
/>
<template v-if="tg.platform === 'discord'">
<RcInput
v-model="tg.channelId"
class="[grid-area:in1]"
:placeholder="t('routeEditor.channelPlaceholder')"
/>
<RcInput
v-model="tg.threadId"
class="[grid-area:in2]"
:placeholder="t('routeEditor.threadPlaceholder')"
/>
</template>
<template v-else-if="tg.platform === 'telegram'">
<RcInput
v-model="tg.chatId"
class="[grid-area:in1]"
:placeholder="t('routeEditor.chatPlaceholder')"
/>
<RcInput
v-model="tg.topicId"
class="[grid-area:in2]"
:placeholder="t('routeEditor.topicPlaceholder')"
/>
</template>
<template v-else>
<RcInput
v-model="tg.chatId"
class="[grid-area:in1]"
:placeholder="t('routeEditor.feishuChatPlaceholder')"
/>
</template>
<RcButton
type="button"
variant="destructive"
size="icon"
class="[grid-area:del] justify-self-end"
:title="t('routeEditor.remove')"
@click="form.targets.splice(i, 1)"
>
✕
</RcButton>
</div>
<RcButton type="button" variant="ghost" class="add-filter" @click="addTarget">
{{ t("routeEditor.addTarget") }}
</RcButton>
<div v-if="targetError" class="err">{{ targetError }}</div>
</section>
<div v-if="formError" class="err">{{ formError }}</div>
</form>
<template #footer>
<div class="editor-foot">
<RcButton variant="ghost" @click="close">{{ t("routeEditor.cancel") }}</RcButton>
<RcButton variant="primary" :loading="saving" @click="save">
{{ t("routeEditor.save") }}
</RcButton>
</div>
</template>
</RcDialog>
</template> </template>
<style scoped>
:deep(.editor-foot) {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
border-top: 1px solid rgb(var(--wh-border));
background: rgb(var(--wh-surface));
padding: 1rem 1.5rem;
box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.18);
}
</style>
+39 -36
View File
@@ -4,25 +4,21 @@
<span class="kpi-label">{{ t("logs.lastSends", { n: logs.length }) }}</span> <span class="kpi-label">{{ t("logs.lastSends", { n: logs.length }) }}</span>
<div class="log-filters"> <div class="log-filters">
<label class="filter-label">{{ t("logs.filterGroup") }}</label> <label class="filter-label">{{ t("logs.filterGroup") }}</label>
<select <RcSelect
class="filter-select" class="filter-select"
:value="selectedGroupId" :model-value="selectedGroupId || 'all'"
:options="groupOptions"
:disabled="loading" :disabled="loading"
@change="onGroupFilter" @update:model-value="onGroupFilter"
> />
<option value="">{{ t("logs.allGroups") }}</option>
<option v-for="g in groups" :key="g.id" :value="g.id">
{{ g.name || g.id }}
</option>
</select>
</div> </div>
<button class="btn btn-ghost btn-sm" :disabled="loading" @click="refresh"> <RcButton variant="ghost" size="sm" :disabled="loading" @click="refresh">
{{ t("logs.refresh") }} {{ t("logs.refresh") }}
</button> </RcButton>
</div> </div>
<p v-if="error" class="err">{{ error }}</p> <p v-if="error" class="err">{{ error }}</p>
<p v-else-if="!loading && !logs.length" class="empty-log">{{ t("logs.empty") }}</p> <RcEmptyState v-else-if="!loading && !logs.length" :title="t('logs.empty')" class="empty-log" />
<div class="log-list"> <div class="log-list">
<article <article
@@ -55,30 +51,28 @@
</article> </article>
</div> </div>
<div v-if="detailOpen" class="modal-overlay" @click.self="closeDetail"> <RcDialog
<div class="log-detail"> :open="detailOpen"
<div class="detail-head"> :title="t('logs.detailTitle')"
<h3>{{ t("logs.detailTitle") }}</h3> class="log-detail"
<button class="icon-btn" @click="closeDetail">✕</button> @update:open="onDetailOpenChange"
</div> >
<div v-if="detailLoading" class="flex justify-center py-8"><RcSpinner size="sm" /></div>
<p v-else-if="detailError" class="err">{{ detailError }}</p>
<p v-if="detailLoading" class="empty-log">{{ t("status.loading") }}</p> <dl v-else-if="detail" class="detail-grid">
<p v-else-if="detailError" class="err">{{ detailError }}</p> <template v-for="row in detailRows" :key="row.label">
<dt>{{ row.label }}</dt>
<dd>
<pre v-if="row.block" class="log-block">{{ row.value }}</pre>
<code v-else-if="row.code">{{ row.value }}</code>
<span v-else>{{ row.value }}</span>
</dd>
</template>
</dl>
<dl v-else-if="detail" class="detail-grid"> <p v-else class="err">{{ t("logs.detailMissing") }}</p>
<template v-for="row in detailRows" :key="row.label"> </RcDialog>
<dt>{{ row.label }}</dt>
<dd>
<pre v-if="row.block" class="log-block">{{ row.value }}</pre>
<code v-else-if="row.code">{{ row.value }}</code>
<span v-else>{{ row.value }}</span>
</dd>
</template>
</dl>
<p v-else class="err">{{ t("logs.detailMissing") }}</p>
</div>
</div>
</div> </div>
</template> </template>
@@ -106,6 +100,11 @@ const detail = ref<SendRecord | null>(null);
const detailLoading = ref(false); const detailLoading = ref(false);
const detailError = ref(""); const detailError = ref("");
const groupOptions = computed(() => [
{ label: t("logs.allGroups"), value: "all" },
...props.groups.map((g) => ({ label: g.name || g.id, value: g.id })),
]);
const detailRows = computed(() => { const detailRows = computed(() => {
const l = detail.value; const l = detail.value;
if (!l) return [] as Array<{ label: string; value: string; code?: boolean; block?: boolean }>; if (!l) return [] as Array<{ label: string; value: string; code?: boolean; block?: boolean }>;
@@ -142,8 +141,8 @@ function refresh(): void {
emit("refresh"); emit("refresh");
} }
function onGroupFilter(e: Event): void { function onGroupFilter(value: string): void {
emit("update:selectedGroupId", (e.target as HTMLSelectElement).value); emit("update:selectedGroupId", value === "all" ? "" : value);
emit("filter"); emit("filter");
} }
@@ -166,4 +165,8 @@ function closeDetail(): void {
detailOpen.value = false; detailOpen.value = false;
detail.value = null; detail.value = null;
} }
function onDetailOpenChange(open: boolean): void {
if (!open) closeDetail();
}
</script> </script>
+8 -61
View File
@@ -1,68 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue";
const props = defineProps<{ modelValue: string[]; placeholder?: string }>(); const props = defineProps<{ modelValue: string[]; placeholder?: string }>();
const emit = defineEmits<{ (e: "update:modelValue", value: string[]): void }>(); const emit = defineEmits<{ (e: "update:modelValue", value: string[]): void }>();
const text = ref("");
function add(value: string) {
const v = value.trim();
if (!v) return;
if (props.modelValue.includes(v)) return;
emit("update:modelValue", [...props.modelValue, v]);
}
function onKeydown(e: KeyboardEvent) {
if (e.key === "Enter" || e.key === ",") {
e.preventDefault();
add(text.value);
text.value = "";
} else if (e.key === "Backspace" && text.value === "" && props.modelValue.length > 0) {
emit("update:modelValue", props.modelValue.slice(0, -1));
}
}
function onBlur() {
if (text.value) {
add(text.value);
text.value = "";
}
}
function remove(index: number) {
const next = [...props.modelValue];
next.splice(index, 1);
emit("update:modelValue", next);
}
</script> </script>
<template> <template>
<div <RcTagInput
class="flex flex-wrap items-center gap-1 rounded-md border border-border bg-surface/60 px-2 py-1.5 focus-within:border-accent" :model-value="props.modelValue"
> :placeholder="props.placeholder"
<span separator=","
v-for="(v, i) in modelValue" unique
:key="`${v}-${i}`" size="sm"
class="inline-flex items-center gap-1 rounded bg-accent/15 px-2 py-0.5 text-xs text-accent" @update:model-value="emit('update:modelValue', $event)"
> />
{{ v }}
<button
type="button"
class="text-accent/70 hover:text-accent"
:aria-label="'remove'"
@click="remove(i)"
>
&times;
</button>
</span>
<input
v-model="text"
type="text"
class="min-w-[8rem] flex-1 bg-transparent text-sm text-text outline-none placeholder:text-text/40"
:placeholder="placeholder"
@keydown="onKeydown"
@blur="onBlur"
/>
</div>
</template> </template>
+79
View File
@@ -0,0 +1,79 @@
<template>
<button
type="button"
class="theme-toggle-btn"
:title="label"
:aria-label="label"
@click="cycleTheme"
>
<component :is="currentIcon" :size="size" />
<span v-if="showLabel" class="theme-label">{{ shortLabel }}</span>
</button>
</template>
<script setup lang="ts">
import { Laptop, Moon, Sun } from "lucide-vue-next";
import { computed } from "vue";
import { useTheme } from "~/composables/useTheme";
const props = withDefaults(
defineProps<{
size?: number;
showLabel?: boolean;
compact?: boolean;
}>(),
{
size: 16,
showLabel: false,
compact: false,
},
);
const { theme, cycleTheme } = useTheme();
const currentIcon = computed(() => {
if (theme.value === "light") return Sun;
if (theme.value === "dark") return Moon;
return Laptop;
});
const label = computed(() => {
if (theme.value === "light") return "浅色模式 (点击切换为深色)";
if (theme.value === "dark") return "深色模式 (点击切换为跟随系统)";
return "跟随系统 (点击切换为浅色)";
});
const shortLabel = computed(() => {
if (theme.value === "light") return "浅色";
if (theme.value === "dark") return "深色";
return "自动";
});
</script>
<style scoped>
.theme-toggle-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.35rem;
padding: 0.4rem 0.55rem;
border-radius: 9999px;
border: 1px solid rgb(var(--wh-border));
background: rgb(var(--wh-surface));
color: rgb(var(--wh-muted));
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
transition: all 150ms ease;
}
.theme-toggle-btn:hover {
border-color: rgb(var(--wh-accent));
color: rgb(var(--wh-text));
background: rgb(var(--wh-surface-2));
}
.theme-label {
font-size: 0.75rem;
}
</style>
+16 -12
View File
@@ -1,5 +1,5 @@
<template> <template>
<section class="members-panel webhook-panel"> <RcCard variant="outline" padding="md" class="members-panel webhook-panel">
<div class="panel-head"> <div class="panel-head">
<h3>{{ t("webhook.title") }}</h3> <h3>{{ t("webhook.title") }}</h3>
<span class="lbl-note">{{ t("webhook.note") }}</span> <span class="lbl-note">{{ t("webhook.note") }}</span>
@@ -11,9 +11,9 @@
<div class="wh-row"> <div class="wh-row">
<span class="wh-label">{{ t("webhook.url") }}</span> <span class="wh-label">{{ t("webhook.url") }}</span>
<code class="wh-value">{{ info.url }}</code> <code class="wh-value">{{ info.url }}</code>
<button class="btn btn-ghost btn-sm" @click="copy(info.url, 'url')"> <RcButton type="button" variant="ghost" size="sm" @click="copy(info.url, 'url')">
{{ copied === "url" ? t("webhook.copied") : t("webhook.copy") }} {{ copied === "url" ? t("webhook.copied") : t("webhook.copy") }}
</button> </RcButton>
</div> </div>
<div class="wh-row"> <div class="wh-row">
@@ -21,28 +21,32 @@
<code class="wh-value">{{ <code class="wh-value">{{
info.secret ? info.secret : info.hasSecret ? maskedSecret : t("webhook.noSecret") info.secret ? info.secret : info.hasSecret ? maskedSecret : t("webhook.noSecret")
}}</code> }}</code>
<button <RcButton
v-if="info.secret" v-if="info.secret"
class="btn btn-ghost btn-sm" type="button"
variant="ghost"
size="sm"
@click="copy(info.secret!, 'secret')" @click="copy(info.secret!, 'secret')"
> >
{{ copied === "secret" ? t("webhook.copied") : t("webhook.copy") }} {{ copied === "secret" ? t("webhook.copied") : t("webhook.copy") }}
</button> </RcButton>
</div> </div>
<p v-if="info.hasSecret && !info.secret" class="hint">{{ t("webhook.secretHidden") }}</p> <p v-if="info.hasSecret && !info.secret" class="hint">{{ t("webhook.secretHidden") }}</p>
<div class="wh-actions"> <div class="wh-actions">
<button class="btn btn-accent btn-sm" :disabled="busy" @click="onRegenerate"> <RcButton type="button" size="sm" :disabled="busy" @click="onRegenerate">
{{ info.hasSecret ? t("webhook.regenerate") : t("webhook.generate") }} {{ info.hasSecret ? t("webhook.regenerate") : t("webhook.generate") }}
</button> </RcButton>
<button <RcButton
v-if="info.hasSecret" v-if="info.hasSecret"
class="btn btn-ghost btn-sm" type="button"
variant="ghost"
size="sm"
:disabled="busy" :disabled="busy"
@click="onDisable" @click="onDisable"
> >
{{ t("webhook.disable") }} {{ t("webhook.disable") }}
</button> </RcButton>
</div> </div>
<details class="wh-usage"> <details class="wh-usage">
@@ -55,7 +59,7 @@
</template> </template>
<div class="err">{{ error }}</div> <div class="err">{{ error }}</div>
</section> </RcCard>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
+12
View File
@@ -25,6 +25,11 @@ const en: Dict = {
"overview.recent": "Recent deliveries", "overview.recent": "Recent deliveries",
"overview.viewAll": "View all", "overview.viewAll": "View all",
"overview.refreshed": "Refreshed", "overview.refreshed": "Refreshed",
"overview.thRoute": "Route",
"overview.thGroup": "Group",
"overview.thEvents": "Events",
"overview.thTargets": "Targets",
"overview.thState": "State",
"metrics.refresh": "Refresh", "metrics.refresh": "Refresh",
"metrics.total": "Total", "metrics.total": "Total",
"metrics.ok": "OK", "metrics.ok": "OK",
@@ -412,6 +417,11 @@ const zh: Dict = {
"overview.recent": "最近投递", "overview.recent": "最近投递",
"overview.viewAll": "查看全部", "overview.viewAll": "查看全部",
"overview.refreshed": "已刷新", "overview.refreshed": "已刷新",
"overview.thRoute": "路由",
"overview.thGroup": "分组",
"overview.thEvents": "事件",
"overview.thTargets": "目标",
"overview.thState": "状态",
"metrics.refresh": "刷新", "metrics.refresh": "刷新",
"metrics.total": "总计", "metrics.total": "总计",
"metrics.ok": "成功", "metrics.ok": "成功",
@@ -511,6 +521,8 @@ const zh: Dict = {
"webhook.usageGitea": "Gitea:仓库 Settings → Webhooks → Add Webhook,填写同样的 URL 和 secret。", "webhook.usageGitea": "Gitea:仓库 Settings → Webhooks → Add Webhook,填写同样的 URL 和 secret。",
"webhook.usageCustom": "webhook.usageCustom":
"自定义:用 X-WebHooker-Signature(sha256 HMAC)签名任意 JSON 后 POST。创建一条 event = custom 的路由即可接收:", "自定义:用 X-WebHooker-Signature(sha256 HMAC)签名任意 JSON 后 POST。创建一条 event = custom 的路由即可接收:",
"groups.empty": "暂无分组。分组可按组织或用户划分路由并分配管理权限。",
"groups.createFirst": "创建第一个分组",
"groups.admins": "管理员", "groups.admins": "管理员",
"groups.owners": "来源", "groups.owners": "来源",
"groups.members": "成员", "groups.members": "成员",
+88
View File
@@ -0,0 +1,88 @@
import { onMounted, readonly, ref } from "vue";
export type ThemePreference = "auto" | "light" | "dark";
const STORAGE_KEY = "wh-theme";
const theme = ref<ThemePreference>("auto");
const isDark = ref(false);
let initialized = false;
function resolveSystemDark(): boolean {
if (typeof window === "undefined") return false;
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
}
function applyTheme(targetTheme: ThemePreference) {
if (typeof document === "undefined") return;
const root = document.documentElement;
const darkActive = targetTheme === "dark" || (targetTheme === "auto" && resolveSystemDark());
isDark.value = darkActive;
if (darkActive) {
root.classList.add("dark");
root.setAttribute("data-theme", "dark");
} else {
root.classList.remove("dark");
if (targetTheme === "light") {
root.setAttribute("data-theme", "light");
} else {
root.removeAttribute("data-theme");
}
}
}
export function useTheme() {
function setTheme(next: ThemePreference) {
theme.value = next;
try {
if (next === "auto") {
localStorage.removeItem(STORAGE_KEY);
} else {
localStorage.setItem(STORAGE_KEY, next);
}
} catch {
// localStorage may fail in sandboxed or private contexts
}
applyTheme(next);
}
function cycleTheme() {
const order: readonly ThemePreference[] = ["auto", "light", "dark"] as const;
const idx = order.indexOf(theme.value);
const next = order[(idx + 1) % order.length];
if (next) {
setTheme(next);
}
}
onMounted(() => {
if (initialized) return;
initialized = true;
try {
const stored = localStorage.getItem(STORAGE_KEY);
if (stored === "light" || stored === "dark" || stored === "auto") {
theme.value = stored;
}
} catch {
// fallback to auto
}
applyTheme(theme.value);
if (window.matchMedia) {
const mq = window.matchMedia("(prefers-color-scheme: dark)");
mq.addEventListener?.("change", () => {
if (theme.value === "auto") {
applyTheme("auto");
}
});
}
});
return {
theme: readonly(theme),
isDark: readonly(isDark),
setTheme,
cycleTheme,
};
}
+90 -126
View File
@@ -1,79 +1,79 @@
<template> <template>
<div class="relative z-[1] mx-auto flex min-h-screen max-w-[720px] flex-col px-5 pb-16 pt-[72px]"> <main class="landing-shell">
<div class="mb-10 text-center"> <section class="landing-hero">
<div <RcBadge variant="brand" size="sm">ReCloud Studio</RcBadge>
class="mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-white shadow-[0_8px_24px_-8px_var(--accent)]" <div class="brand-lockup">
> <AppLogo :size="64" class="brand-logo" />
<svg <div>
viewBox="0 0 64 64" <p class="eyebrow">Event relay console</p>
class="h-8 w-8" <h1>Web<span>Hooker</span></h1>
fill="none" </div>
stroke="currentColor"
stroke-width="6"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="M41 23 V35.5 A10.5 10.5 0 0 1 20 35.5 L28 25.5" />
<circle cx="41" cy="18" r="4.5" fill="currentColor" stroke="none" />
</svg>
</div> </div>
<h1 class="mb-2.5 text-[34px] font-extrabold tracking-[-0.03em]"> <p class="hero-copy">
Web<span class="text-accent">Hooker</span>
</h1>
<p class="m-0 text-[15px] leading-relaxed text-muted">
{{ {{
lang === "zh" lang === "zh"
? "将 GitHub webhook 事件转发到 Discord 频道,并支持在 Discord 中以你本人身份操作 GitHub。" ? "把 GitHub webhook 可靠地带到你的协作空间,并在一个清晰的控制台中掌控每一条路由。"
: "Forward GitHub webhook events to Discord, and act on GitHub from Discord as yourself." : "Bring GitHub webhook activity into your collaboration space, with every route under clear control."
}} }}
</p> </p>
</div> <div class="hero-meta">
<nav class="grid gap-3"> <span><GitBranch :size="15" /> GitHub</span>
<a <span class="meta-line" aria-hidden="true" />
v-for="it in items" <span><Radio :size="15" /> Discord · Telegram · Feishu</span>
</div>
</section>
<section class="landing-actions" :aria-label="t('导航', 'Navigation')">
<RcCard
v-for="(it, index) in items"
:key="it.label" :key="it.label"
class="flex items-center gap-4 rounded-[14px] border border-border bg-surface px-5 py-[18px] text-text no-underline shadow-card transition-all duration-150 hover:-translate-y-0.5 hover:border-border-strong hover:shadow-card-hover" variant="outline"
:class=" :hoverable="true"
it.primary padding="none"
? 'border-accent bg-accent shadow-none hover:border-accent hover:shadow-accent-lg' class="landing-action"
: ''
"
:href="it.href"
:target="it.external ? '_blank' : undefined"
:rel="it.external ? 'noopener noreferrer' : undefined"
>
<span
class="flex h-11 w-11 flex-none items-center justify-center rounded-[11px] text-accent"
:class="it.primary ? 'bg-white/15 text-white' : 'bg-surface-2'"
v-html="icon(it.icon)"
/>
<span class="flex min-w-0 flex-1 flex-col gap-0.5">
<span class="text-[15px] font-bold" :class="it.primary ? 'text-white' : ''">{{
it.label
}}</span>
<span class="text-[13px]" :class="it.primary ? 'text-white/80' : 'text-muted'">{{
it.desc
}}</span>
</span>
<span class="flex-none text-lg" :class="it.primary ? 'text-white' : 'text-faint'">{{
it.external ? "↗" : "→"
}}</span>
</a>
</nav>
<footer class="mt-auto flex flex-wrap items-center justify-between gap-3 pt-10">
<span class="text-[13px] text-muted">WebHooker · GitHub → Discord</span>
<NuxtLink
class="rounded-full border border-border bg-surface px-3.5 py-1.5 text-[13px] text-muted no-underline transition-colors hover:border-border-strong hover:text-text"
:to="`/?lang=${altLang}`"
>{{ lang === "zh" ? "English" : "中文" }}</NuxtLink
> >
<a
:href="it.href"
:target="it.external ? '_blank' : undefined"
:rel="it.external ? 'noopener noreferrer' : undefined"
>
<span class="action-index">0{{ index + 1 }}</span>
<component :is="it.icon" class="action-icon" :size="22" :stroke-width="1.8" />
<span class="action-copy">
<strong>{{ it.label }}</strong>
<small>{{ it.desc }}</small>
</span>
<ArrowUpRight v-if="it.external" class="action-arrow" :size="19" />
<ArrowRight v-else class="action-arrow" :size="19" />
</a>
</RcCard>
</section>
<footer class="landing-footer">
<span>WebHooker <i /> GitHub event delivery</span>
<div class="landing-footer-actions">
<ThemeToggle show-label />
<NuxtLink :to="`/?lang=${altLang}`">
<Languages :size="15" /> {{ lang === "zh" ? "English" : "中文" }}
</NuxtLink>
</div>
</footer> </footer>
</div> </main>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed } from "vue"; import {
ArrowRight,
ArrowUpRight,
BookOpen,
FileCheck2,
GitBranch,
Github,
Languages,
LogIn,
Radio,
ShieldCheck,
} from "lucide-vue-next";
const DEFAULT_REPO = "https://github.com/ReCloudStudio/WebHooker"; const DEFAULT_REPO = "https://github.com/ReCloudStudio/WebHooker";
const DEFAULT_DOCS = "https://webhooker.docs.worldexecute.me"; const DEFAULT_DOCS = "https://webhooker.docs.worldexecute.me";
@@ -94,71 +94,35 @@ const items = computed(() => {
const docs = lang.value === "zh" ? `${docsBase.value}/zh` : `${docsBase.value}/`; const docs = lang.value === "zh" ? `${docsBase.value}/zh` : `${docsBase.value}/`;
const q = (p: string): string => `${p}?lang=${lang.value}`; const q = (p: string): string => `${p}?lang=${lang.value}`;
return [ return [
{ { href: docs, label: t("文档", "Documentation"), desc: t("部署、配置与事件参考", "Deployment, configuration & event reference"), icon: BookOpen, external: true },
href: docs, { href: repo.value, label: t("GitHub 仓库", "GitHub Repository"), desc: t("源代码、问题与发布", "Source code, issues & releases"), icon: Github, external: true },
label: t("文档", "Documentation"), { href: q("/terms"), label: t("服务条款", "Terms of Service"), desc: t("使用本服务的条款", "The terms for using this service"), icon: FileCheck2, external: false },
desc: t("部署、配置与事件参考", "Deployment, configuration & event reference"), { href: q("/privacy"), label: t("隐私政策", "Privacy Policy"), desc: t("我们如何处理你的数据", "How we handle your data"), icon: ShieldCheck, external: false },
icon: "docs", { href: "/admin", label: t("登录控制台", "Sign in to Console"), desc: t("管理路由与分组", "Manage routes and groups"), icon: LogIn, external: false },
external: true,
},
{
href: repo.value,
label: t("GitHub 仓库", "GitHub Repository"),
desc: t("源代码、问题与发布", "Source code, issues & releases"),
icon: "github",
external: true,
},
{
href: q("/terms"),
label: t("服务条款", "Terms of Service"),
desc: t("使用本服务的条款", "The terms for using this service"),
icon: "terms",
external: false,
},
{
href: q("/privacy"),
label: t("隐私政策", "Privacy Policy"),
desc: t("我们如何处理你的数据", "How we handle your data"),
icon: "privacy",
external: false,
},
{
href: "/admin/login",
label: t("登录控制台", "Sign in to Console"),
desc: t("管理路由与分组", "Manage routes and groups"),
icon: "login",
external: false,
primary: true,
},
]; ];
}); });
const ICON_PATHS: Record<string, string> = {
docs: '<path d="M4 4a2 2 0 0 1 2-2h7l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4z"/><path d="M13 2v5h5"/><path d="M8 12h8M8 16h6"/>',
github:
'<path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.36 1.09 2.94.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/>',
terms:
'<path d="M9 12h6M9 16h6M9 8h2"/><path d="M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z"/>',
privacy:
'<path d="M12 2l7 3v6c0 5-3.5 8.5-7 10-3.5-1.5-7-5-7-10V5l7-3z"/><path d="M9 12l2 2 4-4"/>',
login:
'<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><path d="M10 17l5-5-5-5"/><path d="M15 12H3"/>',
};
function icon(name: string): string {
return `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" width="22" height="22">${ICON_PATHS[name] ?? ""}</svg>`;
}
useHead({ useHead({
title: "WebHooker", title: "WebHooker",
meta: [ meta: [{ name: "description", content: lang.value === "zh" ? "GitHub webhook 转发到 Discord" : "GitHub webhooks forwarded to Discord" }],
{
name: "description",
content:
lang.value === "zh"
? "GitHub webhook 转发到 Discord"
: "GitHub webhooks forwarded to Discord",
},
],
}); });
</script> </script>
<style scoped>
.landing-shell { position: relative; z-index: 1; width: min(100% - 2rem, 880px); min-height: 100vh; margin: 0 auto; padding: clamp(4rem, 10vh, 8rem) 0 2rem; overflow-x: clip; }
.landing-shell::before { position: absolute; z-index: -1; top: 3rem; right: -7rem; width: 24rem; height: 24rem; border-radius: 999px; background: radial-gradient(circle, color-mix(in srgb, rgb(var(--wh-accent)) 18%, transparent), transparent 68%); content: ""; filter: blur(10px); }
.landing-hero { max-width: 640px; animation: intro 500ms ease-out both; }
.brand-lockup { display: flex; align-items: center; gap: 1.1rem; margin: 1.5rem 0; }
.brand-logo { box-shadow: 0 16px 38px rgb(var(--wh-accent) / .28); }
.eyebrow { margin: 0 0 .25rem; color: rgb(var(--wh-accent)); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.55rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -.07em; line-height: .88; } h1 span { color: rgb(var(--wh-accent)); }
.hero-copy { margin: 1.75rem 0 1.2rem; color: rgb(var(--wh-muted)); font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.8; }
.hero-meta { display: flex; align-items: center; gap: .75rem; color: rgb(var(--wh-faint)); font-size: .77rem; font-weight: 700; letter-spacing: .025em; } .hero-meta span:not(.meta-line) { display: inline-flex; align-items: center; gap: .35rem; } .meta-line { width: 1.5rem; height: 1px; background: rgb(var(--wh-border-strong)); }
.landing-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: clamp(2.5rem, 6vh, 4.5rem); }
.landing-action { overflow: hidden; animation: intro 500ms ease-out both; } .landing-action:nth-child(2) { animation-delay: 60ms; } .landing-action:nth-child(3) { animation-delay: 120ms; } .landing-action:nth-child(4) { animation-delay: 180ms; } .landing-action:nth-child(5) { animation-delay: 240ms; }
.landing-action a { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: .85rem; min-height: 6.7rem; padding: 1.15rem; color: inherit; text-decoration: none; }
.action-index { align-self: start; color: rgb(var(--wh-faint)); font-family: var(--font-mono); font-size: .63rem; } .action-icon { color: rgb(var(--wh-accent)); } .action-copy { display: grid; gap: .22rem; min-width: 0; } .action-copy strong { font-size: .95rem; } .action-copy small { color: rgb(var(--wh-muted)); font-size: .77rem; line-height: 1.4; } .action-arrow { color: rgb(var(--wh-faint)); transition: transform 150ms ease; } .landing-action:hover .action-arrow { color: rgb(var(--wh-accent)); transform: translate(2px, -2px); }
.landing-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; color: rgb(var(--wh-faint)); font-size: .75rem; } .landing-footer span { display: flex; align-items: center; gap: .45rem; } .landing-footer i { width: .22rem; height: .22rem; border-radius: 999px; background: rgb(var(--wh-accent)); } .landing-footer-actions { display: flex; align-items: center; gap: .75rem; } .landing-footer a { display: inline-flex; align-items: center; gap: .4rem; color: rgb(var(--wh-muted)); text-decoration: none; } .landing-footer a:hover { color: rgb(var(--wh-accent)); }
@keyframes intro { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 580px) { .landing-shell { width: min(100% - 1.5rem, 880px); padding-top: 3rem; } .landing-actions { grid-template-columns: 1fr; } .landing-footer { align-items: flex-start; flex-direction: column; } .hero-meta { align-items: flex-start; flex-direction: column; } .meta-line { display: none; } }
</style>
+4
View File
@@ -14,4 +14,8 @@ const route = useRoute();
const config = useRuntimeConfig(); const config = useRuntimeConfig();
const lang = computed(() => pickLang(String(route.query.lang ?? ""))); const lang = computed(() => pickLang(String(route.query.lang ?? "")));
const contact = computed(() => legalContact(lang.value, String(config.public.legalContact ?? ""))); const contact = computed(() => legalContact(lang.value, String(config.public.legalContact ?? "")));
useHead({
meta: [{ name: "description", content: lang.value === "zh" ? "WebHooker 隐私政策" : "WebHooker Privacy Policy" }],
});
</script> </script>
+4
View File
@@ -14,4 +14,8 @@ const route = useRoute();
const config = useRuntimeConfig(); const config = useRuntimeConfig();
const lang = computed(() => pickLang(String(route.query.lang ?? ""))); const lang = computed(() => pickLang(String(route.query.lang ?? "")));
const contact = computed(() => legalContact(lang.value, String(config.public.legalContact ?? ""))); const contact = computed(() => legalContact(lang.value, String(config.public.legalContact ?? "")));
useHead({
meta: [{ name: "description", content: lang.value === "zh" ? "WebHooker 服务条款" : "WebHooker Terms of Service" }],
});
</script> </script>
+61
View File
@@ -5,6 +5,7 @@
"": { "": {
"name": "webhooker", "name": "webhooker",
"dependencies": { "dependencies": {
"@recloudstudio/ui": "^0.2.0",
"h3": "^1.15.3", "h3": "^1.15.3",
"markdown-it": "^15.0.0", "markdown-it": "^15.0.0",
"nuxt": "^4.1.0", "nuxt": "^4.1.0",
@@ -222,6 +223,14 @@
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.7.2", "", { "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" } }, "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A=="], "@eslint/plugin-kit": ["@eslint/plugin-kit@0.7.2", "", { "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" } }, "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A=="],
"@floating-ui/core": ["@floating-ui/core@1.8.0", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="],
"@floating-ui/dom": ["@floating-ui/dom@1.8.0", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="],
"@floating-ui/utils": ["@floating-ui/utils@0.2.12", "", {}, "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww=="],
"@floating-ui/vue": ["@floating-ui/vue@1.1.11", "", { "dependencies": { "@floating-ui/dom": "^1.7.6", "@floating-ui/utils": "^0.2.11", "vue-demi": ">=0.13.0" } }, "sha512-HzHKCNVxnGS35r9fCHBc3+uCnjw9IWIlCPL683cGgM9Kgj2BiAl8x1mS7vtvP6F9S/e/q4O6MApwSHj8hNLGfw=="],
"@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="], "@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "^0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="],
"@humanfs/node": ["@humanfs/node@0.16.8", "", { "dependencies": { "@humanfs/core": "^0.19.2", "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ=="], "@humanfs/node": ["@humanfs/node@0.16.8", "", { "dependencies": { "@humanfs/core": "^0.19.2", "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ=="],
@@ -290,6 +299,10 @@
"@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.2", "", { "os": "win32", "cpu": "x64" }, "sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ=="], "@img/sharp-win32-x64": ["@img/sharp-win32-x64@0.35.2", "", { "os": "win32", "cpu": "x64" }, "sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ=="],
"@internationalized/date": ["@internationalized/date@3.12.4", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-M1dEn4c1U1HsSlaVR8upZtSqvXrTkHDfv18H01uCSJyjVLDxnBR38v/fMxecmlwXKR4i9HeZcmgQAPE6A+aGJQ=="],
"@internationalized/number": ["@internationalized/number@3.6.8", "", { "dependencies": { "@swc/helpers": "^0.5.0" } }, "sha512-8UmMFia46DUt+k97zKd9fKWXcWHR+k8ae3eYzILETuT2KbIvLyOfac7zesw+sJdRAAZ7Q9pM1Mk22aXp2LD0Ig=="],
"@ioredis/commands": ["@ioredis/commands@1.10.0", "", {}, "sha512-UmeW7z4LfctwoQ5wkhVzgq8tXkreED2xZGpX+Bg+zA+WJFZCT6c062AfCK/Dfk81xZnnwdhJCUMkitihRaoC2Q=="], "@ioredis/commands": ["@ioredis/commands@1.10.0", "", {}, "sha512-UmeW7z4LfctwoQ5wkhVzgq8tXkreED2xZGpX+Bg+zA+WJFZCT6c062AfCK/Dfk81xZnnwdhJCUMkitihRaoC2Q=="],
"@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="], "@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="],
@@ -404,6 +417,8 @@
"@poppinss/exception": ["@poppinss/exception@1.2.3", "", {}, "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw=="], "@poppinss/exception": ["@poppinss/exception@1.2.3", "", {}, "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw=="],
"@recloudstudio/ui": ["@recloudstudio/ui@0.2.0", "", { "dependencies": { "clsx": "^2.1.1", "lucide-vue-next": "^1.0.0", "reka-ui": "^2.10.5", "shiki": "^4.5.0", "tailwind-merge": "^3.0.2" }, "peerDependencies": { "@nuxt/kit": "^4.0.0", "@nuxt/schema": "^4.0.0", "vue": "^3.5.0" }, "optionalPeers": ["@nuxt/kit"] }, "sha512-cIwctbkOKaT4mOmqLtl75AnSAdIvjVCItC6ZAvBN65sl2Ny8CbqgLShEkDle7Xyzx4k8PgAduhsHh7b+aVuQUw=="],
"@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.4", "", { "os": "android", "cpu": "arm64" }, "sha512-jHC2cnyKz5xU2fhECtFl8OZ83cYNt13GZQD+0uMJ/X3o+ijmd56okHhTUwxVSHPx1IRVIJEZ1/1pPzeLCU6XKA=="], "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.4", "", { "os": "android", "cpu": "arm64" }, "sha512-jHC2cnyKz5xU2fhECtFl8OZ83cYNt13GZQD+0uMJ/X3o+ijmd56okHhTUwxVSHPx1IRVIJEZ1/1pPzeLCU6XKA=="],
"@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Dc5mPD8F5F/FS8i01syd7FTF6yB2fVthH/TRkjwJkzUK6EpoxHtqvZQP5Zwq80/5z19TWYHIg1KOHboCgVx/aQ=="], "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Dc5mPD8F5F/FS8i01syd7FTF6yB2fVthH/TRkjwJkzUK6EpoxHtqvZQP5Zwq80/5z19TWYHIg1KOHboCgVx/aQ=="],
@@ -508,6 +523,8 @@
"@shikijs/langs": ["@shikijs/langs@2.5.0", "", { "dependencies": { "@shikijs/types": "2.5.0" } }, "sha512-Qfrrt5OsNH5R+5tJ/3uYBBZv3SuGmnRPejV9IlIbFH3HTGLDlkqgHymAlzklVmKBjAaVmkPkyikAV/sQ1wSL+w=="], "@shikijs/langs": ["@shikijs/langs@2.5.0", "", { "dependencies": { "@shikijs/types": "2.5.0" } }, "sha512-Qfrrt5OsNH5R+5tJ/3uYBBZv3SuGmnRPejV9IlIbFH3HTGLDlkqgHymAlzklVmKBjAaVmkPkyikAV/sQ1wSL+w=="],
"@shikijs/primitive": ["@shikijs/primitive@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-UM7ShlA8oz0OWxLLO8BmO9Ip6fVqdkt8yF0EH7nOCqHfrx1eEAzF0ZUVK7L+I8NEgeu1PEWSRlxaiPPeCb4iDg=="],
"@shikijs/themes": ["@shikijs/themes@2.5.0", "", { "dependencies": { "@shikijs/types": "2.5.0" } }, "sha512-wGrk+R8tJnO0VMzmUExHR+QdSaPUl/NKs+a4cQQRWyoc3YFbUzuLEi/KWK1hj+8BfHRKm2jNhhJck1dfstJpiw=="], "@shikijs/themes": ["@shikijs/themes@2.5.0", "", { "dependencies": { "@shikijs/types": "2.5.0" } }, "sha512-wGrk+R8tJnO0VMzmUExHR+QdSaPUl/NKs+a4cQQRWyoc3YFbUzuLEi/KWK1hj+8BfHRKm2jNhhJck1dfstJpiw=="],
"@shikijs/transformers": ["@shikijs/transformers@2.5.0", "", { "dependencies": { "@shikijs/core": "2.5.0", "@shikijs/types": "2.5.0" } }, "sha512-SI494W5X60CaUwgi8u4q4m4s3YAFSxln3tzNjOSYqq54wlVgz0/NbbXEb3mdLbqMBztcmS7bVTaEd2w0qMmfeg=="], "@shikijs/transformers": ["@shikijs/transformers@2.5.0", "", { "dependencies": { "@shikijs/core": "2.5.0", "@shikijs/types": "2.5.0" } }, "sha512-SI494W5X60CaUwgi8u4q4m4s3YAFSxln3tzNjOSYqq54wlVgz0/NbbXEb3mdLbqMBztcmS7bVTaEd2w0qMmfeg=="],
@@ -526,6 +543,8 @@
"@speed-highlight/core": ["@speed-highlight/core@1.2.20", "", {}, "sha512-biXn20UJkNJ9cB35lPXJKfgUl1NQfhbApt78oePVjC0gB4+hlJyjkUz1hoLHLk7dEl+mSbW0VtX4C2IlRIDoHA=="], "@speed-highlight/core": ["@speed-highlight/core@1.2.20", "", {}, "sha512-biXn20UJkNJ9cB35lPXJKfgUl1NQfhbApt78oePVjC0gB4+hlJyjkUz1hoLHLk7dEl+mSbW0VtX4C2IlRIDoHA=="],
"@swc/helpers": ["@swc/helpers@0.5.23", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw=="],
"@tailwindcss/node": ["@tailwindcss/node@4.3.3", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.24.1", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.3" } }, "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg=="], "@tailwindcss/node": ["@tailwindcss/node@4.3.3", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.24.1", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.3" } }, "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg=="],
"@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.3", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.3", "@tailwindcss/oxide-darwin-arm64": "4.3.3", "@tailwindcss/oxide-darwin-x64": "4.3.3", "@tailwindcss/oxide-freebsd-x64": "4.3.3", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", "@tailwindcss/oxide-linux-x64-musl": "4.3.3", "@tailwindcss/oxide-wasm32-wasi": "4.3.3", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" } }, "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA=="], "@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.3", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.3", "@tailwindcss/oxide-darwin-arm64": "4.3.3", "@tailwindcss/oxide-darwin-x64": "4.3.3", "@tailwindcss/oxide-freebsd-x64": "4.3.3", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", "@tailwindcss/oxide-linux-x64-musl": "4.3.3", "@tailwindcss/oxide-wasm32-wasi": "4.3.3", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" } }, "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA=="],
@@ -556,6 +575,10 @@
"@tailwindcss/vite": ["@tailwindcss/vite@4.3.3", "", { "dependencies": { "@tailwindcss/node": "4.3.3", "@tailwindcss/oxide": "4.3.3", "tailwindcss": "4.3.3" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw=="], "@tailwindcss/vite": ["@tailwindcss/vite@4.3.3", "", { "dependencies": { "@tailwindcss/node": "4.3.3", "@tailwindcss/oxide": "4.3.3", "tailwindcss": "4.3.3" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw=="],
"@tanstack/virtual-core": ["@tanstack/virtual-core@3.17.11", "", {}, "sha512-+ILjvtHup6Y2hzQ6YzwMgX1Q+oQpxEGOXCEsCNaPoIP0VxMbizIBTmYTDtkerkIQS8/CbP1BRuyt8V/8BCsy1g=="],
"@tanstack/vue-virtual": ["@tanstack/vue-virtual@3.13.39", "", { "dependencies": { "@tanstack/virtual-core": "3.17.11" }, "peerDependencies": { "vue": "^2.7.0 || ^3.0.0" } }, "sha512-AG8sI+6nfrDvN6ixuHJL9LaJTf3//0V5VITZYW3UOaIuSVexnEzsbMu4LH/JhMfRTxwhUXPnLqkl1DlzkZbRtg=="],
"@types/aws-lambda": ["@types/aws-lambda@8.10.162", "", {}, "sha512-Fn658grtLOci1oxi1391vvDWJRKNGWRSqfxRkmN/Iy3c0tQH1USMKEXcPYHLvope+ZgTFocx9FRQJx1muBL6qw=="], "@types/aws-lambda": ["@types/aws-lambda@8.10.162", "", {}, "sha512-Fn658grtLOci1oxi1391vvDWJRKNGWRSqfxRkmN/Iy3c0tQH1USMKEXcPYHLvope+ZgTFocx9FRQJx1muBL6qw=="],
"@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="], "@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="],
@@ -702,6 +725,8 @@
"argparse": ["argparse@3.0.0", "", {}, "sha512-BOp5NMrHqKxmq/OLr+clzzrRxgOKSLkcjmkWuChp7Irqwn4s74WjOBPIgWfA/HMcBnVkZ5XEuf9uUqzlpfCQ6A=="], "argparse": ["argparse@3.0.0", "", {}, "sha512-BOp5NMrHqKxmq/OLr+clzzrRxgOKSLkcjmkWuChp7Irqwn4s74WjOBPIgWfA/HMcBnVkZ5XEuf9uUqzlpfCQ6A=="],
"aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],
"ast-kit": ["ast-kit@2.2.0", "", { "dependencies": { "@babel/parser": "^7.28.5", "pathe": "^2.0.3" } }, "sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw=="], "ast-kit": ["ast-kit@2.2.0", "", { "dependencies": { "@babel/parser": "^7.28.5", "pathe": "^2.0.3" } }, "sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw=="],
"ast-walker-scope": ["ast-walker-scope@0.9.0", "", { "dependencies": { "@babel/parser": "^7.29.2", "@babel/types": "^7.29.0", "ast-kit": "^2.2.0" } }, "sha512-IJdzo2vLiElBxKzwS36VsCue/62d6IdWjnPB2v3nuPKeWGynp6FF/CYoLa5i/3jXH/z97ZDdsXz6abpgM6w07A=="], "ast-walker-scope": ["ast-walker-scope@0.9.0", "", { "dependencies": { "@babel/parser": "^7.29.2", "@babel/types": "^7.29.0", "ast-kit": "^2.2.0" } }, "sha512-IJdzo2vLiElBxKzwS36VsCue/62d6IdWjnPB2v3nuPKeWGynp6FF/CYoLa5i/3jXH/z97ZDdsXz6abpgM6w07A=="],
@@ -782,6 +807,8 @@
"cliui": ["cliui@9.0.1", "", { "dependencies": { "string-width": "^7.2.0", "strip-ansi": "^7.1.0", "wrap-ansi": "^9.0.0" } }, "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w=="], "cliui": ["cliui@9.0.1", "", { "dependencies": { "string-width": "^7.2.0", "strip-ansi": "^7.1.0", "wrap-ansi": "^9.0.0" } }, "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w=="],
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
"cluster-key-slot": ["cluster-key-slot@1.1.1", "", {}, "sha512-rwHwUfXL40Chm1r08yrhU3qpUvdVlgkKNeyeGPOxnW8/SyVDvgRaed/Uz54AqWNaTCAThlj6QAs3TZcKI0xDEw=="], "cluster-key-slot": ["cluster-key-slot@1.1.1", "", {}, "sha512-rwHwUfXL40Chm1r08yrhU3qpUvdVlgkKNeyeGPOxnW8/SyVDvgRaed/Uz54AqWNaTCAThlj6QAs3TZcKI0xDEw=="],
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
@@ -1192,6 +1219,8 @@
"lru-cache": ["lru-cache@11.5.2", "", {}, "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g=="], "lru-cache": ["lru-cache@11.5.2", "", {}, "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g=="],
"lucide-vue-next": ["lucide-vue-next@1.0.0", "", { "peerDependencies": { "vue": ">=3.0.1" } }, "sha512-V6SPvx1IHTj/UY+FrIYWV5faISsPSb8BnWSFDxAtezWKvWc9ZZ40PDrdu1/Qb5vg4lHWr1hs1BAMGVGm6V1Xdg=="],
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
"magic-string-ast": ["magic-string-ast@1.0.3", "", { "dependencies": { "magic-string": "^0.30.19" } }, "sha512-CvkkH1i81zl7mmb94DsRiFeG9V2fR2JeuK8yDgS8oiZSFa++wWLEgZ5ufEOyLHbvSbD1gTRKv9NdX69Rnvr9JA=="], "magic-string-ast": ["magic-string-ast@1.0.3", "", { "dependencies": { "magic-string": "^0.30.19" } }, "sha512-CvkkH1i81zl7mmb94DsRiFeG9V2fR2JeuK8yDgS8oiZSFa++wWLEgZ5ufEOyLHbvSbD1gTRKv9NdX69Rnvr9JA=="],
@@ -1350,6 +1379,8 @@
"onetime": ["onetime@6.0.0", "", { "dependencies": { "mimic-fn": "^4.0.0" } }, "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ=="], "onetime": ["onetime@6.0.0", "", { "dependencies": { "mimic-fn": "^4.0.0" } }, "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ=="],
"oniguruma-parser": ["oniguruma-parser@0.12.2", "", {}, "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw=="],
"oniguruma-to-es": ["oniguruma-to-es@3.1.1", "", { "dependencies": { "emoji-regex-xs": "^1.0.0", "regex": "^6.0.1", "regex-recursion": "^6.0.2" } }, "sha512-bUH8SDvPkH3ho3dvwJwfonjlQ4R80vjyvrU8YpxuROddv55vAEJrTuCuCVUhhsHbtlD9tGGbaNApGQckXhS8iQ=="], "oniguruma-to-es": ["oniguruma-to-es@3.1.1", "", { "dependencies": { "emoji-regex-xs": "^1.0.0", "regex": "^6.0.1", "regex-recursion": "^6.0.2" } }, "sha512-bUH8SDvPkH3ho3dvwJwfonjlQ4R80vjyvrU8YpxuROddv55vAEJrTuCuCVUhhsHbtlD9tGGbaNApGQckXhS8iQ=="],
"open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="], "open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="],
@@ -1498,6 +1529,8 @@
"regex-utilities": ["regex-utilities@2.3.0", "", {}, "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng=="], "regex-utilities": ["regex-utilities@2.3.0", "", {}, "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng=="],
"reka-ui": ["reka-ui@2.10.5", "", { "dependencies": { "@floating-ui/dom": "^1.6.13", "@floating-ui/vue": "^1.1.6", "@internationalized/date": "^3.5.0", "@internationalized/number": "^3.5.0", "@tanstack/vue-virtual": "^3.12.0", "@vueuse/core": "^14.1.0", "@vueuse/shared": "^14.1.0", "aria-hidden": "^1.2.4", "defu": "^6.1.5", "ohash": "^2.0.11" }, "peerDependencies": { "vue": ">= 3.4.0" } }, "sha512-/8o0y9BThE0hcHKFg+3770tWcJh3qKdOEFxLOPb9HIajXeFoH/J530cZH62jUJunbqwBgpSBL9v7nB8LJ5pDXA=="],
"resolve": ["resolve@1.22.12", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="], "resolve": ["resolve@1.22.12", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="],
"resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],
@@ -1624,6 +1657,8 @@
"tagged-tag": ["tagged-tag@1.0.0", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="], "tagged-tag": ["tagged-tag@1.0.0", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="],
"tailwind-merge": ["tailwind-merge@3.7.0", "", {}, "sha512-XPPUyAc+cvspz3lHTcR/QgPfW2A0lv/xQNIjX3HGhLR+Nq2lHaLq5MtTesHn8GUr3W3DguT2KT5x3NVgRtYwmA=="],
"tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="], "tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="],
"tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="], "tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="],
@@ -1756,6 +1791,8 @@
"vue-component-type-helpers": ["vue-component-type-helpers@3.3.9", "", {}, "sha512-3c/UfMe0SqyEfcGTyH7mfshHagJ9QTCbppCb0/uGpHZpFug7+If3GeGZN7I0YheKEExemx3xldQPoO7PQSOLQg=="], "vue-component-type-helpers": ["vue-component-type-helpers@3.3.9", "", {}, "sha512-3c/UfMe0SqyEfcGTyH7mfshHagJ9QTCbppCb0/uGpHZpFug7+If3GeGZN7I0YheKEExemx3xldQPoO7PQSOLQg=="],
"vue-demi": ["vue-demi@0.14.10", "", { "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^3.0.0-0 || ^2.6.0" }, "optionalPeers": ["@vue/composition-api"], "bin": { "vue-demi-fix": "bin/vue-demi-fix.js", "vue-demi-switch": "bin/vue-demi-switch.js" } }, "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg=="],
"vue-devtools-stub": ["vue-devtools-stub@0.1.0", "", {}, "sha512-RutnB7X8c5hjq39NceArgXg28WZtZpGc3+J16ljMiYnFhKvd8hITxSWQSQ5bvldxMDU6gG5mkxl1MTQLXckVSQ=="], "vue-devtools-stub": ["vue-devtools-stub@0.1.0", "", {}, "sha512-RutnB7X8c5hjq39NceArgXg28WZtZpGc3+J16ljMiYnFhKvd8hITxSWQSQ5bvldxMDU6gG5mkxl1MTQLXckVSQ=="],
"vue-router": ["vue-router@5.2.0", "", { "dependencies": { "@babel/generator": "^8.0.0", "@vue-macros/common": "^3.1.3", "@vue/devtools-api": "^8.1.5", "ast-walker-scope": "^0.9.0", "chokidar": "^5.0.0", "json5": "^2.2.3", "local-pkg": "^1.2.1", "magic-string": "^0.30.21", "mlly": "^1.8.2", "muggle-string": "^0.4.1", "nostics": "^1.1.4", "pathe": "^2.0.3", "picomatch": "^4.0.5", "scule": "^1.3.0", "tinyglobby": "^0.2.17", "unplugin": "^3.3.0", "unplugin-utils": "^0.3.2", "yaml": "^2.9.0" }, "peerDependencies": { "@pinia/colada": ">=0.21.2", "@vue/compiler-sfc": "^3.5.34 || ^4.0.0", "pinia": "^3.0.4 || ^4.0.2", "vite": "^7.3.0 || ^8.0.0", "vue": "^3.5.34 || ^4.0.0" }, "optionalPeers": ["@pinia/colada", "@vue/compiler-sfc", "pinia", "vite"] }, "sha512-QAC5i0LEb1GLG0LXDQmHu8L7FX12j0KwU/JTKmLQUJMrn04gQdKP6Du+p0QwpHb3iy71vBlqnHQ8WAfOSAWhqw=="], "vue-router": ["vue-router@5.2.0", "", { "dependencies": { "@babel/generator": "^8.0.0", "@vue-macros/common": "^3.1.3", "@vue/devtools-api": "^8.1.5", "ast-walker-scope": "^0.9.0", "chokidar": "^5.0.0", "json5": "^2.2.3", "local-pkg": "^1.2.1", "magic-string": "^0.30.21", "mlly": "^1.8.2", "muggle-string": "^0.4.1", "nostics": "^1.1.4", "pathe": "^2.0.3", "picomatch": "^4.0.5", "scule": "^1.3.0", "tinyglobby": "^0.2.17", "unplugin": "^3.3.0", "unplugin-utils": "^0.3.2", "yaml": "^2.9.0" }, "peerDependencies": { "@pinia/colada": ">=0.21.2", "@vue/compiler-sfc": "^3.5.34 || ^4.0.0", "pinia": "^3.0.4 || ^4.0.2", "vite": "^7.3.0 || ^8.0.0", "vue": "^3.5.34 || ^4.0.0" }, "optionalPeers": ["@pinia/colada", "@vue/compiler-sfc", "pinia", "vite"] }, "sha512-QAC5i0LEb1GLG0LXDQmHu8L7FX12j0KwU/JTKmLQUJMrn04gQdKP6Du+p0QwpHb3iy71vBlqnHQ8WAfOSAWhqw=="],
@@ -1876,6 +1913,10 @@
"@parcel/watcher-wasm/napi-wasm": ["napi-wasm@1.1.3", "", { "bundled": true }, "sha512-h/4nMGsHjZDCYmQVNODIrYACVJ+I9KItbG+0si6W/jSjdA9JbWDoU4LLeMXVcEQGHjttI2tuXqDrbGF7qkUHHg=="], "@parcel/watcher-wasm/napi-wasm": ["napi-wasm@1.1.3", "", { "bundled": true }, "sha512-h/4nMGsHjZDCYmQVNODIrYACVJ+I9KItbG+0si6W/jSjdA9JbWDoU4LLeMXVcEQGHjttI2tuXqDrbGF7qkUHHg=="],
"@recloudstudio/ui/shiki": ["shiki@4.5.0", "", { "dependencies": { "@shikijs/core": "4.5.0", "@shikijs/engine-javascript": "4.5.0", "@shikijs/engine-oniguruma": "4.5.0", "@shikijs/langs": "4.5.0", "@shikijs/themes": "4.5.0", "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-OcRW72ngQvc+MSVWBRIovC/BTW589iUE/Vxav7VeM4RcY9MUjqB+IR6ILG1k9nuW6LiG/nct9uma4/MBtnZbmQ=="],
"@shikijs/primitive/@shikijs/types": ["@shikijs/types@4.5.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-drtPrtD8N0DENyD2cyt6Ajy+IWsiCLgMxODwLTpvH1UsN6a9jf90tNTPjqwHvA+0Lzu9e0txk8DjfqH1p9UJRw=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="],
@@ -2044,6 +2085,10 @@
"readdir-glob/minimatch": ["minimatch@5.1.9", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw=="], "readdir-glob/minimatch": ["minimatch@5.1.9", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw=="],
"reka-ui/@vueuse/core": ["@vueuse/core@14.4.0", "", { "dependencies": { "@types/web-bluetooth": "^0.0.21", "@vueuse/metadata": "14.4.0", "@vueuse/shared": "14.4.0" }, "peerDependencies": { "vue": "^3.5.0" } }, "sha512-X4WHz1HlCzCBoYXesUkifzzWBAcZgXG8Fi5iNPQg/epdzOB3gu8Fawj3hvuwYR1nGcXGnvxwYYcUC/71++svtQ=="],
"reka-ui/@vueuse/shared": ["@vueuse/shared@14.4.0", "", { "peerDependencies": { "vue": "^3.5.0" } }, "sha512-JRgY90Sz8DDtPMsaDflvPMp9xYk69JZAmbuDvAquUVXKr2gEjqtzGNTTthLfckH0BzBqvnu31gb4a8TGLRe79g=="],
"rolldown-string/magic-string": ["magic-string@1.2.0", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-ptco+HFxTLgjafSLim2LojBSwfg5feBjd+SqyiwdGkzC38UPdZy3zgrHMI2CoTf5fJL38tbHMYWVzIH8BxGqJw=="], "rolldown-string/magic-string": ["magic-string@1.2.0", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-ptco+HFxTLgjafSLim2LojBSwfg5feBjd+SqyiwdGkzC38UPdZy3zgrHMI2CoTf5fJL38tbHMYWVzIH8BxGqJw=="],
"source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
@@ -2154,6 +2199,18 @@
"@nuxt/vite-builder/postcss/nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="], "@nuxt/vite-builder/postcss/nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="],
"@recloudstudio/ui/shiki/@shikijs/core": ["@shikijs/core@4.5.0", "", { "dependencies": { "@shikijs/primitive": "4.5.0", "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5", "hast-util-to-html": "^9.0.5" } }, "sha512-6CIgwq+bt2JZ3OSjb/nBkkwEf/CfpHcbam+Mg5Pllco7HAGRQ2/EFhZrrJtbyNTgKwknfVS+llsXGygiDGwJWw=="],
"@recloudstudio/ui/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.6" } }, "sha512-Ed6UdEj84LyYkwnxM5CvSMWAD+id9ExTYri0/+x41U9zrgNifPSS9lZm0JqBP0VfYI8yr8tY5nbNq9+p9R0kFA=="],
"@recloudstudio/ui/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-dKVmbJecVdB9recl8a/CU4jdpNXyjJQrIcesIkpS70s5HS02ohpnCSpMUbotPnEUzbAcLQ+S4hwZYbkBBiTcJw=="],
"@recloudstudio/ui/shiki/@shikijs/langs": ["@shikijs/langs@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0" } }, "sha512-wwBTqwduXSz0X4v9Qa2EWeFaYJEw1clCncWjoRNQRbVDu3SPRTRWucnouYapKj3b8Q+sk/41Vbc4B5c8nuYzLA=="],
"@recloudstudio/ui/shiki/@shikijs/themes": ["@shikijs/themes@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0" } }, "sha512-zGb87H3UBbpuI4yoh5UguB1XbU+2BDU3kflM7UfZ+Cy2hWo9lBtqjSVK20gmLY6ukYl040hAypGXMgud9vul8Q=="],
"@recloudstudio/ui/shiki/@shikijs/types": ["@shikijs/types@4.5.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-drtPrtD8N0DENyD2cyt6Ajy+IWsiCLgMxODwLTpvH1UsN6a9jf90tNTPjqwHvA+0Lzu9e0txk8DjfqH1p9UJRw=="],
"@vitejs/plugin-vue/vite/esbuild": ["esbuild@0.21.5", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.21.5", "@esbuild/android-arm": "0.21.5", "@esbuild/android-arm64": "0.21.5", "@esbuild/android-x64": "0.21.5", "@esbuild/darwin-arm64": "0.21.5", "@esbuild/darwin-x64": "0.21.5", "@esbuild/freebsd-arm64": "0.21.5", "@esbuild/freebsd-x64": "0.21.5", "@esbuild/linux-arm": "0.21.5", "@esbuild/linux-arm64": "0.21.5", "@esbuild/linux-ia32": "0.21.5", "@esbuild/linux-loong64": "0.21.5", "@esbuild/linux-mips64el": "0.21.5", "@esbuild/linux-ppc64": "0.21.5", "@esbuild/linux-riscv64": "0.21.5", "@esbuild/linux-s390x": "0.21.5", "@esbuild/linux-x64": "0.21.5", "@esbuild/netbsd-x64": "0.21.5", "@esbuild/openbsd-x64": "0.21.5", "@esbuild/sunos-x64": "0.21.5", "@esbuild/win32-arm64": "0.21.5", "@esbuild/win32-ia32": "0.21.5", "@esbuild/win32-x64": "0.21.5" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw=="], "@vitejs/plugin-vue/vite/esbuild": ["esbuild@0.21.5", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.21.5", "@esbuild/android-arm": "0.21.5", "@esbuild/android-arm64": "0.21.5", "@esbuild/android-x64": "0.21.5", "@esbuild/darwin-arm64": "0.21.5", "@esbuild/darwin-x64": "0.21.5", "@esbuild/freebsd-arm64": "0.21.5", "@esbuild/freebsd-x64": "0.21.5", "@esbuild/linux-arm": "0.21.5", "@esbuild/linux-arm64": "0.21.5", "@esbuild/linux-ia32": "0.21.5", "@esbuild/linux-loong64": "0.21.5", "@esbuild/linux-mips64el": "0.21.5", "@esbuild/linux-ppc64": "0.21.5", "@esbuild/linux-riscv64": "0.21.5", "@esbuild/linux-s390x": "0.21.5", "@esbuild/linux-x64": "0.21.5", "@esbuild/netbsd-x64": "0.21.5", "@esbuild/openbsd-x64": "0.21.5", "@esbuild/sunos-x64": "0.21.5", "@esbuild/win32-arm64": "0.21.5", "@esbuild/win32-ia32": "0.21.5", "@esbuild/win32-x64": "0.21.5" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw=="],
"@vue/babel-plugin-jsx/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="], "@vue/babel-plugin-jsx/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="],
@@ -2270,6 +2327,8 @@
"readdir-glob/minimatch/brace-expansion": ["brace-expansion@2.1.4", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg=="], "readdir-glob/minimatch/brace-expansion": ["brace-expansion@2.1.4", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg=="],
"reka-ui/@vueuse/core/@vueuse/metadata": ["@vueuse/metadata@14.4.0", "", {}, "sha512-swx/255R6JyHZFJhx845iz5CRWDZdCfvkZOpACWc5+c5WHcG24mv8gUT1WIdFQaHt6dq79rvILd9QnCWiyVm9g=="],
"string-width-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], "string-width-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
"stylehacks/postcss/nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="], "stylehacks/postcss/nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="],
@@ -2314,6 +2373,8 @@
"@babel/core/@babel/generator/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], "@babel/core/@babel/generator/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="],
"@recloudstudio/ui/shiki/@shikijs/engine-javascript/oniguruma-to-es": ["oniguruma-to-es@4.3.6", "", { "dependencies": { "oniguruma-parser": "^0.12.2", "regex": "^6.1.0", "regex-recursion": "^6.0.2" } }, "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA=="],
"@vitejs/plugin-vue/vite/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="], "@vitejs/plugin-vue/vite/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
"@vitejs/plugin-vue/vite/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="], "@vitejs/plugin-vue/vite/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.21.5", "", { "os": "android", "cpu": "arm" }, "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg=="],
+2 -2
View File
@@ -90,7 +90,7 @@ export default defineConfig({
}, },
footer: { footer: {
message: "Released under the MIT License.", message: "Released under the MIT License.",
copyright: "Copyright 2026 ReCloudStudio", copyright: "Copyright 2026 ReCloud Studio",
}, },
editLink: { editLink: {
pattern: `${github}/edit/main/docs/:path`, pattern: `${github}/edit/main/docs/:path`,
@@ -178,7 +178,7 @@ export default defineConfig({
}, },
footer: { footer: {
message: "基于 MIT 许可发布。", message: "基于 MIT 许可发布。",
copyright: "Copyright 2026 ReCloudStudio", copyright: "Copyright 2026 ReCloud Studio",
}, },
editLink: { editLink: {
pattern: `${github}/edit/main/docs/:path`, pattern: `${github}/edit/main/docs/:path`,
+1 -1
View File
@@ -1,6 +1,6 @@
# Admin API # Admin API
Admin endpoints manage routes, groups, members, invites, webhook secrets, send logs, and the audit log. They require an admin session cookie obtained via `GET /admin/login` (GitHub OAuth); the signed-in user must be listed in `ADMIN_USER_IDS` or manage a group. See [Configuration → Web UI](../guide/configuration.md#web-ui) for setup. Admin endpoints manage routes, groups, members, invites, webhook secrets, send logs, and the audit log. They require an admin session cookie obtained via `GET /admin/login` (GitHub OAuth); the signed-in user must be listed in `ADMIN_USER_IDS` or manage a group. For local development only, exact `DEBUG_MODE=true` bypasses authentication and grants full access; never deploy with it enabled. See [Configuration → Web UI](../guide/configuration.md#web-ui) for setup.
The console itself is served at `/admin`; its tabs are deep-linkable via the URL path (`/admin/groups`, `/admin/logs`, `/admin/audit`). The console itself is served at `/admin`; its tabs are deep-linkable via the URL path (`/admin/groups`, `/admin/logs`, `/admin/audit`).
+1 -1
View File
@@ -36,7 +36,7 @@ The `/admin/api/*` endpoints (routes, groups, members, invites, webhook secrets,
## Admin Console ## Admin Console
See [Configuration → Web UI](../guide/configuration.md#web-ui) for setup, and the [Admin API](./admin) reference for all management endpoints. Admin endpoints require a session cookie obtained via `GET /admin/login` (GitHub OAuth); the signed-in user must be listed in `ADMIN_USER_IDS` or manage a group. See [Configuration → Web UI](../guide/configuration.md#web-ui) for setup, and the [Admin API](./admin) reference for all management endpoints. Admin endpoints require a session cookie obtained via `GET /admin/login` (GitHub OAuth); the signed-in user must be listed in `ADMIN_USER_IDS` or manage a group. For local development only, exact `DEBUG_MODE=true` bypasses authentication and grants full access; never deploy with it enabled.
## Health Check ## Health Check
+1 -1
View File
@@ -15,7 +15,7 @@ bun run dev # Start local dev server
```text ```text
app/ # Vue 3 UI (Nuxt app dir) app/ # Vue 3 UI (Nuxt app dir)
├── app.vue # Root component (NuxtPage) ├── app.vue # Root component (NuxtPage)
├── assets/css/main.css # Tailwind CSS v4 entry: @import "tailwindcss" + @theme inline tokens (RGB-triplet CSS variables) + @layer components (@apply) ├── assets/css/main.css # Tailwind CSS v4 entry: ReCloud UI-compatible RGB aliases + bespoke layout classes
├── pages/ # index (landing), terms, privacy, admin/[...slug] (console SPA) ├── pages/ # index (landing), terms, privacy, admin/[...slug] (console SPA)
├── components/ # ConsolePage, RouteCard/Editor, GroupEditor, MembersPanel, WebhookPanel, ├── components/ # ConsolePage, RouteCard/Editor, GroupEditor, MembersPanel, WebhookPanel,
│ # SendLogs, AuditLog, AppToasts, LegalLayout │ # SendLogs, AuditLog, AppToasts, LegalLayout
+3
View File
@@ -44,6 +44,7 @@ WebHooker requires several secrets to function. For local development, store the
| `TELEGRAM_RICH_HEADER_HOST` | Base URL of an external rich-header service; when unset, the built-in `GET /api/richheader` serves the Telegram avatar card | Built-in `/api/richheader` | | `TELEGRAM_RICH_HEADER_HOST` | Base URL of an external rich-header service; when unset, the built-in `GET /api/richheader` serves the Telegram avatar card | Built-in `/api/richheader` |
| `BASE_URL` | Public URL for OAuth callbacks | `http://localhost:8787` | | `BASE_URL` | Public URL for OAuth callbacks | `http://localhost:8787` |
| `ADMIN_USER_IDS` | Comma-separated GitHub user IDs (or logins) allowed to access the Web UI | Disabled | | `ADMIN_USER_IDS` | Comma-separated GitHub user IDs (or logins) allowed to access the Web UI | Disabled |
| `DEBUG_MODE` | Local development only: exact `true` bypasses all `/admin` authentication and grants full access | Disabled |
| `ALLOW_SELF_SIGNUP` | When enabled (`1`/`true`), GitHub users without any group access get a personal group on first login instead of `403` | Disabled | | `ALLOW_SELF_SIGNUP` | When enabled (`1`/`true`), GitHub users without any group access get a personal group on first login instead of `403` | Disabled |
| `AUDIT_RETENTION_DAYS` | Audit-log retention in days for the scheduled cleanup | `90` | | `AUDIT_RETENTION_DAYS` | Audit-log retention in days for the scheduled cleanup | `90` |
| `NUXT_PUBLIC_DOCS_URL` | Docs site URL used by the landing page (client-side runtime config) | Landing page defaults | | `NUXT_PUBLIC_DOCS_URL` | Docs site URL used by the landing page (client-side runtime config) | Landing page defaults |
@@ -60,6 +61,8 @@ WebHooker ships with a built-in config console at `/admin` for managing routes,
2. Open `/admin` and sign in with GitHub. 2. Open `/admin` and sign in with GitHub.
3. Users without any access get `403`, except when `ALLOW_SELF_SIGNUP=1` (they receive a personal group) or when they follow a group [invite link](./groups#invites). 3. Users without any access get `403`, except when `ALLOW_SELF_SIGNUP=1` (they receive a personal group) or when they follow a group [invite link](./groups#invites).
For local debugging only, set `DEBUG_MODE=true` to bypass GitHub OAuth and grant complete console access. Do not set this variable in a deployed environment.
The console is served as an SPA at `/admin`; its tabs are deep-linkable via the URL path (`/admin/groups`, `/admin/logs`, `/admin/audit`). URLs outside `/admin` that do not match an endpoint return a plain `404` instead of the console. The console is served as an SPA at `/admin`; its tabs are deep-linkable via the URL path (`/admin/groups`, `/admin/logs`, `/admin/audit`). URLs outside `/admin` that do not match an endpoint return a plain `404` instead of the console.
All management endpoints (`/admin/api/*`) are documented in the [Admin API](../api/admin). Saved routes and groups are persisted to D1 (`d1_routes` / `d1_groups`) immediately, the KV cache is invalidated and the config cache is refreshed so the webhook pipeline picks them up on the next run. All management endpoints (`/admin/api/*`) are documented in the [Admin API](../api/admin). Saved routes and groups are persisted to D1 (`d1_routes` / `d1_groups`) immediately, the KV cache is invalidated and the config cache is refreshed so the webhook pipeline picks them up on the next run.
+1 -1
View File
@@ -41,7 +41,7 @@ GitHub / Gitea Webhook → Cloudflare Worker (Nuxt 4 / Nitro)
- **HTTP Framework**: Nuxt 4 / Nitro (H3) - **HTTP Framework**: Nuxt 4 / Nitro (H3)
- **Discord delivery**: Discord REST API (interactions via an Ed25519-verified HTTPS Interactions Endpoint) - **Discord delivery**: Discord REST API (interactions via an Ed25519-verified HTTPS Interactions Endpoint)
- **Telegram delivery**: Telegram Bot API (webhook with optional secret-token verification) - **Telegram delivery**: Telegram Bot API (webhook with optional secret-token verification)
- **Web UI**: Nuxt 4 (Vue 3 + Tailwind CSS v3) — server-rendered home/legal pages, client-side `/admin` console - **Web UI**: Nuxt 4 (Vue 3 + Tailwind CSS v4 + `@recloudstudio/ui`) — server-rendered home/legal pages, client-side `/admin` console
- **Storage**: Cloudflare D1 (authoritative for config & logs) + KV (cache/transient state) + optional R2 (oversized payloads) - **Storage**: Cloudflare D1 (authoritative for config & logs) + KV (cache/transient state) + optional R2 (oversized payloads)
- **Auth**: Web Crypto API (HMAC-SHA256, Ed25519), octokit (GitHub API) - **Auth**: Web Crypto API (HMAC-SHA256, Ed25519), octokit (GitHub API)
- **Language**: TypeScript - **Language**: TypeScript
+1 -1
View File
@@ -1,6 +1,6 @@
# Admin API # Admin API
管理端点用于管理路由、分组、成员、邀请、webhook 密钥、发送日志与审计日志。它们需要会话 Cookie,可通过 `GET /admin/login`(GitHub OAuth)获取;登录用户必须列在 `ADMIN_USER_IDS` 中,或管理某个分组。设置方法见[配置 → Web 控制台](../guide/configuration.md#web-ui)。 管理端点用于管理路由、分组、成员、邀请、webhook 密钥、发送日志与审计日志。它们需要会话 Cookie,可通过 `GET /admin/login`(GitHub OAuth)获取;登录用户必须列在 `ADMIN_USER_IDS` 中,或管理某个分组。仅限本地开发,精确设置 `DEBUG_MODE=true` 会跳过认证并授予完整权限,绝不能在部署环境启用。设置方法见[配置 → Web 控制台](../guide/configuration.md#web-ui)。
控制台本身在 `/admin` 提供;其标签页可通过 URL 路径直达(`/admin/groups`、`/admin/logs`、`/admin/audit`)。 控制台本身在 `/admin` 提供;其标签页可通过 URL 路径直达(`/admin/groups`、`/admin/logs`、`/admin/audit`)。
+1 -1
View File
@@ -36,7 +36,7 @@ https://your-worker.workers.dev
## 管理控制台 ## 管理控制台
参见[配置 → Web 控制台](../guide/configuration.md#web-ui)了解设置方法,管理端点的完整参考见 [Admin API](./admin)。管理端点需要会话 Cookie,可通过 `GET /admin/login`(GitHub OAuth)获取;登录用户必须列在 `ADMIN_USER_IDS` 中,或管理某个分组。 参见[配置 → Web 控制台](../guide/configuration.md#web-ui)了解设置方法,管理端点的完整参考见 [Admin API](./admin)。管理端点需要会话 Cookie,可通过 `GET /admin/login`(GitHub OAuth)获取;登录用户必须列在 `ADMIN_USER_IDS` 中,或管理某个分组。仅限本地开发,精确设置 `DEBUG_MODE=true` 会跳过认证并授予完整权限,绝不能在部署环境启用。
## 健康检查 ## 健康检查
+1 -1
View File
@@ -15,7 +15,7 @@ bun run dev # 启动本地开发服务器
```text ```text
app/ # Vue 3 UI(Nuxt app 目录) app/ # Vue 3 UI(Nuxt app 目录)
├── app.vue # 根组件 (NuxtPage) ├── app.vue # 根组件 (NuxtPage)
├── assets/css/main.css # Tailwind CSS v4 入口:@import "tailwindcss" + @theme inline 令牌(RGB 三元组 CSS 变量)+ @layer components (@apply) ├── assets/css/main.css # Tailwind CSS v4 入口:ReCloud UI 兼容的 RGB 别名 + 专用布局类
├── pages/ # index(落地页)、terms、privacy、admin/[...slug](控制台 SPA) ├── pages/ # index(落地页)、terms、privacy、admin/[...slug](控制台 SPA)
├── components/ # ConsolePage、RouteCard/Editor、GroupEditor、MembersPanel、WebhookPanel、 ├── components/ # ConsolePage、RouteCard/Editor、GroupEditor、MembersPanel、WebhookPanel、
│ # SendLogs、AuditLog、AppToasts、LegalLayout │ # SendLogs、AuditLog、AppToasts、LegalLayout
+3
View File
@@ -43,6 +43,7 @@ WebHooker 的运行需要若干密钥。本地开发时放入 `.dev.vars`,生
| `TELEGRAM_RICH_HEADER_HOST` | 外部 rich-header 服务的基础 URL;未设置时使用内置 `GET /api/richheader` 提供 Telegram 头像卡片 | 内置 `/api/richheader` | | `TELEGRAM_RICH_HEADER_HOST` | 外部 rich-header 服务的基础 URL;未设置时使用内置 `GET /api/richheader` 提供 Telegram 头像卡片 | 内置 `/api/richheader` |
| `BASE_URL` | OAuth 回调的公共 URL | `http://localhost:8787` | | `BASE_URL` | OAuth 回调的公共 URL | `http://localhost:8787` |
| `ADMIN_USER_IDS` | 允许访问 WebUI 的 GitHub 用户 ID(或登录名),逗号分隔 | 未设置时 WebUI 关闭 | | `ADMIN_USER_IDS` | 允许访问 WebUI 的 GitHub 用户 ID(或登录名),逗号分隔 | 未设置时 WebUI 关闭 |
| `DEBUG_MODE` | 仅本地开发:精确设为 `true` 时跳过全部 `/admin` 身份验证并授予完整权限 | 关闭 |
| `ALLOW_SELF_SIGNUP` | 开启(`1`/`true`)后,没有任何分组权限的 GitHub 用户首次登录会自动获得个人分组而非 403 | 关闭 | | `ALLOW_SELF_SIGNUP` | 开启(`1`/`true`)后,没有任何分组权限的 GitHub 用户首次登录会自动获得个人分组而非 403 | 关闭 |
| `AUDIT_RETENTION_DAYS` | 定时清理时审计日志的保留天数 | `90` | | `AUDIT_RETENTION_DAYS` | 定时清理时审计日志的保留天数 | `90` |
| `NUXT_PUBLIC_DOCS_URL` | 落地页使用的文档站 URL(客户端运行时配置) | 落地页默认值 | | `NUXT_PUBLIC_DOCS_URL` | 落地页使用的文档站 URL(客户端运行时配置) | 落地页默认值 |
@@ -59,6 +60,8 @@ WebHooker 在 `/admin` 提供内置配置控制台,可在浏览器中管理路
2. 打开 `/admin` 并使用 GitHub 登录。 2. 打开 `/admin` 并使用 GitHub 登录。
3. 没有任何访问权限的用户会得到 `403`,除非 `ALLOW_SELF_SIGNUP=1`(获得个人分组)或跟随分组[邀请链接](./groups#邀请)。 3. 没有任何访问权限的用户会得到 `403`,除非 `ALLOW_SELF_SIGNUP=1`(获得个人分组)或跟随分组[邀请链接](./groups#邀请)。
仅供本地调试:设置 `DEBUG_MODE=true` 可跳过 GitHub OAuth,并授予完整控制台权限。部署环境切勿设置此变量。
控制台以 SPA 形式在 `/admin` 提供;其标签页可通过 URL 路径直达(`/admin/groups`、`/admin/logs`、`/admin/audit`)。`/admin` 之外未匹配到端点的 URL 直接返回 `404`,而不会展示控制台。 控制台以 SPA 形式在 `/admin` 提供;其标签页可通过 URL 路径直达(`/admin/groups`、`/admin/logs`、`/admin/audit`)。`/admin` 之外未匹配到端点的 URL 直接返回 `404`,而不会展示控制台。
所有管理端点(`/admin/api/*`)见 [Admin API](../api/admin)。保存的路由和分组会立即持久化到 D1(`d1_routes` / `d1_groups`),并使 KV 缓存失效、刷新配置缓存,下一次 webhook 处理即会生效。 所有管理端点(`/admin/api/*`)见 [Admin API](../api/admin)。保存的路由和分组会立即持久化到 D1(`d1_routes` / `d1_groups`),并使 KV 缓存失效、刷新配置缓存,下一次 webhook 处理即会生效。
+1 -1
View File
@@ -41,7 +41,7 @@ GitHub / Gitea Webhook → Cloudflare Worker (Nuxt 4 / Nitro)
- **HTTP 框架**: Nuxt 4 / Nitro (H3) - **HTTP 框架**: Nuxt 4 / Nitro (H3)
- **Discord 投递**: Discord REST API(交互通过 Ed25519 验签的 HTTPS Interactions Endpoint) - **Discord 投递**: Discord REST API(交互通过 Ed25519 验签的 HTTPS Interactions Endpoint)
- **Telegram 投递**: Telegram Bot API(webhook 带可选 secret-token 校验) - **Telegram 投递**: Telegram Bot API(webhook 带可选 secret-token 校验)
- **Web UI**: Nuxt 4(Vue 3 + Tailwind CSS v3)——首页/法律页面服务端渲染,`/admin` 控制台客户端渲染 - **Web UI**: Nuxt 4(Vue 3 + Tailwind CSS v4 + `@recloudstudio/ui`)——首页/法律页面服务端渲染,`/admin` 控制台客户端渲染
- **存储**: Cloudflare D1(配置与日志权威)+ KV(缓存/临时状态)+ 可选 R2(超大负载) - **存储**: Cloudflare D1(配置与日志权威)+ KV(缓存/临时状态)+ 可选 R2(超大负载)
- **鉴权**: Web Crypto API (HMAC-SHA256、Ed25519)、octokit (GitHub API) - **鉴权**: Web Crypto API (HMAC-SHA256、Ed25519)、octokit (GitHub API)
- **语言**: TypeScript - **语言**: TypeScript
+10 -1
View File
@@ -2,6 +2,10 @@ import tailwindcss from "@tailwindcss/vite";
export default defineNuxtConfig({ export default defineNuxtConfig({
compatibilityDate: "2025-07-15", compatibilityDate: "2025-07-15",
modules: ["@recloudstudio/ui/nuxt"],
recloudUI: {
prefix: "Rc",
},
css: ["~/assets/css/main.css"], css: ["~/assets/css/main.css"],
// Target: Cloudflare Workers (single _worker.js via the cloudflare_module preset). // Target: Cloudflare Workers (single _worker.js via the cloudflare_module preset).
nitro: { nitro: {
@@ -18,12 +22,17 @@ export default defineNuxtConfig({
head: { head: {
title: "WebHooker", title: "WebHooker",
link: [ link: [
{ rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }, { rel: "icon", type: "image/svg+xml", href: "/logo.svg" },
{ {
rel: "stylesheet", rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap", href: "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap",
}, },
], ],
script: [
{
innerHTML: `(function(){try{var t=localStorage.getItem("wh-theme");var d=t==="dark"||(!t&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);if(d){document.documentElement.classList.add("dark");document.documentElement.setAttribute("data-theme","dark");}else if(t==="light"){document.documentElement.setAttribute("data-theme","light");}}catch(e){}})();`,
},
],
}, },
}, },
vite: { vite: {
+1
View File
@@ -24,6 +24,7 @@
"docs:preview": "vitepress preview docs" "docs:preview": "vitepress preview docs"
}, },
"dependencies": { "dependencies": {
"@recloudstudio/ui": "^0.2.0",
"h3": "^1.15.3", "h3": "^1.15.3",
"markdown-it": "^15.0.0", "markdown-it": "^15.0.0",
"nuxt": "^4.1.0", "nuxt": "^4.1.0",
+1
View File
@@ -8,6 +8,7 @@ export interface Env {
DISCORD_TOKEN?: string; DISCORD_TOKEN?: string;
BASE_URL?: string; BASE_URL?: string;
ADMIN_USER_IDS?: string; ADMIN_USER_IDS?: string;
DEBUG_MODE?: string;
DISCORD_PUBLIC_KEY?: string; DISCORD_PUBLIC_KEY?: string;
DISCORD_APPLICATION_ID?: string; DISCORD_APPLICATION_ID?: string;
TELEGRAM_TOKEN?: string; TELEGRAM_TOKEN?: string;
+5 -1
View File
@@ -11,7 +11,7 @@ import type { Route, Group, GroupMember, GroupRole, ForgeSource, FilterNode } fr
import { loadRoutes, saveRoutes } from "../config"; import { loadRoutes, saveRoutes } from "../config";
import { loadFragments, saveFragments, type NamedFragment } from "../fragments"; import { loadFragments, saveFragments, type NamedFragment } from "../fragments";
import { evaluateFilterNode, explainFilterNode } from "../events/filter-ast"; import { evaluateFilterNode, explainFilterNode } from "../events/filter-ast";
import { getAdminSession, destroyAdminSession, clearAdminCookie } from "./session"; import { getAdminSession, destroyAdminSession, clearAdminCookie, isDebugMode } from "./session";
import { saveGroups, loadGroups, identityMatches, normalizeGroupMembers } from "./groups"; import { saveGroups, loadGroups, identityMatches, normalizeGroupMembers } from "./groups";
import { import {
requireAnyAccess, requireAnyAccess,
@@ -492,6 +492,10 @@ function getRequestOrigin(event: H3Event): string {
/** GET /admin/login */ /** GET /admin/login */
export async function adminLogin(event: H3Event): Promise<void> { export async function adminLogin(event: H3Event): Promise<void> {
if (isDebugMode(cfEnv(event))) {
await sendRedirect(event, "/admin");
return;
}
await sendRedirect(event, "/auth/github?redirect=/admin"); await sendRedirect(event, "/auth/github?redirect=/admin");
} }
+6 -2
View File
@@ -1,7 +1,7 @@
import type { H3Event } from "h3"; import type { H3Event } from "h3";
import { createError, getHeader } from "h3"; import { createError, getHeader } from "h3";
import type { Group, GroupRole } from "../types"; import type { Group, GroupRole } from "../types";
import { getAdminSession, type AdminSession } from "./session"; import { getAdminSession, isDebugMode, type AdminSession } from "./session";
import { import {
loadGroups, loadGroups,
resolveScope, resolveScope,
@@ -28,9 +28,13 @@ const AUTH_KEY = "auth";
export async function loadAuth(event: H3Event): Promise<AuthContext | null> { export async function loadAuth(event: H3Event): Promise<AuthContext | null> {
const env = cfEnv(event); const env = cfEnv(event);
initConfigStore(env); initConfigStore(env);
const groups = await loadGroups(env.KV);
if (isDebugMode(env)) {
const session: AdminSession = { userId: "debug", login: "debug" };
return { session, scope: resolveScope(env, groups, session.userId, session.login), groups };
}
const session = await getAdminSession(env.KV, getHeader(event, "cookie")); const session = await getAdminSession(env.KV, getHeader(event, "cookie"));
if (!session) return null; if (!session) return null;
const groups = await loadGroups(env.KV);
const scope = resolveScope(env, groups, session.userId, session.login); const scope = resolveScope(env, groups, session.userId, session.login);
return { session, scope, groups }; return { session, scope, groups };
} }
+12
View File
@@ -8,7 +8,19 @@ export interface AdminSession {
login: string; login: string;
} }
export function isDebugMode(env: Env): boolean {
if (env.DEBUG_MODE === "true") return true;
const anyEnv = env as unknown as Record<string, string | undefined>;
if (anyEnv["debug_mode"] === "true") return true;
const proc = (globalThis as unknown as { process?: { env?: Record<string, string | undefined> } }).process;
if (proc?.env?.NODE_ENV !== "test") {
if (proc?.env?.DEBUG_MODE === "true" || proc?.env?.debug_mode === "true") return true;
}
return false;
}
export function isAdminUser(env: Env, userId: string, login: string): boolean { export function isAdminUser(env: Env, userId: string, login: string): boolean {
if (isDebugMode(env)) return true;
const ids = (env.ADMIN_USER_IDS ?? "") const ids = (env.ADMIN_USER_IDS ?? "")
.split(",") .split(",")
.map((s) => s.trim()) .map((s) => s.trim())
+7
View File
@@ -1,6 +1,7 @@
import { describe, it, expect, beforeEach } from "bun:test"; import { describe, it, expect, beforeEach } from "bun:test";
import { import {
isAdminUser, isAdminUser,
isDebugMode,
createAdminSession, createAdminSession,
getAdminSession, getAdminSession,
destroyAdminSession, destroyAdminSession,
@@ -72,6 +73,12 @@ const sampleRoutes: Route[] = [
]; ];
describe("isAdminUser", () => { describe("isAdminUser", () => {
it("enables the bypass only for the exact true value", () => {
expect(isDebugMode(createEnv({ DEBUG_MODE: "true" }))).toBe(true);
expect(isDebugMode(createEnv({ DEBUG_MODE: "TRUE" }))).toBe(false);
expect(isAdminUser(createEnv({ DEBUG_MODE: "true" }), "99999", "someone")).toBe(true);
});
it("allows matching user id", () => { it("allows matching user id", () => {
const env = createEnv({ ADMIN_USER_IDS: "12345,67890" }); const env = createEnv({ ADMIN_USER_IDS: "12345,67890" });
expect(isAdminUser(env, "12345", "other")).toBe(true); expect(isAdminUser(env, "12345", "other")).toBe(true);