dsh-plugin-weapp-gateway 0.8.54 → 0.8.56
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/README.md +10 -0
- package/lib/client.js +4 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
- 「兼容 App(备用)」的连接方式下拉与下方「配对入口」摘要卡片之间增加间距(16px),下拉不再紧贴提示卡片。
|
|
12
12
|
- 摘要卡片的内边距、下方「配对入口地址」输入框与其余配对布局保持不变。
|
|
13
13
|
- 全量测试通过。
|
|
14
|
+
### v0.8.56 · 修复「点击插件弹窗空白」
|
|
15
|
+
|
|
16
|
+
- 修复 v0.8.54 整合时丢失的两个 fork 派生值:`visibleDevices` 与 `showAllDevices` 状态。有已配对设备时,设备列表渲染直接抛 `ReferenceError: visibleDevices is not defined`,整块弹窗白屏(设备为 0 时走另一分支才没暴露)。
|
|
17
|
+
- 已用真实 `/mgw/status` + 23 台已配对设备的真实数据跑通完整面板渲染(97 节点),并核对全部 onClick/onChange 处理器与组件辅助函数均已定义。
|
|
18
|
+
- 全量测试通过。
|
|
19
|
+
### v0.8.55 · 修复设置页无法加载(locale 注入缺失)
|
|
20
|
+
|
|
21
|
+
- 修复 v0.8.54 引入的客户端加载失败:上游的语言同步 effect 引用了 `ctx.locale`,但 fork 未在 `inject` 里声明该服务,DSH 直接抛出 `cannot get property "locale" without inject`,整个客户端模块加载失败,设置页空白。
|
|
22
|
+
- fork 未引入上游的界面语言/多语言系统,遂整块移除语言同步 effect 与「界面语言」选择卡片(该卡片还引用了不存在的 `language`/`setUiLanguage`/`tr`),面板保持中文默认。
|
|
23
|
+
- `inject` 恢复为 `['slots']`;设置页四个分组与配对模块渲染恢复正常。
|
|
14
24
|
### v0.8.54 · 同步上游 0.12.1 新功能
|
|
15
25
|
|
|
16
26
|
- **生图工具图片转发**(tool-result-images-v1):`tool/result`、`tool/ptc-dispatch`、`tool/code-dispatch` 与会话历史快照携带生成图片附件元数据(PNG/JPEG/WebP/GIF,按附件 ID 去重),App 可直接展示生图结果;手机经控制连接 `attachment` 请求图片。
|
package/lib/client.js
CHANGED
|
@@ -607,6 +607,8 @@ window.__ModuleLoader__.load({
|
|
|
607
607
|
const [statusLoadError, setStatusLoadError] = React.useState(null)
|
|
608
608
|
const refreshRequests = React.useRef(new Map())
|
|
609
609
|
const manualRefreshRef = React.useRef(false)
|
|
610
|
+
// fork:离线设备折叠开关(上游整合时该状态丢失)。
|
|
611
|
+
const [showAllDevices, setShowAllDevices] = React.useState(false)
|
|
610
612
|
const [permissionSaving, setPermissionSaving] = React.useState(null)
|
|
611
613
|
const permissionLock = React.useRef(false)
|
|
612
614
|
const deviceRevision = React.useRef(0)
|
|
@@ -1222,6 +1224,8 @@ window.__ModuleLoader__.load({
|
|
|
1222
1224
|
const onlineDevices = (devices || []).filter((device) => device.online)
|
|
1223
1225
|
const offlineDevices = (devices || []).filter((device) => !device.online)
|
|
1224
1226
|
const orderedDevices = [...onlineDevices, ...offlineDevices]
|
|
1227
|
+
// fork:默认只列在线设备,展开后列全部(上游整合时该派生值丢失)。
|
|
1228
|
+
const visibleDevices = showAllDevices ? orderedDevices : onlineDevices
|
|
1225
1229
|
const selectedCount = orderedDevices.filter(device => selectedDeviceIds.has(device.id)).length
|
|
1226
1230
|
const deletingDevices = revokingIds.size > 0
|
|
1227
1231
|
const deviceActionsDisabled = deletingDevices || permissionSaving !== null
|
|
@@ -1328,21 +1332,6 @@ window.__ModuleLoader__.load({
|
|
|
1328
1332
|
toolNotice ? React.createElement('div', { style: { ...styles.muted, marginBottom: 10 } }, toolNotice) : null,
|
|
1329
1333
|
(error || deviceLoadError || statusLoadError) ? React.createElement('div', { style: styles.error, role: 'alert' }, error || deviceLoadError || statusLoadError) : null,
|
|
1330
1334
|
React.createElement('div', { hidden: activeSection !== 'general' },
|
|
1331
|
-
React.createElement('section', { style: styles.card },
|
|
1332
|
-
React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', gap: 14, alignItems: 'center', flexWrap: 'wrap' } },
|
|
1333
|
-
React.createElement('div', null,
|
|
1334
|
-
React.createElement('strong', null, tr('界面语言')),
|
|
1335
|
-
React.createElement('div', { style: { ...styles.muted, marginTop: 4 } }, tr('跟随 DSH 的语言设置,也可单独选择此插件的显示语言。'))),
|
|
1336
|
-
React.createElement(GatewaySelect, {
|
|
1337
|
-
'data-ui-language': true, 'aria-label': tr('界面语言'),
|
|
1338
|
-
style: { ...styles.input, width: 'auto', marginBottom: 0 },
|
|
1339
|
-
value: language.preference,
|
|
1340
|
-
onChange: event => setUiLanguage(event.target.value),
|
|
1341
|
-
},
|
|
1342
|
-
React.createElement('option', { value: 'system' }, tr('跟随 DSH')),
|
|
1343
|
-
React.createElement('option', { value: 'zh' }, '简体中文'),
|
|
1344
|
-
React.createElement('option', { value: 'en' }, 'English'),
|
|
1345
|
-
React.createElement('option', { value: 'ja' }, '日本語')))),
|
|
1346
1335
|
React.createElement('section', { style: styles.card },
|
|
1347
1336
|
React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', gap: 14, alignItems: 'center' } },
|
|
1348
1337
|
React.createElement('div', null,
|
|
@@ -1771,19 +1760,6 @@ window.__ModuleLoader__.load({
|
|
|
1771
1760
|
function apply(ctx) {
|
|
1772
1761
|
// Upstream 0.10.1: the panel stylesheet is injected once through an
|
|
1773
1762
|
// effect instead of being re-rendered inside the component tree.
|
|
1774
|
-
ctx.effect(() => {
|
|
1775
|
-
const syncLanguage = () => {
|
|
1776
|
-
hostLanguage = ctx.locale.getSnapshot().active
|
|
1777
|
-
publishUiLanguage()
|
|
1778
|
-
}
|
|
1779
|
-
syncLanguage()
|
|
1780
|
-
const unsubscribe = ctx.locale.subscribe(syncLanguage)
|
|
1781
|
-
return () => {
|
|
1782
|
-
unsubscribe()
|
|
1783
|
-
hostLanguage = undefined
|
|
1784
|
-
publishUiLanguage()
|
|
1785
|
-
}
|
|
1786
|
-
}, 'mobile-gateway: host language')
|
|
1787
1763
|
ctx.effect(() => {
|
|
1788
1764
|
const style = document.createElement('style')
|
|
1789
1765
|
style.textContent = panelCss
|