dsh-miloco-bridge 0.1.1 → 0.1.3
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 +2 -2
- package/cordis.patch.yml +78 -2
- package/docs/ARCHITECTURE.md +11 -4
- package/docs/INSTALL.md +21 -10
- package/docs/TOOLS.md +1 -1
- package/docs/VERIFICATION.md +2 -2
- package/lib/client.js +65 -12
- package/lib/deploy.js +236 -38
- package/lib/github-release.js +162 -0
- package/lib/index.js +44 -2
- package/lib/settings-api.js +85 -1
- package/lib/tools-entry.js +40 -6
- package/lib/tools.js +62 -4
- package/package.json +1 -1
- package/skills/miloco-devices/SKILL.md +3 -2
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ dsh plugin --profile web add github:exa160/dsh-miloco-bridge
|
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
# 发布包
|
|
51
|
-
dsh plugin --profile web add file:dist/dsh-miloco-bridge-0.1.
|
|
51
|
+
dsh plugin --profile web add file:dist/dsh-miloco-bridge-0.1.3.tgz
|
|
52
52
|
|
|
53
53
|
# 本地开发(link)
|
|
54
54
|
./install.sh --profile web
|
|
@@ -102,7 +102,7 @@ systemctl --user restart dsh-web.service
|
|
|
102
102
|
## 开发
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
npm test #
|
|
105
|
+
npm test # 78 项测试
|
|
106
106
|
npm run selftest # 离线自检
|
|
107
107
|
npm run verify:readonly # 真实 Miloco 只读接口
|
|
108
108
|
npm run pack:bundle # 生成 dist/*.tgz
|
package/cordis.patch.yml
CHANGED
|
@@ -53,10 +53,22 @@
|
|
|
53
53
|
minLevel: "all"
|
|
54
54
|
deploy:
|
|
55
55
|
repo: "https://github.com/XiaoMi/xiaomi-miloco"
|
|
56
|
+
# 一键部署下载官方 release install.sh,不再 clone 源码。
|
|
56
57
|
# 留空 = $DSH_HOME/plugin-data/dsh-miloco-bridge/xiaomi-miloco
|
|
57
|
-
#
|
|
58
|
+
# (release 部署不创建该目录;仅保留给旧源码部署/卸载清理)
|
|
58
59
|
sourceDir: ""
|
|
59
|
-
|
|
60
|
+
# --skip-openclaw 阻止上游安装 OpenClaw 插件;--agent-platform=openclaw
|
|
61
|
+
# 只用于通过上游非交互式平台检测,实际由 DSH adapter 接管。
|
|
62
|
+
installArgs: ["--skip-openclaw", "--agent-platform=openclaw", "--lang=zh"]
|
|
63
|
+
# 直连 GitHub 失败时按顺序尝试这些镜像(直接拼接原 URL)。
|
|
64
|
+
githubMirrors:
|
|
65
|
+
- "https://gh-proxy.com/"
|
|
66
|
+
- "https://gh-proxy.org/"
|
|
67
|
+
# release 包默认从第一个镜像下载;留空 = 自动拼接 releases/download。
|
|
68
|
+
downloadSite: ""
|
|
69
|
+
# 额外的 uv 索引,不覆盖用户默认索引;PyPI 带 upload-time 元数据,
|
|
70
|
+
# 部分国内镜像缺少该元数据会触发安装器 exclude-newer 解析失败。
|
|
71
|
+
uvIndex: "https://pypi.org/simple"
|
|
60
72
|
# 设置页里不展示任何「DSH 默认模型」配置项。模型下拉只有
|
|
61
73
|
# 「跟随该对话」+ 实际模型;不选模型就完全不动会话的模型选择。
|
|
62
74
|
# ------------------------------------------------------------------
|
|
@@ -83,3 +95,67 @@
|
|
|
83
95
|
overlayFile: ""
|
|
84
96
|
stateFile: ""
|
|
85
97
|
cwd: ""
|
|
98
|
+
# 保留标准 DSH Agent 的工具面;子插件只在 miloco 预设内生效。
|
|
99
|
+
- id: tool-bash
|
|
100
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
101
|
+
disabled: !!js process.platform === 'win32'
|
|
102
|
+
- id: tool-pwsh
|
|
103
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
104
|
+
disabled: !!js process.platform !== 'win32'
|
|
105
|
+
- id: tool-fs
|
|
106
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
107
|
+
- id: tool-fs-search
|
|
108
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
109
|
+
config:
|
|
110
|
+
sampleOverCapGlobResults: false
|
|
111
|
+
- id: tool-jobs
|
|
112
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
113
|
+
- id: tool-schedule
|
|
114
|
+
name: '@deepseek-ai/dsh-tool-schedule'
|
|
115
|
+
- id: skill-filesystem
|
|
116
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
117
|
+
- id: tool-skill
|
|
118
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
119
|
+
- id: command-goal
|
|
120
|
+
name: '@deepseek-ai/dsh-command-goal'
|
|
121
|
+
- id: tool-goal
|
|
122
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
123
|
+
- id: tool-ask-user
|
|
124
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
125
|
+
- id: tool-todo
|
|
126
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
127
|
+
config:
|
|
128
|
+
allowParallelInProgress: true
|
|
129
|
+
- id: tool-web
|
|
130
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
131
|
+
config:
|
|
132
|
+
fetch: true
|
|
133
|
+
searchTimeoutMs: 60000
|
|
134
|
+
- id: present
|
|
135
|
+
name: '@deepseek-ai/dsh-tool-present'
|
|
136
|
+
- id: delegation
|
|
137
|
+
name: cordis:group
|
|
138
|
+
group: true
|
|
139
|
+
isolate:
|
|
140
|
+
workflowEngine: true
|
|
141
|
+
config:
|
|
142
|
+
- id: tool-subagent-control
|
|
143
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
144
|
+
- id: tool-subagent
|
|
145
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
146
|
+
config:
|
|
147
|
+
provider: spawn
|
|
148
|
+
toolName: subagent
|
|
149
|
+
modelSelection: true
|
|
150
|
+
modelDiscovery: true
|
|
151
|
+
- id: tool-subagent-fork
|
|
152
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
153
|
+
config:
|
|
154
|
+
provider: fork
|
|
155
|
+
toolName: subagent_fork
|
|
156
|
+
- id: workflow-ptc
|
|
157
|
+
name: '@deepseek-ai/dsh-workflow-ptc'
|
|
158
|
+
config:
|
|
159
|
+
provider: spawn
|
|
160
|
+
- id: tool-workflow
|
|
161
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -36,7 +36,7 @@ lib/
|
|
|
36
36
|
├── miloco-client.js Miloco HTTP 客户端(连接优先级、envelope 解包)
|
|
37
37
|
├── push.js 入站推送:鉴权、目标解析、会话恢复、等待 turn
|
|
38
38
|
├── settings-api.js 设置 API 路由
|
|
39
|
-
├── deploy.js 一键部署(启动已有 /
|
|
39
|
+
├── deploy.js 一键部署(启动已有 / 下载 release 安装器 / 写 adapter)
|
|
40
40
|
├── uninstall.js 卸载 Miloco(停服务 / 移除 adapter / 可选删数据或源码)
|
|
41
41
|
├── perception.js 感知事件优先级解析与阈值过滤
|
|
42
42
|
├── client.js 浏览器设置页(无构建步骤)
|
|
@@ -194,13 +194,20 @@ push.perception.minLevel = all | low | medium | high
|
|
|
194
194
|
|
|
195
195
|
1. 健康检查 `127.0.0.1:1810`;
|
|
196
196
|
2. 已装 Miloco → `miloco-cli service start`;
|
|
197
|
-
3. 未装 →
|
|
198
|
-
4.
|
|
197
|
+
3. 未装 → 下载官方 release `install.sh`(直连失败时走 GitHub 镜像);
|
|
198
|
+
4. 以 headless agent 模式运行 `install.sh --agent-prepare` + `--agent-finish`
|
|
199
|
+
(`--skip-openclaw --agent-platform=openclaw --lang=zh`);
|
|
199
200
|
5. 启动服务并等待健康;
|
|
200
201
|
6. 安装 adapter,写令牌;
|
|
201
202
|
7. 写 overlay 的连接与推送令牌。
|
|
202
203
|
|
|
203
|
-
所有子进程用 `spawn(command, args)`,不做 shell
|
|
204
|
+
所有子进程用 `spawn(command, args)`,不做 shell 字符串拼接。
|
|
205
|
+
`--agent-platform=openclaw` 只用于通过上游平台的非交互检测,
|
|
206
|
+
`--skip-openclaw` 保证不安装 OpenClaw 插件,实际由 DSH adapter 接管。
|
|
207
|
+
|
|
208
|
+
镜像模式的一键升级复用同一 release 安装器:下载 → `--agent-prepare` →
|
|
209
|
+
`--agent-finish` → 启动服务 → 写 adapter/webhook。升级状态与日志独立于部署,
|
|
210
|
+
日志在 `$MILOCO_HOME/log/dsh-miloco-upgrade.log`;命令参数和子进程输出都会脱敏。
|
|
204
211
|
|
|
205
212
|
## 9. 安全边界
|
|
206
213
|
|
package/docs/INSTALL.md
CHANGED
|
@@ -33,14 +33,14 @@ npm 新包可能处于审核期;若 `dsh plugin add dsh-miloco-bridge` 暂时
|
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
npm run pack:bundle
|
|
36
|
-
# dist/dsh-miloco-bridge-0.1.
|
|
37
|
-
dsh plugin --profile web add "file:/path/to/dist/dsh-miloco-bridge-0.1.
|
|
36
|
+
# dist/dsh-miloco-bridge-0.1.3.tgz
|
|
37
|
+
dsh plugin --profile web add "file:/path/to/dist/dsh-miloco-bridge-0.1.3.tgz"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
或:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
./install.sh --profile web --bundle dist/dsh-miloco-bridge-0.1.
|
|
43
|
+
./install.sh --profile web --bundle dist/dsh-miloco-bridge-0.1.3.tgz
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
### 1.3 手动配置
|
|
@@ -94,16 +94,17 @@ install.sh
|
|
|
94
94
|
3. 点「一键部署 Miloco」;
|
|
95
95
|
4. 面板会实时显示部署日志。流程:
|
|
96
96
|
- 若检测到已安装的 `miloco-cli` 与 `$MILOCO_HOME/config.json`,先尝试 `service start`;
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
- 否则下载官方 release `install.sh`(GitHub 直连失败时走 `gh-proxy.com` / `gh-proxy.org`);
|
|
98
|
+
- 以 headless agent 模式运行 `install.sh --agent-prepare --skip-openclaw --agent-platform=openclaw --lang=zh`
|
|
99
|
+
和 `install.sh --agent-finish ...`(`openclaw` 只用于通过上游平台检测,不会安装 OpenClaw 插件);
|
|
100
|
+
- 安装器使用 `UV_CACHE_DIR=$MILOCO_HOME/.uv-cache`、额外 `UV_INDEX`(默认 PyPI)
|
|
101
|
+
和镜像下载 release 包(`MILOCO_DOWNLOAD_URL`,默认第一个 GitHub 镜像);
|
|
100
102
|
- 启动后端并等待 `127.0.0.1:1810` 健康;
|
|
101
103
|
- 安装本插件的 adapter,生成/复用推送令牌,写入 overlay。
|
|
102
104
|
5. 部署完成后按面板提示绑定米家账号、开启摄像头感知。
|
|
103
105
|
|
|
104
|
-
>
|
|
105
|
-
>
|
|
106
|
-
> 或其它 DSH 进程用户不可写的路径;部署前会显式检查并给出中文错误。
|
|
106
|
+
> **MILOCO_HOME 必须可写**:默认 `~/.miloco`,部署前会显式检查并给出中文错误。
|
|
107
|
+
> release 部署不再创建源码目录;`deploy.sourceDir` 仅用于旧源码部署或卸载清理。
|
|
107
108
|
|
|
108
109
|
> 一键部署会运行上游安装器,可能安装 Python 依赖并占用较多磁盘。
|
|
109
110
|
> 请先确认你接受 Xiaomi Miloco 的许可证与资源开销。
|
|
@@ -272,10 +273,20 @@ systemctl --user restart dsh-web.service
|
|
|
272
273
|
|
|
273
274
|
```bash
|
|
274
275
|
npm run pack:bundle
|
|
275
|
-
dsh plugin --profile web add "file:dist/dsh-miloco-bridge-0.1.
|
|
276
|
+
dsh plugin --profile web add "file:dist/dsh-miloco-bridge-0.1.3.tgz"
|
|
276
277
|
systemctl --user restart dsh-web.service
|
|
277
278
|
```
|
|
278
279
|
|
|
280
|
+
### 8.3 Miloco 版本更新
|
|
281
|
+
|
|
282
|
+
「运行状态 → 检查更新」按顺序检查:Miloco 后端 → 直连 GitHub → GitHub 镜像。
|
|
283
|
+
|
|
284
|
+
- 后端能访问 GitHub:走 Miloco 原有一键升级;
|
|
285
|
+
- 后端不可达但镜像可用:由插件下载 release 安装器并执行 headless 升级
|
|
286
|
+
(`--agent-prepare` + `--agent-finish`,继续使用 `MILOCO_HOME` 和镜像下载);
|
|
287
|
+
- 源码/dev 部署不提供一键升级;
|
|
288
|
+
- 升级过程写入 `$MILOCO_HOME/log/dsh-miloco-upgrade.log`。
|
|
289
|
+
|
|
279
290
|
卸载插件:
|
|
280
291
|
|
|
281
292
|
```bash
|
package/docs/TOOLS.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|---|---|---|---|
|
|
13
13
|
| `miloco_status` | — | `/api/admin/status` + `/api/perception/engine/status` | 运行状态、账号、引擎、数据库 |
|
|
14
14
|
| `miloco_capabilities` | — | — | 当前模式与已注册工具 |
|
|
15
|
-
| `miloco_device_list` | `room
|
|
15
|
+
| `miloco_device_list` | `room?`, `name?`, `online_only?`, `limit?`, `offset?`, `include?[]` | `/api/miot/device_list` | 默认 `did/name/online/room_name/model/home_id`,默认最多 500 台;`include` 可取 `icon/local_ip/home_name/order_time/lan_online/sub_devices` |
|
|
16
16
|
| `miloco_device_spec` | `did` | `/api/miot/devices/{did}/spec` | SPEC:iid、access、枚举、范围 |
|
|
17
17
|
| `miloco_device_status` | `did`, `iid?` | `/api/miot/devices/{did}/status` | 当前属性值 |
|
|
18
18
|
| `miloco_device_history` | — | `/api/miot/device_history` | 最近访问的 iid |
|
package/docs/VERIFICATION.md
CHANGED
|
@@ -220,7 +220,7 @@ dsh-miloco-bridge: push delivery failed ... # 仅在失败时
|
|
|
220
220
|
|
|
221
221
|
```bash
|
|
222
222
|
npm run pack:bundle
|
|
223
|
-
tar -tzf dist/dsh-miloco-bridge-0.1.
|
|
223
|
+
tar -tzf dist/dsh-miloco-bridge-0.1.3.tgz | head -30
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
预期包含:`package/lib/*`、`package/skills/*/SKILL.md`、`package/adapter/dsh_adapter.py`、
|
|
@@ -230,7 +230,7 @@ tar -tzf dist/dsh-miloco-bridge-0.1.1.tgz | head -30
|
|
|
230
230
|
|
|
231
231
|
```bash
|
|
232
232
|
DSH_HOME=/tmp/dsh-miloco-bundle-verify \
|
|
233
|
-
dsh plugin --profile web add "file:$PWD/dist/dsh-miloco-bridge-0.1.
|
|
233
|
+
dsh plugin --profile web add "file:$PWD/dist/dsh-miloco-bridge-0.1.3.tgz"
|
|
234
234
|
```
|
|
235
235
|
|
|
236
236
|
---
|
package/lib/client.js
CHANGED
|
@@ -473,6 +473,8 @@ window.__ModuleLoader__.load({
|
|
|
473
473
|
const [busy, setBusy] = React.useState(false)
|
|
474
474
|
const [saved, setSaved] = React.useState(null)
|
|
475
475
|
const [sessionId, setSessionId] = React.useState('')
|
|
476
|
+
const [sessionInput, setSessionInput] = React.useState('')
|
|
477
|
+
const sessionFocusCleared = React.useRef(false)
|
|
476
478
|
const [modelValue, setModelValue] = React.useState('')
|
|
477
479
|
const [reasoningEffort, setReasoningEffort] = React.useState('')
|
|
478
480
|
const [deployLog, setDeployLog] = React.useState('')
|
|
@@ -503,7 +505,10 @@ window.__ModuleLoader__.load({
|
|
|
503
505
|
call('/status')
|
|
504
506
|
.then((payload) => {
|
|
505
507
|
setStatus(payload)
|
|
506
|
-
|
|
508
|
+
const targetSession = payload.overlay?.push?.target?.sessionId ?? ''
|
|
509
|
+
setSessionId(targetSession)
|
|
510
|
+
setSessionInput(targetSession)
|
|
511
|
+
sessionFocusCleared.current = false
|
|
507
512
|
const provider = payload.overlay?.push?.model?.provider ?? ''
|
|
508
513
|
const model = payload.overlay?.push?.model?.model ?? ''
|
|
509
514
|
setModelValue(provider && model ? `${provider}/${model}` : '')
|
|
@@ -755,6 +760,8 @@ window.__ModuleLoader__.load({
|
|
|
755
760
|
h('div', { className: 'muted' },
|
|
756
761
|
backend.error || `连不上 ${connection.baseUrl || '(未配置地址)'}。`
|
|
757
762
|
+ '插件本身可以独立安装;部署或连接之后才会出现设备与感知能力。'),
|
|
763
|
+
h('div', { className: 'muted' },
|
|
764
|
+
'一键部署会下载官方 release 安装器(支持 GitHub 镜像),不会在本机编译源码。'),
|
|
758
765
|
h('div', { className: 'row' },
|
|
759
766
|
h('button', { type: 'button', className: 'primary', disabled: busy, onClick: deploy },
|
|
760
767
|
busy ? '部署中…' : '一键部署 Miloco'),
|
|
@@ -853,6 +860,12 @@ window.__ModuleLoader__.load({
|
|
|
853
860
|
|
|
854
861
|
// ---------------------------------------------------------------- 推送目标
|
|
855
862
|
const lastSession = status.lastMilocoSession ?? ''
|
|
863
|
+
const selectedSession = (status.sessions ?? []).find(session => session.id === sessionId)
|
|
864
|
+
const sessionPlaceholder = sessionInput === '' && sessionId
|
|
865
|
+
? `当前:${selectedSession?.title || sessionId};输入搜索或会话 id`
|
|
866
|
+
: lastSession
|
|
867
|
+
? `留空 = 上一次触发 miloco 的会话(${lastSession})`
|
|
868
|
+
: '留空 = 上一次触发 miloco 的会话(还没有)'
|
|
856
869
|
const selectedEfforts = effortOptions(status, modelValue)
|
|
857
870
|
const effortValue = selectedEfforts.some(item => item.id === reasoningEffort)
|
|
858
871
|
? reasoningEffort
|
|
@@ -865,11 +878,32 @@ window.__ModuleLoader__.load({
|
|
|
865
878
|
h('input', {
|
|
866
879
|
type: 'text',
|
|
867
880
|
list: SESSION_LIST_ID,
|
|
868
|
-
value:
|
|
869
|
-
placeholder:
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
881
|
+
value: sessionInput,
|
|
882
|
+
placeholder: sessionPlaceholder,
|
|
883
|
+
onFocus: () => {
|
|
884
|
+
if (sessionId) {
|
|
885
|
+
sessionFocusCleared.current = true
|
|
886
|
+
setSessionInput('')
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
onChange: (event) => {
|
|
890
|
+
const value = event.target.value
|
|
891
|
+
sessionFocusCleared.current = false
|
|
892
|
+
setSessionInput(value)
|
|
893
|
+
if (!value || (status.sessions ?? []).some(session => session.id === value)) {
|
|
894
|
+
setSessionId(value)
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
onBlur: () => {
|
|
898
|
+
const value = sessionInput.trim()
|
|
899
|
+
if (sessionFocusCleared.current && value === '') {
|
|
900
|
+
setSessionInput(sessionId)
|
|
901
|
+
} else {
|
|
902
|
+
setSessionId(value)
|
|
903
|
+
setSessionInput(value)
|
|
904
|
+
}
|
|
905
|
+
sessionFocusCleared.current = false
|
|
906
|
+
},
|
|
873
907
|
}),
|
|
874
908
|
h('datalist', { id: SESSION_LIST_ID }, sessionOptions(status)),
|
|
875
909
|
h('button', { type: 'button', disabled: busy, onClick: refreshSessions }, '刷新会话'))),
|
|
@@ -926,14 +960,19 @@ window.__ModuleLoader__.load({
|
|
|
926
960
|
const upgradeInfo = versionInfo?.upgrade ?? null
|
|
927
961
|
const currentVersion = upgradeInfo?.current || versionData?.version || ''
|
|
928
962
|
const latestVersion = upgradeInfo?.latest || ''
|
|
929
|
-
const deployKind = upgradeInfo?.deploy_kind
|
|
963
|
+
const deployKind = upgradeInfo?.deploy_kind
|
|
964
|
+
|| (currentVersion && /\.dev\d*|\+/.test(currentVersion) ? 'dev' : '')
|
|
930
965
|
const hasUpdate = Boolean(upgradeInfo?.has_update)
|
|
931
966
|
const isDevDeployment = deployKind === 'dev'
|
|
967
|
+
const upgradeSource = upgradeInfo?.source || 'backend'
|
|
968
|
+
const mirrorCheck = upgradeSource === 'mirror'
|
|
969
|
+
const upgradeUnavailable = !upgradeInfo || upgradeInfo.reachable === false
|
|
932
970
|
const releaseUrl = upgradeInfo?.release_url || ''
|
|
933
971
|
const sourceRoot = versionInfo?.sourceRoot || deployState.sourceDir || ''
|
|
934
972
|
const gitDirty = Boolean(versionData?.git?.dirty)
|
|
935
973
|
const commitShort = versionData?.git?.commit_short || ''
|
|
936
974
|
const upgradePhase = upgradeStatus?.phase || ''
|
|
975
|
+
const upgradeLogPath = upgradeStatus?.logPath || ''
|
|
937
976
|
const upgradePhaseLabels = {
|
|
938
977
|
idle: '空闲',
|
|
939
978
|
starting: '准备中',
|
|
@@ -952,9 +991,11 @@ window.__ModuleLoader__.load({
|
|
|
952
991
|
? ['', versionBusy ? '读取中' : '未知']
|
|
953
992
|
: isDevDeployment
|
|
954
993
|
? ['', '源码部署']
|
|
955
|
-
:
|
|
956
|
-
? ['warn', '
|
|
957
|
-
:
|
|
994
|
+
: upgradeUnavailable
|
|
995
|
+
? ['warn', '检查失败']
|
|
996
|
+
: hasUpdate
|
|
997
|
+
? ['warn', '有新版本']
|
|
998
|
+
: ['ok', '已是最新']
|
|
958
999
|
|
|
959
1000
|
cards.push(h('div', { className: 'card', key: 'runtime' },
|
|
960
1001
|
h('div', { className: 'cardHead' },
|
|
@@ -1027,12 +1068,18 @@ window.__ModuleLoader__.load({
|
|
|
1027
1068
|
latestVersion
|
|
1028
1069
|
? h('span', null, `最新正式版 ${latestVersion}`)
|
|
1029
1070
|
: null,
|
|
1071
|
+
mirrorCheck
|
|
1072
|
+
? h('span', {
|
|
1073
|
+
className: 'muted',
|
|
1074
|
+
title: 'GitHub 直连不可用,已通过镜像检查',
|
|
1075
|
+
}, '镜像')
|
|
1076
|
+
: null,
|
|
1030
1077
|
releaseUrl
|
|
1031
1078
|
? h('a', {
|
|
1032
1079
|
href: releaseUrl,
|
|
1033
1080
|
target: '_blank',
|
|
1034
1081
|
rel: 'noopener noreferrer',
|
|
1035
|
-
title: '
|
|
1082
|
+
title: '查看发布说明',
|
|
1036
1083
|
}, '发布页')
|
|
1037
1084
|
: null,
|
|
1038
1085
|
isDevDeployment && devUpdateCommand
|
|
@@ -1050,6 +1097,12 @@ window.__ModuleLoader__.load({
|
|
|
1050
1097
|
disabled: versionBusy,
|
|
1051
1098
|
onClick: () => loadVersion(true),
|
|
1052
1099
|
}, versionBusy ? '检查中…' : '检查更新'),
|
|
1100
|
+
upgradeUnavailable
|
|
1101
|
+
? h('span', {
|
|
1102
|
+
className: 'versionDirty',
|
|
1103
|
+
title: upgradeInfo?.error || 'GitHub 与镜像均不可达',
|
|
1104
|
+
}, '更新检查不可用')
|
|
1105
|
+
: null,
|
|
1053
1106
|
isDevDeployment && gitDirty
|
|
1054
1107
|
? h('span', {
|
|
1055
1108
|
className: 'versionDirty',
|
|
@@ -1083,7 +1136,7 @@ window.__ModuleLoader__.load({
|
|
|
1083
1136
|
}, '复制命令')))
|
|
1084
1137
|
: null,
|
|
1085
1138
|
upgradePhase === 'failed'
|
|
1086
|
-
? h('div', { className: 'muted versionNote' }, '
|
|
1139
|
+
? h('div', { className: 'muted versionNote' }, `上次升级失败${upgradeLogPath ? `,可查看 ${upgradeLogPath}` : ',可查看 Miloco 的 upgrade.log'} 后重试。`)
|
|
1087
1140
|
: null,
|
|
1088
1141
|
upgradeConfirmOpen
|
|
1089
1142
|
? h('div', { className: 'danger' },
|