diff --git a/shared/outbound-chain.test.ts b/shared/outbound-chain.test.ts index 3bd3bac..cf61e6c 100644 --- a/shared/outbound-chain.test.ts +++ b/shared/outbound-chain.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'bun:test' -import { acceptsManualChoice, autoDecidedHops, lastSwitchableGroup, resolveChain } from './outbound-chain.ts' +import { acceptsManualChoice, lastSwitchableGroup, resolveChain } from './outbound-chain.ts' import type { RuntimeNode } from './outbound-chain.ts' /** @@ -97,13 +97,3 @@ describe('找出用户能换选中的那一层', () => { }) }) -describe('哪几层是自动决定的', () => { - it('列出来,界面用它解释为什么这一层点不了', () => { - const chain = resolveChain(runtime, 'PROXY') - expect(autoDecidedHops(runtime, chain)).toEqual([{ name: 'AUTO', type: 'URLTest' }]) - }) - - it('线路本身不算——它不是组,本来就没得选', () => { - expect(autoDecidedHops(runtime, ['[vless]Gomami'])).toEqual([]) - }) -}) diff --git a/shared/outbound-chain.ts b/shared/outbound-chain.ts index 8765cf6..9059912 100644 --- a/shared/outbound-chain.ts +++ b/shared/outbound-chain.ts @@ -79,17 +79,3 @@ export function lastSwitchableGroup( return null } -/** - * 链条上那些自动决定选中结果的组。 - * - * 界面用它来解释「为什么这一层点不了」——不说清楚的话,用户看到链条里有个组却没法 - * 操作,只会以为是坏了。 - */ -export function autoDecidedHops( - runtime: Record, - chain: string[], -): Array<{ name: string; type: string }> { - return chain - .map((name) => ({ name, type: runtime[name]?.type ?? '' })) - .filter((hop) => hop.type !== '' && !acceptsManualChoice(hop.type) && runtime[hop.name]?.all) -} diff --git a/web/views/InboundDetail.vue b/web/views/InboundDetail.vue index 02a214a..d5dc1bd 100644 --- a/web/views/InboundDetail.vue +++ b/web/views/InboundDetail.vue @@ -8,7 +8,7 @@ */ import { computed } from 'vue' import type { Inbound, OutboundMode } from '@shared/inbounds.ts' -import { autoDecidedHops, lastSwitchableGroup, resolveChain } from '@shared/outbound-chain.ts' +import { lastSwitchableGroup, resolveChain } from '@shared/outbound-chain.ts' import { latestDelay } from '../api' import { kernel, providerLines, runtime } from '../runtime' import OutboundCard from '../components/OutboundCard.vue' @@ -50,10 +50,7 @@ const isTesting = (name: string) => props.testing.includes(name) const chain = computed(() => resolveChain(runtime.value, props.destination)) const switchable = computed(() => lastSwitchableGroup(runtime.value, chain.value)) -/** 链条上那些自己算选中结果的组,用来解释为什么它们点不了。 */ -const autoHops = computed(() => autoDecidedHops(runtime.value, chain.value)) -/** 每一跳的类型,显示在链条上。线路显示协议,策略组显示它是怎么选的。 */ -const hopType = (name: string) => runtime.value[name]?.type ?? '' + function isCurrentOutbound(mode: OutboundMode): boolean { const now = props.inbound.outbound @@ -89,29 +86,23 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
{{ inbound.type }}
监听
{{ inbound.listen ?? '0.0.0.0' }}
-
附加规则
-
{{ inbound.ruleSet ?? '—' }}
+

流量去向

-

+

-

- {{ autoHops.map((h) => `${h.name}(${h.type})`).join('、') }} - 自己决定选中哪一条,不接受手动指定 -

- -

这条链路上没有可手动选择的策略组

出站

-

- 由 {{ inbound.legacyKey }} 声明。该写法没有 proxy 字段,出站固定为 RULE。 -

+

{{ inbound.legacyKey }} 没有 proxy 字段

订阅线路

-

- - 内核未连接,无法获取订阅线路 -

+

内核未连接

订阅中没有线路