Commit Graph
40 Commits
Author SHA1 Message Date
chick ef280b53c9 fix(web): 修复无正文请求被 JSON 解析器拒绝导致"删除节点"失效
控制台所有请求共用的 request() 无条件带上 Content-Type: application/json,
包括无正文的 DELETE /api/v1/instances/:id 与 POST test-connection。Fastify
的 JSON 解析器见到"声明了 JSON 却是空正文"会直接回 400 HTTP_400,请求在
进入路由之前就被拒——所以"删除节点"看起来点了没反应,日志里三次真实尝试
全部是 400,而路由本身完好。

复现(对 8788 实测):
- DELETE + Content-Type: json + 空正文 → 400 HTTP_400(旧行为,坏)
- DELETE 不带 Content-Type          → 401 CONSOLE_AUTH_REQUIRED(到达路由)
- DELETE + Content-Type: json + {}  → 401(能解析,故非路由问题)
- GET    + Content-Type: json + 空   → 401(Fastify 对 GET 不解析正文)

修复:Content-Type 只在确实有正文时才发送。删除的意图本来就在头部
(If-Match / X-Preparation-Id / X-Confirmation-Token)里,无正文属正常形状。

同源的 POST test-connection 也一并修好。iOS 客户端本就用 route.body != nil
判断,与修复后的契约一致——Web 侧是唯一的例外。

回归测试:
- web:断言 DELETE 只发 Accept、不发 Content-Type
- api:断言真实形状到达路由并完成删除(202 且节点转 404),
  同时断言"声称 JSON 却空正文"仍须显式 400、节点必须留存

验证:147 文件 / 1371 测试全绿;lint 干净;typecheck 干净;dist 已重建且
8788 正在服务的 bundle 与磁盘一致(md5 相同)。
2026-09-29 18:49:17 +08:00
chick 001659ed91 style(web): unify panel, group and state controls
Standardize panel actions, group filters, segmented modes, workbench tabs, message filters, identity controls and privacy toggles on the shared button scale. Add cascade-aware tests so stale compact sizes and low-contrast states cannot return.
2026-09-08 19:58:10 +08:00
chick bfe5025943 style(web): close control-system gaps found in the deep sweep 2026-09-08 08:02:01 +08:00
chick c0adbcbc8a style(web): unify accessible control system 2026-09-08 01:00:22 +08:00
chick c1be714ba4 perf,feat(events),hardening: second review pass
Fleet overview N+1:
- InstanceResourceService gains a 30s TTL cache with single-flight
  coalescing; the overview no longer fires six live upstream requests per
  device on every render (plus the re-login storm), while the per-device
  detail route probes live via force:true

Event journal becomes live:
- job terminal transitions (manual executions and the interrupted sweep)
  now append to the journal, so /api/v1/events SSE feeds the frontend's
  invalidation controller that was built but never received events
- journal pruning moves off the append hot path (was an unindexable
  full-table json_extract scan per insert) onto the retention timer

Console auth hardening:
- scrypt upgraded from N=16384 to N=2^16 (OWASP interactive guidance);
  a new password_kdf column records the derivation per row and legacy
  hashes rehash transparently on the next successful login without
  invalidating sessions (migration 18)

Legacy stack:
- instance URL validation blocks IPv4-compatible IPv6 after WHATWG
  canonicalization (::a9fe:a9fe metadata, ::7f00:1 loopback slipped past)
- status polls cool down auto-login for 60s after a failed attempt so a
  stale saved password cannot hammer the device into an account lockout

Build hygiene:
- web bundle splits app (410kB) from vendor (212kB) so framework code
  stays cacheable across releases; stale root package-lock.json removed
  (pnpm is the only lockfile)
2026-09-07 02:20:41 +08:00
chick f6319374cd feat(web): add console update panel, system maintenance path and connection settings UI
- Add online update workflow with plan, backup and install states.

- Expose maintenance paths, component backup jobs and connection authorization modes.

- Align auth and automation screens with the fused control plane.
2026-09-07 00:45:44 +08:00
chick 6d251dab7b feat(web): fuse Hub device modules into instance panels with SMS aggregation
- Consolidate cellular, eSIM, network and device module interactions.

- Add aggregate SMS workflows and identity-aware action controls.

- Extend SMSC privacy handling and module action icons.
2026-09-07 00:45:38 +08:00
chick 864e1bd90c feat(web): rebuild fleet page with Hub-style identity guard and context actions
- Surface device identity state, carrier details and upstream link health.

- Add fleet-level identity monitoring and restart/baseband context actions.

- Apply consistent notification scoping across fleet views.
2026-09-07 00:45:28 +08:00
chick 8b7df8cb65 fix(instances): release the hub binding before forgetting a node
Deletion now follows the published contract: prepare returns the one-time
token and the console spends it on DELETE /api/v1/instances/:id with
If-Match, where the generic execute endpoint had been rejecting it as an
operation the safe transport cannot replay.

An online device is told to release its own binding first. A refusal keeps
the record and reports UNBIND_FAILED on the job item so the console can say
why the node is still there; a node that never answers a heartbeat is
forgotten locally.
2026-09-05 19:52:27 +08:00
chick a75badeb58 feat(web): rebuild the console around the fused control plane
Render the Hub feature set in the existing Animal Island styling: fleet
messages, notification centre, log centre, organisation panel, per-instance
device module panels and the settings backup, connection and maintenance
surfaces.
2026-09-05 18:53:04 +08:00
Codex 9bc0f27f12 fix: canonicalize browser navigation after commit 2026-07-30 22:35:37 +08:00
Codex 95abd09c39 style: format navigation tests 2026-07-30 22:21:29 +08:00
Codex 144e17c220 feat: navigate workspaces without page reloads 2026-07-30 22:10:59 +08:00
Codex 3a6652be0f fix: simplify top-level settings 2026-07-30 22:08:34 +08:00
Codex d60cff1dd8 feat(web): protect phone data and polish release UI 2026-07-30 20:16:50 +08:00
Codex 570edf6bb2 feat: rebuild warm operations workbench 2026-07-30 14:49:33 +08:00
chick bbd94b5672 feat(ui): simplify fleet cards by moving edit/delete into detail
Hide instance IDs and config/delete controls on overview cards; keep
service/system restart only, with edit still available from detail.
2026-07-22 00:20:32 +08:00
chick 3c7018a792 feat(ui): refine fleet search/filter toolbar with status chips
Adopt Portainer/Beszel-style fleet controls: prominent search, status
facet chips with counts, active filter chips, result count, and
primary-row sort/select. Keep advanced filters collapsed for secondary
facets. Tests and production dist rebuild for gateway 8788.
2026-07-21 23:31:08 +08:00
chick 7d0363d275 feat(ui): topbar settings, hide dev badge, premium fleet cards
Collapse the redundant left workspace nav (overview is already the home
surface) and move Settings into the top bar. Hide placeholder `dev`
version badges. Restyle fleet cards with softer elevation, status
summary chips, hover sheen, and reduced-motion-safe entrance motion.
2026-07-21 23:14:37 +08:00
chick 9ea8021cce feat(fleet): card-only UI with progressive load and restart ops
Drop the redundant advanced table so fleet stays resource-first cards.
Keep multi-select batch service/system restart via prepare→execute, card
restarts, overview system ops, and progressive fleet loading.
2026-07-21 22:56:55 +08:00
chick ebed4c1969 feat(auth): allow trusted remote bootstrap and add installer 2026-07-19 21:10:16 +08:00
chick 49ee4e6570 feat(web): redesign fleet cards and instance workspace 2026-07-19 18:54:26 +08:00
chick f2803896a8 feat(auth): protect aggregate console with password login 2026-07-19 17:13:43 +08:00
chick 75682b8134 feat(web): make instance detail the operations workbench 2026-07-19 14:05:06 +08:00
chick f7d69a0fa7 feat(web): prioritize SMS operations workspace 2026-07-19 10:30:52 +08:00
chick 0112e3320a feat(sms): add real instance message workflow 2026-07-19 02:12:57 +08:00
chick 23f18963ef feat(fleet): show instance resource metrics 2026-07-19 00:22:23 +08:00
chick 2411801240 feat(web): make instance overview card-first 2026-07-18 23:23:41 +08:00
chick abfd07f8a3 feat(web): localize and redesign operations console 2026-07-18 22:22:41 +08:00
chick cc8eb0f54b fix(web): contain jobs table on narrow screens 2026-07-18 03:53:25 +08:00
chick 88d41a7a18 feat(web): connect jobs and audit workspaces 2026-07-18 01:42:17 +08:00
chick e46e81ea77 feat(web): add jobs audit and settings workspaces 2026-07-17 23:08:03 +08:00
chick 5eb8680393 feat(web): complete capability-driven instance modules 2026-07-17 21:48:20 +08:00
chick 0c84e8c88e feat(web): add messages and calls module slices 2026-07-17 20:27:53 +08:00
chick d0fd943082 feat(web): add cellular and network module slices 2026-07-17 20:15:04 +08:00
chick 4a595540e9 feat(web): add overview system module foundation 2026-07-17 19:40:13 +08:00
chick be1741c2f8 feat(web): add durable control-plane event updates 2026-07-17 18:31:07 +08:00
chick 6e817f380a feat(web): complete fleet and instance management slices 2026-07-17 17:12:35 +08:00
chick 4093634e13 feat(web): add runnable fleet console foundation 2026-07-17 16:02:15 +08:00
chick aa3c3f9803 build: establish strict TypeScript workspace 2026-07-16 09:34:50 +08:00