Remove the API relay link and the ESP32 device feature

Two pieces of upstream promotion came out of this deployment.

The sidebar "apiRelay" tab only opened a registration page on a third-party
site, so it goes with no replacement.

The circuit badge next to Settings was not what it looked like. It opened an
ESP32 device manager: add a device, show LAN status, remote connect/disconnect,
rename, delete, backed by six REST routes and an mcu_devices table. The purchase
button inside that dialog was the promotional part; the rest was real device
management. Since the hardware is out of scope here, the entire feature is
removed rather than just the link that pointed upstream - UI entry, client API,
routes, controller, store, schema, locale strings, and the one GlobalAgentServer
method that only existed to answer its status column.

Table creation is dropped but no DROP TABLE was added, so an already-provisioned
database keeps its rows as harmless orphans instead of losing data on upgrade.

DevicesView and the hermes.devices route are untouched: that is LAN device
discovery, a separate feature.

AGENTS.md now records the removal so the badge does not come back.
This commit is contained in:
2026-10-19 01:32:51 +08:00
parent 3c963bb1d9
commit 77b1858163
22 changed files with 49 additions and 1405 deletions
@@ -0,0 +1,40 @@
---
date: 2026-10-17
pr: pending
feature: Remove the upstream ESP32/MCU device panel from the chat sidebars
impact: Sidebar-only deletion. Both files lose one child component (SettingsCircuitBadge) and its import from the settings row at the bottom of the page sidebar. No chat store, no message rendering, no /chat-run payload, no streaming, and no tool-call path is touched. Nothing in the chat chain gains or loses a capability.
---
## What changed
`ChatPanel.vue` and `GroupChatPanel.vue` each rendered `<SettingsCircuitBadge />`
next to the settings button in `.page-sidebar-bottom`. Both now omit it.
## Why
The badge opened an ESP32/MCU device management dialog. Its only outbound call to
the upstream operator was the "purchase" button inside that dialog, but the rest was
real functionality (add device, LAN status, remote connect/disconnect, rename,
delete) backed by six REST routes and the `mcu_devices` table. The hardware is out
of scope for this deployment, so the whole feature is gone rather than hidden.
## Removal scope
- `SettingsCircuitBadge.vue`, `api/hermes/mcu-devices.ts`
- server `routes/mcu-devices.ts`, `controllers/mcu-devices.ts`,
`db/hermes/mcu-devices-store.ts`, the `routes/index.ts` registration, and the
`mcu_devices` entry in `schemas.ts`
- `GlobalAgentServer.hasMcuDeviceCode()`, which only existed to answer the panel's
LAN-status column
- `mcuDevices.*` locale keys in both `zh.ts` and `en.ts`
- the corresponding harness and `no-legacy-brand` whitelist entries
## Deliberately kept
- `DevicesView.vue` and the `hermes.devices` route. That is LAN device discovery
backed by `@/api/hermes/devices`, a separate feature from MCU device management.
- `packages/server/src/services/global-agent/server.ts` itself. Only the one
now-unused method was removed; the relay is load-bearing for other features.
- Existing `mcu_devices` tables in already-provisioned databases. The table
creation was dropped but no `DROP TABLE` was added, so an old deployment keeps
its rows as harmless orphans instead of losing data on upgrade.
+3 -9
View File
@@ -45,13 +45,7 @@
- **位置**:`packages/client/src/views/hermes/WorkflowView.vue`,`showWorkflowBatchDeleteConfirm`
- **证据**:naive 的 `NPopconfirm v-model:show` 需要它;Arco 的 `a-popconfirm` 无 `show` prop 后它失去读取方,只剩写。关闭改由 `@ok`/`@cancel` 驱动
### 6. 两个弹窗共用一个 saving ref
- **现象**:新增设备弹窗与改名弹窗同时存在时,按钮的 loading/disabled 会互相干扰
- **位置**:`packages/client/src/components/layout/SettingsCircuitBadge.vue`
- **证据**:两个 modal 共用 `saving`。迁移前就是这样
### 7. ProfileCreateModal 有两个重复的 style 块
### 6. ProfileCreateModal 有两个重复的 style 块
- **现象**:无功能影响
- **位置**:`packages/client/src/components/hermes/profiles/ProfileCreateModal.vue`
@@ -154,7 +148,7 @@
### 表格列的省略与 tooltip
- **文件**:`SettingsCircuitBadge.vue`、`UserManagementSettings.vue`
- **文件**:`UserManagementSettings.vue`
- **备注**:naive 的 `ellipsis: { tooltip: true }` → Arco 的 `ellipsis: true` + 列顶层 `tooltip: true`
- **需确认**:长文本省略后悬浮能显示完整内容
@@ -167,7 +161,7 @@
### 弹窗的遮罩/ESC 行为
- **风险**:Arco 默认 `maskClosable` 和 `escToClose` 都是 `true`。用户填了一半的表单按 ESC 或点遮罩会**直接丢弃且不重置**
- **涉及**:`VoiceApiFormModal.vue`、`VoiceApiConfigurator.vue`、`SettingsCircuitBadge.vue` 的设备面板
- **涉及**:`VoiceApiFormModal.vue`、`VoiceApiConfigurator.vue`
- **需确认**:是否应该设 `:mask-closable="false"` / `:esc-to-close="false"`
### 模型选择弹窗(ProviderFormModal)