默认入站不再显示整块出站选择
它由配置顶层的端口字段声明,没有 proxy 字段可写,画一排点不了的卡片只会让人以为 是坏了。之前藏掉这块会让面板变空,所以留着;现在「流量去向」那一节顶上来了, 默认入站照样有内容可看——它的流量去向由规则表决定,那一节反而是它唯一相关的部分。 「默认」标记和不给删除本来就有:列表里带 tag,详情里不显示编辑和删除按钮。
This commit is contained in:
+13
-14
@@ -36,7 +36,10 @@ const emit = defineEmits<{
|
|||||||
test: [name: string]
|
test: [name: string]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
/** 默认入站没有 proxy 字段可写,「出站」那一块对它是只读的。 */
|
/**
|
||||||
|
* 默认入站由配置顶层的端口字段声明,没有 proxy 字段可写,也不能删。
|
||||||
|
* 它的「出站」和编辑删除按钮都不显示。
|
||||||
|
*/
|
||||||
const locked = computed(() => props.inbound.isDefault)
|
const locked = computed(() => props.inbound.isDefault)
|
||||||
|
|
||||||
function describe(name: string): string {
|
function describe(name: string): string {
|
||||||
@@ -65,7 +68,6 @@ const BUILTINS: Array<{ mode: OutboundMode; label: string; sub: string }> = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const LINE_LOCKED = '订阅线路无法被入站直接引用,需要通过筛选组间接引入。该功能尚未实现。'
|
const LINE_LOCKED = '订阅线路无法被入站直接引用,需要通过筛选组间接引入。该功能尚未实现。'
|
||||||
const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -122,12 +124,14 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|||||||
</template>
|
</template>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- 配置:换这路入站指向谁。要写文件、要校验 -->
|
<!--
|
||||||
<section class="block">
|
配置:换这路入站指向谁。要写文件、要校验。
|
||||||
|
默认入站没有 proxy 字段可写,整块不显示——画一排点不了的卡片只会让人以为是坏了。
|
||||||
|
-->
|
||||||
|
<section v-if="!locked" class="block">
|
||||||
<h3>出站</h3>
|
<h3>出站</h3>
|
||||||
<p v-if="locked" class="hint"><code>{{ inbound.legacyKey }}</code> 没有 proxy 字段</p>
|
|
||||||
|
|
||||||
<div v-if="!locked" class="grid">
|
<div class="grid">
|
||||||
<OutboundCard
|
<OutboundCard
|
||||||
v-for="b in BUILTINS"
|
v-for="b in BUILTINS"
|
||||||
:key="b.label"
|
:key="b.label"
|
||||||
@@ -141,7 +145,7 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template v-if="groups.length">
|
<template v-if="groups.length">
|
||||||
<h4 :class="locked && 'is-dim'">策略组</h4>
|
<h4>策略组</h4>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<OutboundCard
|
<OutboundCard
|
||||||
v-for="g in groups"
|
v-for="g in groups"
|
||||||
@@ -150,7 +154,6 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|||||||
:sub="describe(g)"
|
:sub="describe(g)"
|
||||||
:delay="delayOf(g)"
|
:delay="delayOf(g)"
|
||||||
:selected="isCurrentOutbound({ kind: 'named', name: g })"
|
:selected="isCurrentOutbound({ kind: 'named', name: g })"
|
||||||
:disabled-reason="locked ? NO_PROXY_FIELD : undefined"
|
|
||||||
:pending="pendingOutbound === g"
|
:pending="pendingOutbound === g"
|
||||||
:testing="isTesting(g)"
|
:testing="isTesting(g)"
|
||||||
testable
|
testable
|
||||||
@@ -161,7 +164,7 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="ownProxies.length">
|
<template v-if="ownProxies.length">
|
||||||
<h4 :class="locked && 'is-dim'">自有线路</h4>
|
<h4>自有线路</h4>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<OutboundCard
|
<OutboundCard
|
||||||
v-for="p in ownProxies"
|
v-for="p in ownProxies"
|
||||||
@@ -170,7 +173,6 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|||||||
:sub="describe(p)"
|
:sub="describe(p)"
|
||||||
:delay="delayOf(p)"
|
:delay="delayOf(p)"
|
||||||
:selected="isCurrentOutbound({ kind: 'named', name: p })"
|
:selected="isCurrentOutbound({ kind: 'named', name: p })"
|
||||||
:disabled-reason="locked ? NO_PROXY_FIELD : undefined"
|
|
||||||
:pending="pendingOutbound === p"
|
:pending="pendingOutbound === p"
|
||||||
:testing="isTesting(p)"
|
:testing="isTesting(p)"
|
||||||
testable
|
testable
|
||||||
@@ -180,7 +182,7 @@ const NO_PROXY_FIELD = '该入站没有 proxy 字段'
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<h4 :class="locked && 'is-dim'">订阅线路</h4>
|
<h4>订阅线路</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>
|
<p v-else-if="providerLines.length === 0" class="hint">订阅中没有线路</p>
|
||||||
<div v-else class="grid">
|
<div v-else class="grid">
|
||||||
@@ -343,7 +345,4 @@ h4 {
|
|||||||
color: var(--c-text-soft);
|
color: var(--c-text-soft);
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-dim {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user