dsh-cherry-bridge 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ui/src/i18n.ts CHANGED
@@ -95,6 +95,15 @@ const zh: Dict = {
95
95
  'device.remove.confirm': '确认移除',
96
96
  'device.remove.warning': '移除后本机将不再连接该设备,凭据保留在对方一侧。',
97
97
  'device.cancel': '取消',
98
+ // -- forgotten addresses (issue #204) --------------------------------------
99
+ 'device.forget': '忘记',
100
+ 'device.remember': '恢复',
101
+ 'device.field.forgotten': '已忘记地址',
102
+ 'device.forgotten.hint':
103
+ '已忘记的地址不会再被连接;「恢复」只解除标记,桌面下次广播该地址时会重新加入。',
104
+ 'device.error.lastAddress': '不能忘记最后一个候选地址——先补一个地址,再忘记这个',
105
+ // The page-wide request ceiling (`api.ts`) reached a card action.
106
+ 'device.error.timeout': '请求长时间没有回应,已中止——请稍后重试',
98
107
  'device.error.nameRequired': '设备名称不能为空',
99
108
  'device.error.hostsRequired': '至少需要一个主机地址',
100
109
  'device.error.portInvalid': '端口必须是 1..65535 之间的整数',
@@ -129,7 +138,17 @@ const zh: Dict = {
129
138
  // keep matching.
130
139
  'wizard.failed': '配对失败:{stage}',
131
140
  'wizard.unknownError': '未知错误',
141
+ // NO VERDICT WORDING. This is the run deadline, not a stage: the pairing may
142
+ // have been approved while its frame was lost, so it points at the list right
143
+ // below (which the settle refreshes) instead of asserting an outcome.
144
+ // The page-wide request ceiling (`api.ts`): the device list gave up waiting.
145
+ 'app.error.timeout': '请求长时间没有回应,已中止——请确认宿主仍在运行;若反复出现,请重启宿主后再试',
146
+ 'wizard.timedOut':
147
+ '没有等到配对结果——若桌面端已批准,下面的设备列表里会出现该设备;否则请在 Cherry Studio 重新生成配对码后重试',
132
148
  'wizard.error.payloadRequired': '请先粘贴扫码页显示的配对信息',
149
+ // The pairing POST never answered. Names the LIKELY cause (a wedged host) and
150
+ // nothing about pairing itself, so the user does not go re-scanning a QR code.
151
+ 'wizard.error.timeout': '配对请求迟迟没有回应,已中止——请重试;若反复出现,宿主可能已卡住,重启后再试',
133
152
  // The stages the wizard narrates while a run is in flight.
134
153
  'wizard.stage.validate': '正在校验配对信息…',
135
154
  'wizard.stage.connect': '正在连接 Cherry Studio…',
@@ -182,6 +201,9 @@ const zh: Dict = {
182
201
  // A refusal whose code this panel has no copy for: the server's own message is
183
202
  // the best available explanation, so it is interpolated verbatim.
184
203
  'scope.saveFailed': '保存失败:{cause}',
204
+ // The page-wide request ceiling (`api.ts`), rendered where the server's own
205
+ // message would go: there is no server message when nothing answered.
206
+ 'scope.error.timeout': '请求长时间没有回应,已中止——请稍后重试',
185
207
  'scope.serverSaid': '服务端返回 {code}(HTTP {status})。',
186
208
  'scope.degraded.install': '隐藏层应用曾失败(install):相关 agent 的隐藏层未生效或无法确认,启用范围对它可能不适用',
187
209
  'scope.degraded.workspace-list': '注册表列表当前读不到',
@@ -251,6 +273,15 @@ const en: Dict = {
251
273
  'device.remove.confirm': 'Confirm removal',
252
274
  'device.remove.warning': 'This machine will stop connecting to the device. Its credentials stay on the peer.',
253
275
  'device.cancel': 'Cancel',
276
+ // -- forgotten addresses (issue #204) --------------------------------------
277
+ 'device.forget': 'Forget',
278
+ 'device.remember': 'Restore',
279
+ 'device.field.forgotten': 'Forgotten addresses',
280
+ 'device.forgotten.hint':
281
+ 'Forgotten addresses are never dialed. Restore only lifts the mark — the address comes back the next time the desktop advertises it.',
282
+ 'device.error.lastAddress': 'The last candidate address cannot be forgotten. Add one first.',
283
+ // See the zh entry: the page-wide request ceiling.
284
+ 'device.error.timeout': 'The request stopped answering and was abandoned. Try again in a moment.',
254
285
  'device.error.nameRequired': 'Device name cannot be empty',
255
286
  'device.error.hostsRequired': 'At least one host address is required',
256
287
  'device.error.portInvalid': 'Port must be an integer between 1 and 65535',
@@ -277,7 +308,14 @@ const en: Dict = {
277
308
  'wizard.succeeded': 'Paired',
278
309
  'wizard.failed': 'Pairing failed: {stage}',
279
310
  'wizard.unknownError': 'Unknown error',
311
+ // See the zh entry: the run deadline is not a verdict.
312
+ // See the zh entry: the page-wide request ceiling.
313
+ 'app.error.timeout': 'The request stopped answering and was abandoned. Check that the host is still running; if it keeps happening, restart it and try again.',
314
+ 'wizard.timedOut':
315
+ 'No pairing result arrived. If the desktop approved it, the device appears in the list below; otherwise generate a new pairing code in Cherry Studio and try again.',
280
316
  'wizard.error.payloadRequired': 'Paste the pairing payload shown on the scan page first',
317
+ // See the zh entry: the cause is the host, not the payload.
318
+ 'wizard.error.timeout': 'The pairing request stopped answering and was abandoned. Try again; if it keeps happening the host may be stuck — restart it and retry.',
281
319
  'wizard.stage.validate': 'Validating the pairing payload…',
282
320
  'wizard.stage.connect': 'Connecting to Cherry Studio…',
283
321
  'wizard.stage.claim': 'Exchanging credentials…',
@@ -327,6 +365,7 @@ const en: Dict = {
327
365
  'scope.savedPruned': 'Saved. The server pruned these stale selections: {list}.',
328
366
  'scope.reread': 'Reload',
329
367
  'scope.saveFailed': 'Save failed: {cause}',
368
+ 'scope.error.timeout': 'The request stopped answering and was abandoned. Try again in a moment.',
330
369
  'scope.serverSaid': 'The server answered {code} (HTTP {status}).',
331
370
  'scope.degraded.install':
332
371
  'Applying a hidden layer failed earlier (install): the affected agent’s hidden layer is not in effect or cannot be confirmed, so the tool scope may not apply to it',
package/ui/src/styles.css CHANGED
@@ -227,6 +227,30 @@
227
227
  overflow-wrap: anywhere;
228
228
  }
229
229
 
230
+ /* A per-host action list (issue #204): the address, then its own control. The
231
+ buttons stay small so a record with a dozen candidates stays ONE fact row
232
+ instead of a column of chrome. */
233
+ .cherry-address-list {
234
+ display: flex;
235
+ flex-wrap: wrap;
236
+ gap: 4px 10px;
237
+ margin: 0;
238
+ padding: 0;
239
+ list-style: none;
240
+ }
241
+
242
+ .cherry-address-list li {
243
+ display: inline-flex;
244
+ align-items: center;
245
+ gap: 6px;
246
+ }
247
+
248
+ .cherry-address-list button {
249
+ padding: 0 6px;
250
+ font-size: 11px;
251
+ line-height: 1.6;
252
+ }
253
+
230
254
  .cherry-inline-form {
231
255
  display: flex;
232
256
  flex-direction: column;
package/ui/src/types.ts CHANGED
@@ -39,6 +39,13 @@ export interface DeviceSummary {
39
39
  hosts: string[]
40
40
  port: number
41
41
  ports: Record<string, number>
42
+ /**
43
+ * The addresses the operator has FORGOTTEN (issues #185/#204): not dialed, and
44
+ * not re-learned from the desktop's own advertisement until 恢复 lifts the
45
+ * mark. Required — `GET /devices` emits an empty list rather than omitting the
46
+ * key — so the card branches on `length`, never on presence.
47
+ */
48
+ forgottenHosts: string[]
42
49
  }
43
50
 
44
51
  /** A `PATCH /devices/:id` body; every field optional, `hosts` is whole-replace. */