feat: 新增多插件 UI 支持及运行日志集中回传功能

本次提交包含多项功能更新:
1. 为多个插件(xq0002/0003/0004/0008/0010/0011/0020/0031_xq0032/0033/0035/0037/0045_xq0046/0047/0048)新增 UI 界面及配置支持
2. 新增运行日志集中回传功能,客户端自动上传运行日志到中心机集中存储
3. 新增插件分类字段支持,用于场景库分组管理
4. 优化 xq0034/0037/0048 等插件的功能及描述
5. 修复控制面响应兼容问题,支持新旧版本数据格式
6. 新增 xq0033 插件的状态存储模块,用于历史记录管理
7. 优化 CRM 登录窗口模式,支持全屏置顶
This commit is contained in:
2026-10-26 15:42:50 +08:00
parent 9fd687ada8
commit 843ff244a6
453 changed files with 243002 additions and 4493 deletions
@@ -0,0 +1,116 @@
<template>
<button class="scene-card card" :class="{ running, compact }" @click="$emit('open', plugin.id)">
<span v-if="compact" class="sc-dot" :style="{ background: dotColor }"></span>
<span v-else class="sc-ic" :style="{ color: dotColor, background: tileBg }">{{ initial }}</span>
<span class="sc-body">
<span class="sc-head">
<b class="sc-name">{{ plugin.name }}</b>
<em v-if="!compact && plugin.category" class="sc-cat">{{ plugin.category }}</em>
</span>
<span v-if="!compact" class="sc-desc">{{ plugin.description || '暂无描述' }}</span>
<span class="sc-meta">
<em class="ver">v{{ plugin.version }}</em>
<span v-if="plugin.platform" class="plat" :class="platformOnline ? 'on' : 'off'"
:title="`${platformLabel} ${platformOnline ? '已登录' : '未登录,请先在运行台登录'}`">
<i class="dot"></i>{{ platformLabel }} · {{ platformOnline ? '已登录' : '未登录' }}
</span>
</span>
</span>
<span class="sc-go" :class="{ busy: running }">
<template v-if="running">{{ store.progress }}%</template>
<svg v-else width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 12h16" /><path d="m13 5 7 7-7 7" />
</svg>
</span>
</button>
</template>
<script setup>
import { computed } from 'vue'
import { store } from '../store'
import { sceneDotColor } from '../utils/theme'
// 场景卡:首页「常用场景」(compact,无描述)与场景库共用。
// 色点按插件在总清单中的位置取色,搜索/筛选/分组后颜色仍稳定。
const props = defineProps({
plugin: { type: Object, required: true },
compact: { type: Boolean, default: false },
})
defineEmits(['open'])
const dotColor = computed(() => sceneDotColor(store.plugins.findIndex((p) => p.id === props.plugin.id)))
const tileBg = computed(() => `color-mix(in srgb, ${dotColor.value} 13%, var(--surface))`)
const initial = computed(() => (props.plugin.name || '·').trim().slice(0, 1))
const platform = computed(() => store.platforms.find((p) => p.id === props.plugin.platform) || null)
const platformLabel = computed(() => platform.value?.label || props.plugin.platform || '')
const platformOnline = computed(() => !!platform.value?.online)
const running = computed(() => store.running && store.selectedId === props.plugin.id)
</script>
<style scoped>
.scene-card {
position: relative;
display: flex; align-items: center; gap: var(--space-3);
padding: var(--space-3) var(--space-4); text-align: left;
cursor: pointer; font-family: inherit;
background: linear-gradient(160deg, var(--subtle) 0%, var(--surface) 58%);
transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}
.scene-card:hover { border-color: var(--brand-track); box-shadow: var(--sh-float); transform: translateY(-2px); }
.scene-card:active { transform: translateY(0) scale(.995); }
.scene-card.running {
border-color: var(--brand-track);
background: linear-gradient(160deg, var(--brand-soft) 0%, var(--surface) 70%);
}
.scene-card.compact {
background: var(--surface);
padding: var(--space-2-5) var(--space-3); gap: var(--space-2);
}
.scene-card.compact:hover { transform: none; box-shadow: var(--sh-card); }
.sc-dot { width: 6px; height: 6px; border-radius: 3px; flex-shrink: 0; }
.sc-ic {
width: 36px; height: 36px; border-radius: var(--r-sub); flex-shrink: 0;
display: grid; place-items: center; background: var(--brand-soft);
font: 600 14px/1 var(--f-cn);
}
.sc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sc-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.sc-name {
min-width: 0; font: 600 13px/18px var(--f-cn); color: var(--t1);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-cat {
flex-shrink: 0; font-style: normal; font: 500 9.5px/15px var(--f-cn);
color: var(--brand-ink); background: var(--brand-soft);
border: 1px solid var(--brand-track); border-radius: var(--r-pill);
padding: 0 var(--space-2);
}
.sc-desc { font-size: 11.5px; color: var(--t4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-meta { display: flex; align-items: center; gap: var(--space-2); margin-top: 1px; }
.ver { font-style: normal; font: 400 10.5px/15px var(--f-num); color: var(--t4); flex-shrink: 0; }
.plat {
display: inline-flex; align-items: center; gap: 5px;
font-size: 10.5px; color: var(--t3);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t5); flex-shrink: 0; }
.plat.on { color: var(--good-ink); }
.plat.on .dot { background: var(--good); }
.plat.off { color: var(--warn-ink); }
.plat.off .dot { background: var(--warn); }
.sc-go {
flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center;
font: 600 12px/1 var(--f-num); color: var(--t3);
background: var(--field); border: 1px solid var(--line-btn);
border-radius: 50%; transition: all var(--dur);
}
.sc-go svg { display: block; }
.sc-go.busy { font-size: 9.5px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.scene-card.compact .sc-go { width: 22px; height: 22px; font-size: 11px; }
.scene-card.compact .sc-go.busy { font-size: 8.5px; }
.scene-card:hover .sc-go { background: var(--brand); color: var(--on-primary); border-color: transparent; box-shadow: var(--sh-brand-sm); }
.scene-card.running .sc-go { background: var(--brand); color: var(--on-primary); border-color: transparent; }
</style>