@@ -165,22 +80,21 @@ const visible = computed(() => {
-
内核未连接,无法读取日志。
+
+ {{ row.time }}
+ {{ row.type }}
+ {{ row.payload }}
+
-
-
- {{ row.time }}
- {{ row.type }}
- {{ row.payload }}
-
-
-
- 暂无日志。没有流量经过内核时不会产生请求记录。
-
-
- 没有包含「{{ query.trim() }}」的日志。
-
-
+
+ {{ rows.length > 0 ? '内核未连接,日志不再更新。' : '内核未连接,无法读取日志。' }}
+
+
+ 暂无日志。没有流量经过内核时不会产生请求记录。
+
+
+ 没有包含「{{ query.trim() }}」的日志。
+
日志流已中断,将自动重连。
@@ -202,6 +116,13 @@ const visible = computed(() => {
margin-bottom: var(--s-4);
}
+/* 页面底色上的控件要比底色浮一档 */
+.lvl {
+ width: 130px;
+ flex: none;
+ --select-bg: var(--c-surface);
+}
+
.ctl {
padding: var(--s-2) var(--s-3);
border: 1px solid var(--c-border-strong);
@@ -214,18 +135,22 @@ const visible = computed(() => {
max-width: 320px;
}
-.pause {
+.act {
display: flex;
align-items: center;
gap: var(--s-2);
- margin-left: auto;
cursor: pointer;
}
-.pause:hover {
+.act:hover {
border-color: var(--c-accent);
color: var(--c-accent-text);
}
+/* 两个动作靠右,和左边的筛选拉开 */
+.act:first-of-type {
+ margin-left: auto;
+}
+
.failure {
border: 1px solid color-mix(in srgb, var(--c-danger) 35%, var(--c-border));
border-radius: var(--r-md);
diff --git a/web/views/RuleGroupForm.vue b/web/views/RuleGroupForm.vue
index 84b1b61..51b0290 100644
--- a/web/views/RuleGroupForm.vue
+++ b/web/views/RuleGroupForm.vue
@@ -9,6 +9,7 @@
import { computed, ref, watch } from 'vue'
import { inferRuleFormat, ruleProviderPath } from '@shared/rules.ts'
import type { ConfigObject } from '../../vendor/config-editor/index.ts'
+import SelectBox from '../components/SelectBox.vue'
import IconClose from '~icons/ri/close-line'
const props = defineProps<{
@@ -27,10 +28,14 @@ const dialog = ref
(null)
const name = ref('')
const source = ref('')
const behavior = ref('classical')
-const format = ref<'yaml' | 'text' | 'mrs'>('yaml')
+// 值域就是选项里那三个,SelectBox 的 v-model 是宽的 string,这里不再收窄
+const format = ref('yaml')
/** 用户手选过格式就不再跟着来源推断 */
const formatTouched = ref(false)
+const BEHAVIOR_OPTIONS = [{ value: 'classical' }, { value: 'domain' }, { value: 'ipcidr' }]
+const FORMAT_OPTIONS = [{ value: 'yaml' }, { value: 'text' }, { value: 'mrs' }]
+
const isUrl = computed(() => /^https?:\/\//i.test(source.value.trim()))
watch(source, (value) => {
@@ -122,11 +127,7 @@ function submit() {