refactor(workflows): 统一替换 yingdao 目录引用为 workflows

1.  将所有文档、代码中对 `yingdao/` 目录的引用替换为 `workflows/`,统一影刀版代码的命名空间
2.  调整 workflows/share 模块内的路径引用与文档注释,确保一致性
3.  同步更新测试代码与配置文件中的旧目录引用
This commit is contained in:
2026-09-08 16:16:35 +08:00
parent be07de0e92
commit 9d067c0646
74 changed files with 5895 additions and 151 deletions
+180
View File
@@ -0,0 +1,180 @@
<template>
<div class="__app">
<!-- 顶部:品牌 + 平台登录态 + 进度 -->
<header class="topbar panel">
<div class="brand">
<span class="logo">37</span>
<div class="brand-meta">
<strong>{{ store.appName }}</strong>
<span>{{ wsText }}</span>
</div>
</div>
<div class="divider"></div>
<div class="band">
<span class="band-label">平台登录态</span>
<button
v-for="p in store.platforms"
:key="p.id"
class="chip"
:class="{ online: p.online }"
:disabled="busyLogin === p.id"
@click="login(p.id)"
:title="p.online ? '已登录,点击刷新' : '未登录,点击登录'"
>
<i class="dot"></i>
<span>{{ busyLogin === p.id ? '登录中…' : p.label }}</span>
</button>
</div>
<div class="spacer"></div>
<div class="run-state">
<span v-if="store.running" class="run-label">{{ store.progress }}%</span>
<div v-show="store.running" class="progress"><div :style="{ width: store.progress + '%' }"></div></div>
</div>
</header>
<!-- 主体:左场景 | 右插件页 + 日志 -->
<div class="body">
<aside class="panel side">
<div class="side-head">
<span class="sec-title">场景</span>
<span class="count">{{ store.plugins.length }}</span>
</div>
<ul class="scene-list">
<li
v-for="(p, i) in store.plugins"
:key="p.id"
:class="{ active: p.id === store.selectedId }"
@click="store.selectedId = p.id"
>
<span class="scene-icon" :style="{ background: PALETTE[i % PALETTE.length] }">
{{ p.name.slice(0, 1) }}
</span>
<span class="scene-name">{{ p.name }}</span>
<em>v{{ p.version }}</em>
</li>
</ul>
<div class="side-foot">场景以插件方式接入</div>
</aside>
<main class="main">
<div class="page-scroll panel">
<PluginPage />
</div>
<LogPanel />
</main>
</div>
</div>
</template>
<script setup>
import { computed, onMounted, ref } from 'vue'
import PluginPage from './components/PluginPage.vue'
import LogPanel from './components/LogPanel.vue'
import { store, handleEvent, clearLogs } from './store'
import { connectWS, fetchMeta, loginPlatform } from './api'
const PALETTE = ['#3b6cff', '#7c5cff', '#12a4d8', '#22b07a', '#e88a3a', '#e5484d']
const wsText = computed(() =>
store.wsOn ? '服务已连接' : '连接中断,正在重连…')
onMounted(async () => {
const meta = await fetchMeta()
store.appName = meta.appName
store.platforms = meta.platforms
store.plugins = meta.plugins
store.selectedId = meta.plugins[0]?.id || ''
clearLogs()
if (window.__ws) window.__ws.close()
const ws = connectWS(handleEvent)
window.__ws = ws
ws.onopen = () => (store.wsOn = true)
ws.onclose = () => { store.wsOn = false; setTimeout(() => (location.reload()), 2500) }
})
const busyLogin = ref('')
async function login(id) {
if (busyLogin.value) return
busyLogin.value = id
try {
const r = await loginPlatform(id)
const p = store.platforms.find((x) => x.id === id)
if (p) p.online = !!r.online
} catch (e) {
alert('登录失败:' + (e.message || e))
} finally {
busyLogin.value = ''
}
}
</script>
<style scoped>
.topbar {
display: flex; align-items: center; gap: 16px;
padding: 12px 18px;
flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 11px; }
.logo {
width: 36px; height: 36px; border-radius: 10px;
display: grid; place-items: center;
background: var(--primary-grad); color: #fff;
font-size: 14px; font-weight: 800;
box-shadow: 0 4px 12px -3px rgba(59,108,255,.6);
}
.brand-meta { display: flex; flex-direction: column; line-height: 1.2; }
.brand-meta strong { font-size: 14px; }
.brand-meta span { font-size: 11px; color: var(--text-faint); }
.divider { width: 1px; height: 26px; background: var(--border); }
.band { display: flex; align-items: center; gap: 6px; }
.band-label { font-size: 12px; color: var(--text-faint); margin-right: 4px; }
.chip {
display: inline-flex; align-items: center; gap: 7px;
border: 1px solid var(--border-strong); background: var(--surface);
color: var(--text-sub); padding: 5px 12px; border-radius: 999px;
cursor: pointer; font-size: 12.5px; transition: all .15s;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: #c6ccdc; }
.chip.online { border-color: transparent; background: var(--ok-weak); color: #1a8f63; }
.chip.online .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,176,122,.18); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip:disabled { opacity: .55; cursor: not-allowed; }
.chip:disabled:hover { border-color: var(--border-strong); color: var(--text-sub); }
.spacer { flex: 1; }
.run-state { display: flex; align-items: center; gap: 10px; }
.run-label { font-size: 12px; color: var(--primary); font-weight: 600; min-width: 38px; text-align: right; }
.body { flex: 1; display: flex; gap: 14px; min-height: 0; margin-top: 14px; }
.side { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; padding: 14px 12px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.count { font-size: 11px; color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.scene-list { list-style: none; margin: 0; padding: 0; flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.scene-list li {
display: flex; align-items: center; gap: 10px;
padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer;
transition: background .13s;
}
.scene-list li:hover { background: var(--surface-2); }
.scene-list li.active { background: var(--primary-weak); }
.scene-list li.active .scene-name { color: var(--primary); font-weight: 600; }
.scene-icon {
width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
}
.scene-name { flex: 1; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-list li.active .scene-name { color: var(--primary); }
.scene-list em { font-style: normal; font-size: 10px; color: var(--text-faint); }
.side-foot { font-size: 10px; color: var(--text-faint); text-align: center; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 8px; }
.main { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.page-scroll { flex: 1; min-height: 0; padding: 20px 24px; overflow: auto; }
</style>