去掉解释性提示和链条上的类型标注

链条回到纯名字。类型标注和「某某组自己决定选中哪一条」那句解释是我上一版加的,
用来说明为什么那一层点不了——但不能点的东西本来就没画出来,解释一个看不见的东西
只是噪音。

默认入站那条压成一句,内核未连接那条压成四个字,没有附加规则时整行不显示而不是
显示一个破折号。shared 里跟着没人用的 autoDecidedHops 一并删掉。
This commit is contained in:
im0o
2026-08-10 18:58:34 +08:00
parent 5049879a70
commit 43d410d02c
3 changed files with 11 additions and 60 deletions
+10 -35
View File
@@ -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 字段'
<dd class="mono">{{ inbound.type }}</dd>
<dt>监听</dt>
<dd class="mono">{{ inbound.listen ?? '0.0.0.0' }}</dd>
<dt>附加规则</dt>
<dd class="mono">{{ inbound.ruleSet ?? '—' }}</dd>
<template v-if="inbound.ruleSet">
<dt>附加规则</dt>
<dd class="mono">{{ inbound.ruleSet }}</dd>
</template>
</dl>
</header>
<!-- 运行时:换线路。不写文件,点了立刻变 -->
<section v-if="chain.length" class="block">
<h3>流量去向</h3>
<p class="chain">
<p class="chain mono">
<template v-for="(hop, i) in chain" :key="hop">
<span v-if="i" class="arrow">→</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>
<span :class="i === chain.length - 1 && 'tail'">{{ hop }}</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">
@@ -129,15 +120,12 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
/>
</div>
</template>
<p v-else-if="chain.length" class="hint">这条链路上没有可手动选择的策略组</p>
</section>
<!-- 配置:换这路入站指向谁。要写文件、要校验 -->
<section class="block">
<h3>出站</h3>
<p v-if="locked" class="hint">
由 <code>{{ inbound.legacyKey }}</code> 声明。该写法没有 proxy 字段,出站固定为 RULE。
</p>
<p v-if="locked" class="hint"><code>{{ inbound.legacyKey }}</code> 没有 proxy 字段</p>
<div v-if="!locked" class="grid">
<OutboundCard
@@ -193,10 +181,7 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
</template>
<h4 :class="locked && 'is-dim'">订阅线路</h4>
<p v-if="!kernel.online" class="hint">
<IconOffline />
内核未连接,无法获取订阅线路
</p>
<p v-if="!kernel.online" class="hint"><IconOffline /> 内核未连接</p>
<p v-else-if="providerLines.length === 0" class="hint">订阅中没有线路</p>
<div v-else class="grid">
<OutboundCard
@@ -333,16 +318,6 @@ 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);