diff --git a/web/components/ComboBox.vue b/web/components/ComboBox.vue index 520addc..89e8100 100644 --- a/web/components/ComboBox.vue +++ b/web/components/ComboBox.vue @@ -230,6 +230,9 @@ function onFocusOut(event: FocusEvent) { max-width: min(360px, calc(100vw - 2 * var(--s-4))); max-height: 200px; overflow-y: auto; + /* 细杆加透明轨道,别让弹层里出现一根系统灰滚动条 */ + scrollbar-width: thin; + scrollbar-color: var(--c-border-strong) transparent; list-style: none; margin: 0; padding: var(--s-1); diff --git a/web/components/SelectBox.vue b/web/components/SelectBox.vue index 0f8146c..652110c 100644 --- a/web/components/SelectBox.vue +++ b/web/components/SelectBox.vue @@ -242,6 +242,9 @@ function groupAt(index: number): string | null { max-width: min(360px, calc(100vw - 2 * var(--s-4))); max-height: 200px; overflow-y: auto; + /* 细杆加透明轨道,别让弹层里出现一根系统灰滚动条 */ + scrollbar-width: thin; + scrollbar-color: var(--c-border-strong) transparent; list-style: none; margin: 0; padding: var(--s-1); diff --git a/web/components/SourcePicker.vue b/web/components/SourcePicker.vue index 021b4ff..92aaede 100644 --- a/web/components/SourcePicker.vue +++ b/web/components/SourcePicker.vue @@ -238,6 +238,9 @@ function onFocusOut(event: FocusEvent) { max-width: min(360px, calc(100vw - 2 * var(--s-4))); max-height: 240px; overflow-y: auto; + /* 细杆加透明轨道,别让弹层里出现一根系统灰滚动条 */ + scrollbar-width: thin; + scrollbar-color: var(--c-border-strong) transparent; list-style: none; margin: 0; padding: var(--s-1); diff --git a/web/views/RuleForm.vue b/web/views/RuleForm.vue index 604e3cf..2235787 100644 --- a/web/views/RuleForm.vue +++ b/web/views/RuleForm.vue @@ -16,8 +16,6 @@ const props = defineProps<{ open: boolean /** 传了就是编辑:下标加原文;没传就是新增 */ editing: { index: number; raw: string } | null - /** 目标出站的候选:内置出站、策略组、自有线路。之外也允许手填 */ - outboundNames: string[] /** RULE-SET 载荷的候选:已声明的规则组 */ providerNames: string[] saving: boolean @@ -25,27 +23,56 @@ const props = defineProps<{ const emit = defineEmits<{ close: []; submit: [rule: string] }>() -/** 常见的规则类型。不在里面的手填,填了就自动按原文编辑。 */ -const COMMON_TYPES = [ +/** + * 内核认识的全部规则类型,照抄解析器的 switch(rules/parser.go:17-98), + * 按域名、地理、IP、端口、进程、入站、逻辑的次序排。 + */ +const RULE_TYPES = [ 'DOMAIN', 'DOMAIN-SUFFIX', 'DOMAIN-KEYWORD', + 'DOMAIN-REGEX', + 'DOMAIN-WILDCARD', 'GEOSITE', 'GEOIP', + 'SRC-GEOIP', 'IP-CIDR', 'IP-CIDR6', - 'IP-ASN', 'SRC-IP-CIDR', + 'IP-SUFFIX', + 'SRC-IP-SUFFIX', + 'IP-ASN', + 'SRC-IP-ASN', 'DST-PORT', 'SRC-PORT', 'IN-PORT', 'PROCESS-NAME', 'PROCESS-PATH', + 'PROCESS-NAME-REGEX', + 'PROCESS-PATH-REGEX', + 'PROCESS-NAME-WILDCARD', + 'PROCESS-PATH-WILDCARD', 'NETWORK', + 'UID', + 'DSCP', + 'IN-TYPE', + 'IN-USER', + 'IN-NAME', + 'REMATCH-NAME', + 'AND', + 'OR', + 'NOT', + 'SUB-RULE', 'RULE-SET', 'MATCH', ] +/** + * 目标的建议只给内置出站里日常用的两个。策略组名允许手填—— + * 全部列出来的话,每路入站自动生成的三个专属组会把列表灌成一面墙。 + */ +const TARGET_SUGGESTIONS = ['DIRECT', 'REJECT'] + const dialog = ref(null) const rawMode = ref(false) const raw = ref('') @@ -135,7 +162,14 @@ function submit() { @@ -144,7 +178,7 @@ function submit() { @@ -173,7 +207,7 @@ function submit() { diff --git a/web/views/RulesPage.vue b/web/views/RulesPage.vue index eeea541..89ec675 100644 --- a/web/views/RulesPage.vue +++ b/web/views/RulesPage.vue @@ -450,7 +450,6 @@ async function updateNow(name: string) {