@twinsearth/dsh-2xray 0.3.3 → 0.3.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.4 — 2026-10-29
4
+
5
+ ### 修复
6
+
7
+ - 侧边栏标题不再写死「全局代理」:读取 `status.routing.mode`,显示「全局代理 / 国内直连 / 白名单代理」;geodata 缺失降级时追加「已降级全局」。
8
+ - 状态卡增加「路由:…」一栏,并同步显示降级原因。
9
+ - 状态快照新增 `routing` 字段(mode / whitelist / blacklist)。
10
+
3
11
  ## 0.3.3 — 2026-10-29
4
12
 
5
13
  ### 健康检查与发布
package/lib/client.js CHANGED
@@ -199,6 +199,8 @@ window.__ModuleLoader__.load({
199
199
  }
200
200
 
201
201
  function StatusCard({ status, latency, egress, phase }) {
202
+ const routingLabel =
203
+ { global: '全局', 'cn-direct': '国内直连', whitelist: '白名单' }[status?.routing?.mode] ?? '全局'
202
204
  return h('section', { style: C.card },
203
205
  h('div', { style: C.cardHead }, '③ 连接状态'),
204
206
  h('div', { style: { display: 'flex', alignItems: 'center', gap: 10, flexWrap: 'wrap' } },
@@ -209,6 +211,8 @@ window.__ModuleLoader__.load({
209
211
  egress?.ip ? `出口 IP ${egress.ip}${egress.country ? ` (${egress.country})` : ''}` : '出口 IP —')),
210
212
  h('div', { style: { ...C.muted, fontSize: 12.5, marginTop: 6 } },
211
213
  `节点「${status?.vpnName ?? status?.activeNode ?? '—'}」` +
214
+ ` · 路由:${routingLabel}` +
215
+ (status?.routingFallback ? '(geodata 缺失,已降级全局)' : '') +
212
216
  (status?.route?.installed ? ` · ${status.route.mode === 'harness' ? 'DSH 策略已接管' : '内置 dispatcher'}` : ' · 尚未接管')))
213
217
  }
214
218
 
@@ -238,13 +242,16 @@ window.__ModuleLoader__.load({
238
242
  const latency = probe.latency?.ms
239
243
  const egress = probe.egress ?? {}
240
244
  const localEndpoint = status ? `127.0.0.1:${status.port}` : '—'
245
+ const routingLabel =
246
+ { global: '全局代理', 'cn-direct': '国内直连', whitelist: '白名单代理' }[status?.routing?.mode] ?? '全局代理'
247
+ const fallbackNote = status?.routingFallback ? ' · geodata 缺失,已降级全局' : ''
241
248
 
242
249
  return h('div', { style: C.page },
243
250
  h('div', { style: C.header },
244
251
  h('span', { style: C.globe }, h(GlobeIcon, { size: 22 })),
245
252
  h('div', null,
246
253
  h('h1', { style: C.title }, '2Xray'),
247
- h('p', { style: C.sub }, `Xray 全局代理 · 本地 ${localEndpoint}`)),
254
+ h('p', { style: C.sub }, `Xray ${routingLabel} · 本地 ${localEndpoint}${fallbackNote}`)),
248
255
  h(StatusPill, { status })),
249
256
  error
250
257
  ? h('div', { style: { ...C.card, ...C.error, fontSize: 12.5 } }, `状态通道不可用:${error}(代理本身可能仍在工作)`)
package/lib/supervisor.js CHANGED
@@ -732,6 +732,11 @@ export class Supervisor {
732
732
  takeover: this.config.takeover,
733
733
  settingsSchema: this.#schemaLoaded,
734
734
  routingFallback: this.#routingFallback,
735
+ routing: {
736
+ mode: this.config.routing?.mode ?? 'global',
737
+ whitelist: this.config.routing?.whitelist ?? [],
738
+ blacklist: this.config.routing?.blacklist ?? [],
739
+ },
735
740
  nodes: this.config.nodes.map((node) => ({
736
741
  id: node.id,
737
742
  tag: node.tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/dsh-2xray",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "private": false,
5
5
  "description": "DSH-2Xray: supervises xray-core and routes DSH process-wide HTTP(S) traffic through its local inbound, with optional multi-node gRPC control plane",
6
6
  "type": "module",