可切换的那一层改成最后一个 Selector,不是最后一个有成员的组
原来的规则会落在 AUTO 上,而 AUTO 是 url-test 类型——它按延迟自己挑,手动选它没有 意义,点完会被下一轮延迟测试算回去。内核里只有 Selector 是「由人来选」的 (constant/adapters.go:240-248 列了全部五种),URLTest 挑最快、Fallback 挑第一个可用、 LoadBalance 分摊,Relay 已被移除。 链条上现在每一跳都标出类型(PROXY Selector → AUTO URLTest → 线路 Vless),并明说 自动决定的那几层不接受手动指定——不说清楚的话,用户看到链条里有个组却点不了, 只会以为是坏了。
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
import type { Inbound, OutboundMode } from '@shared/inbounds.ts'
|
||||
import { lastSwitchableGroup, resolveChain } from '@shared/outbound-chain.ts'
|
||||
import { autoDecidedHops, lastSwitchableGroup, resolveChain } from '@shared/outbound-chain.ts'
|
||||
import { latestDelay } from '../api'
|
||||
import { kernel, providerLines, runtime } from '../runtime'
|
||||
import OutboundCard from '../components/OutboundCard.vue'
|
||||
@@ -50,6 +50,10 @@ 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
|
||||
@@ -93,13 +97,21 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
||||
<!-- 运行时:换线路。不写文件,点了立刻变 -->
|
||||
<section v-if="chain.length" class="block">
|
||||
<h3>流量去向</h3>
|
||||
<p class="chain mono">
|
||||
<p class="chain">
|
||||
<template v-for="(hop, i) in chain" :key="hop">
|
||||
<span v-if="i" class="arrow">→</span>
|
||||
<span :class="i === chain.length - 1 && 'tail'">{{ hop }}</span>
|
||||
<span class="hop">
|
||||
<span :class="['mono', i === chain.length - 1 && 'tail']">{{ hop }}</span>
|
||||
<span v-if="hopType(hop)" class="hop-type">{{ hopType(hop) }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</p>
|
||||
|
||||
<p v-if="autoHops.length" class="hint">
|
||||
{{ autoHops.map((h) => `${h.name}(${h.type})`).join('、') }}
|
||||
自己决定选中哪一条,不接受手动指定
|
||||
</p>
|
||||
|
||||
<template v-if="switchable">
|
||||
<h4>{{ switchable.group }} 的当前选中</h4>
|
||||
<div class="grid">
|
||||
@@ -117,6 +129,7 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<p v-else-if="chain.length" class="hint">这条链路上没有可手动选择的策略组</p>
|
||||
</section>
|
||||
|
||||
<!-- 配置:换这路入站指向谁。要写文件、要校验 -->
|
||||
@@ -320,6 +333,17 @@ h4 {
|
||||
color: var(--c-text-faint);
|
||||
}
|
||||
|
||||
.hop {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: var(--s-1);
|
||||
}
|
||||
|
||||
.hop-type {
|
||||
font-size: var(--t-xs);
|
||||
color: var(--c-text-faint);
|
||||
}
|
||||
|
||||
.chain .tail {
|
||||
color: var(--c-accent-text);
|
||||
font-weight: 500;
|
||||
|
||||
Reference in New Issue
Block a user