新增入站不再预填订阅
来源一个都不选时 AUTO 和 FALLBACK 就是空组,内核会拒绝整份配置 (adapter/outboundgroup/parser.go:117-119),所以 applySetup 这时只建 SELECT、成员只有 DIRECT;用户在配置里选好订阅再保存,那两个组建回来。 链式代理打开时同样不预填入口订阅。 「改成逐条选线路」保持全给上:那一路本来就在把流量送到某个出站, 接管不该顺手把它改成直连。
This commit is contained in:
@@ -54,12 +54,22 @@ const emit = defineEmits<{ saved: []; 'focus-done': [] }>()
|
||||
const inbounds = computed(() => collectInbounds(props.data))
|
||||
const subscriptions = computed(() => userProviders(props.data))
|
||||
|
||||
/** 刚接管一路入站时给它什么:订阅全给上,不筛。三个组由 applySetup 一并建出来。 */
|
||||
/**
|
||||
* 接管一路已有入站时给它什么:订阅全给上,不筛。三个组由 applySetup 一并建出来。
|
||||
* 来源不留空,是因为这一路本来就在把流量送到某个出站上,接管不该顺手把它改成直连。
|
||||
*/
|
||||
const defaultSetup = (): OutboundSetup => ({
|
||||
proxy: { sources: [...subscriptions.value], filter: null },
|
||||
chain: null,
|
||||
})
|
||||
|
||||
/**
|
||||
* 新增入站时给它什么:一个订阅都不预设。全新的端口还没有人在用,替用户挑一批订阅
|
||||
* 只会让他保存完再回来取消勾选。来源为空的专属组只有 DIRECT(见 applySetup),
|
||||
* 用户在详情页的配置里选好订阅再保存。
|
||||
*/
|
||||
const emptySetup = (): OutboundSetup => ({ proxy: { sources: [], filter: null }, chain: null })
|
||||
|
||||
const selectedId = ref<string | null>(null)
|
||||
const saving = ref(false)
|
||||
const fields = ref<ListenerFields | null>(null)
|
||||
@@ -225,7 +235,7 @@ async function submitForm(entry: ConfigObject) {
|
||||
// 新增的入站直接进专属组模式。否则新建完看到的是一块「这一路不由 Patchbay 管理」
|
||||
// 的提示,还得再点一次才能用。
|
||||
const name = String(entry.name)
|
||||
const withGroup = editingIndex === null ? applySetup(next, name, defaultSetup()) : next
|
||||
const withGroup = editingIndex === null ? applySetup(next, name, emptySetup()) : next
|
||||
|
||||
const ok = await commit(withGroup, editingIndex === null ? `已新增 ${name}` : '已保存')
|
||||
// 失败时不能关对话框——关了再打开就是空表单,用户填的名称、端口、类型全没了
|
||||
|
||||
Reference in New Issue
Block a user