日志改常驻收集,加清空按钮;原生 select 统一换成 SelectBox
日志收集从请求页组件搬进模块级单例(web/log-store.ts,模式同 telemetry), 切走页面不再清空;离线时保留已收的日志,只提示不再更新。清空只清界面。 五处原生 <select> 在三个文件里各自重复同一套自绘箭头样式,而且原生控件 没有「展开中」状态可读,箭头做不了开合动画——提成 SelectBox 组件统一替换: 箭头随开合旋转 180 度,弹层带出入场动画,下方视口不够时向上弹。背景色 留 --select-bg 口子,对话框里沉一档、页面上浮一档,一个值满足不了两边。
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { parseIniRulesets, planIniImport } from '@shared/rules.ts'
|
||||
import type { IniImportPlan } from '@shared/rules.ts'
|
||||
import SelectBox from '../components/SelectBox.vue'
|
||||
import IconClose from '~icons/ri/close-line'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -42,6 +43,8 @@ const mapping = ref<Record<string, string>>({})
|
||||
|
||||
const entries = computed(() => parseIniRulesets(text.value))
|
||||
|
||||
const outboundOptions = computed(() => props.outboundNames.map((name) => ({ value: name })))
|
||||
|
||||
/** ini 里出现过的目标组名,按出现顺序去重。每个都要映射到一个实际出站。 */
|
||||
const targets = computed(() => [...new Set(entries.value.map((e) => e.target))])
|
||||
|
||||
@@ -141,10 +144,7 @@ function submit() {
|
||||
<label v-for="target in targets" :key="target" class="row">
|
||||
<span class="k map-name" :title="target">{{ target }}</span>
|
||||
<span class="v">
|
||||
<select v-model="mapping[target]">
|
||||
<option value="" disabled>映射到…</option>
|
||||
<option v-for="name in outboundNames" :key="name" :value="name">{{ name }}</option>
|
||||
</select>
|
||||
<SelectBox v-model="mapping[target]" :options="outboundOptions" placeholder="映射到…" />
|
||||
</span>
|
||||
</label>
|
||||
</template>
|
||||
@@ -246,19 +246,6 @@ textarea {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 100%;
|
||||
appearance: none;
|
||||
padding: var(--s-2) var(--s-3);
|
||||
padding-right: var(--s-6);
|
||||
border: 1px solid var(--c-border-strong);
|
||||
border-radius: var(--r-sm);
|
||||
background: var(--c-bg);
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath fill='%23898f98' d='M12 15.6 5.7 9.3l1.4-1.4 4.9 4.9 4.9-4.9 1.4 1.4z'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right var(--s-3) center;
|
||||
}
|
||||
|
||||
.found {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
|
||||
Reference in New Issue
Block a user