-
{{ user.username }}
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
{{ userError.title }}
+
{{ userError.message }}
+
{{ userError.hint }}
+
+
+
+
+
+
+
+
+
+
+ {{ toastState.title }}
+ {{ toastState.body }}
+
+
+
+
diff --git a/frontend/src/api.js b/frontend/src/api.js
index e8d569a..5de8c5a 100644
--- a/frontend/src/api.js
+++ b/frontend/src/api.js
@@ -9,19 +9,45 @@ export function setToken(token) {
else localStorage.removeItem(TOKEN_KEY)
}
-/** 后端统一响应:success/code/message/data/requestId。失败时抛出携带 code 与 requestId 的错误。 */
+function buildQuery(params) {
+ const search = new URLSearchParams()
+ for (const [key, value] of Object.entries(params || {})) {
+ if (value === undefined || value === null || value === '' || value === 'all') continue
+ search.set(key, String(value))
+ }
+ const text = search.toString()
+ return text ? `?${text}` : ''
+}
+
+/**
+ * 后端统一响应:success/code/message/data/requestId。
+ * 失败时抛出携带 code、requestId、httpStatus 的错误,由 ui.describeError 统一转文案。
+ */
export async function request(path, options = {}) {
const headers = { 'Content-Type': 'application/json', ...(options.headers || {}) }
const token = getToken()
if (token) headers.Authorization = `Bearer ${token}`
- const response = await fetch(path, { ...options, headers })
+ let response
+ try {
+ response = await fetch(path, { ...options, headers })
+ } catch (e) {
+ const error = new Error('无法连接后端服务,请确认服务已启动或网络可用')
+ error.code = 'NETWORK_ERROR'
+ error.retryable = true
+ throw error
+ }
+
let body = null
try {
body = await response.json()
} catch {
- throw new Error(`服务返回非 JSON 响应(HTTP ${response.status})`)
+ const error = new Error(`服务返回非 JSON 响应(HTTP ${response.status})`)
+ error.code = 'INVALID_RESPONSE'
+ error.httpStatus = response.status
+ throw error
}
+
if (!body || body.success !== true) {
const error = new Error(body?.message || `请求失败(HTTP ${response.status})`)
error.code = body?.code
@@ -47,6 +73,7 @@ export const api = {
me: () => request('/api/v1/auth/me'),
bindings: () => request('/api/v1/napcat-bindings'),
+ binding: (uid) => request(`/api/v1/napcat-bindings/${uid}`),
createBinding: (payload) => request('/api/v1/napcat-bindings', { method: 'POST', body: JSON.stringify(payload) }),
rotateToken: (uid, accessToken) =>
request(`/api/v1/napcat-bindings/${uid}/access-token`, {
@@ -55,13 +82,15 @@ export const api = {
}),
deactivateBinding: (uid) => request(`/api/v1/napcat-bindings/${uid}`, { method: 'DELETE' }),
- messages: (params) => request(`/api/v1/messages?${new URLSearchParams(params)}`),
- message: (uid) => request(`/api/v1/messages/${uid}`),
+ messages: (params) => request(`/api/v1/messages${buildQuery(params)}`),
+ message: (uid) => request(`/api/v1/messages/${encodeURIComponent(uid)}`),
+ conversations: (page = 1, pageSize = 50) =>
+ request(`/api/v1/messages/conversations${buildQuery({ page, pageSize })}`),
messageStats: () => request('/api/v1/messages/stats'),
mediaStats: () => request('/api/v1/media/stats'),
- media: (uid) => request(`/api/v1/media/${uid}`),
- mediaAccessUrl: (uid) => request(`/api/v1/media/${uid}/access-url`),
+ media: (uid) => request(`/api/v1/media/${encodeURIComponent(uid)}`),
+ mediaAccessUrl: (uid) => request(`/api/v1/media/${encodeURIComponent(uid)}/access-url`),
prepareText: (payload, idempotencyKey) =>
request('/api/v1/send/text', {
@@ -70,11 +99,11 @@ export const api = {
body: JSON.stringify(payload)
}),
executeSend: (uid, confirmToken) =>
- request(`/api/v1/send/operations/${uid}/execute`, {
+ request(`/api/v1/send/operations/${encodeURIComponent(uid)}/execute`, {
method: 'POST',
body: JSON.stringify({ confirmToken })
}),
- sendOperation: (uid) => request(`/api/v1/send/operations/${uid}`),
+ sendOperation: (uid) => request(`/api/v1/send/operations/${encodeURIComponent(uid)}`),
sendOperations: (limit = 50) => request(`/api/v1/send/operations?limit=${limit}`),
sendSummary: () => request('/api/v1/send/summary')
}
diff --git a/frontend/src/components/ConfirmDialog.vue b/frontend/src/components/ConfirmDialog.vue
new file mode 100644
index 0000000..4d5541e
--- /dev/null
+++ b/frontend/src/components/ConfirmDialog.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
{{ title }}
+
+
+
{{ message }}
+
{{ hint }}
+
+
+
+
+
+
diff --git a/frontend/src/components/DemoBadge.vue b/frontend/src/components/DemoBadge.vue
new file mode 100644
index 0000000..1e7bccf
--- /dev/null
+++ b/frontend/src/components/DemoBadge.vue
@@ -0,0 +1,3 @@
+
+ 演示数据
+
diff --git a/frontend/src/components/DetailDrawer.vue b/frontend/src/components/DetailDrawer.vue
new file mode 100644
index 0000000..b98bf83
--- /dev/null
+++ b/frontend/src/components/DetailDrawer.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
{{ title }}
+
{{ subtitle }}
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/PageHead.vue b/frontend/src/components/PageHead.vue
new file mode 100644
index 0000000..2ed724e
--- /dev/null
+++ b/frontend/src/components/PageHead.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
{{ kicker }}
+
{{ title }}
+
{{ desc }}
+
+
+
+
+
+
diff --git a/frontend/src/components/Pagination.vue b/frontend/src/components/Pagination.vue
new file mode 100644
index 0000000..9a9dd7a
--- /dev/null
+++ b/frontend/src/components/Pagination.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
diff --git a/frontend/src/components/PlannedNotice.vue b/frontend/src/components/PlannedNotice.vue
new file mode 100644
index 0000000..9133bc6
--- /dev/null
+++ b/frontend/src/components/PlannedNotice.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
{{ title }}
+
{{ summary }}
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/SectionState.vue b/frontend/src/components/SectionState.vue
new file mode 100644
index 0000000..c73e43c
--- /dev/null
+++ b/frontend/src/components/SectionState.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+ {{ loadingText }}
+
+
+
+
+
{{ error.title }}
+
{{ error.message }}
+
{{ error.hint }}
+
+ 错误码 {{ error.code }}
+ · 请求 {{ error.requestId }}
+
+
+
+
+
+
+
{{ emptyTitle }}
+
{{ emptyText }}
+
+
+
+
+
diff --git a/frontend/src/components/StatCard.vue b/frontend/src/components/StatCard.vue
new file mode 100644
index 0000000..4299af0
--- /dev/null
+++ b/frontend/src/components/StatCard.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+ {{ label }}
+ {{ icon }}
+
+
{{ shown }}
+
+
+
diff --git a/frontend/src/components/StatusTag.vue b/frontend/src/components/StatusTag.vue
new file mode 100644
index 0000000..4176f39
--- /dev/null
+++ b/frontend/src/components/StatusTag.vue
@@ -0,0 +1,17 @@
+
+
+
+ {{ text }}
+
diff --git a/frontend/src/demo/config.js b/frontend/src/demo/config.js
new file mode 100644
index 0000000..f4d4db3
--- /dev/null
+++ b/frontend/src/demo/config.js
@@ -0,0 +1,23 @@
+import { reactive } from 'vue'
+
+/**
+ * 演示数据总开关。
+ *
+ * 默认开启,便于用 file:// 直接预览完整页面;设置 VITE_ENABLE_MOCK=false 构建后默认关闭。
+ * 运行时开关保存在 localStorage,关闭后未实现页面整体显示「未开发 / 规划中」,
+ * 已实现能力继续使用真实接口,不伪造任何成功状态。
+ */
+const STORAGE_KEY = 'qlinker.demo-enabled'
+const envDefault = import.meta.env.VITE_ENABLE_MOCK !== 'false'
+const stored = localStorage.getItem(STORAGE_KEY)
+
+export const demoState = reactive({
+ enabled: stored === null ? envDefault : stored === 'true'
+})
+
+export function setDemoEnabled(value) {
+ demoState.enabled = Boolean(value)
+ localStorage.setItem(STORAGE_KEY, demoState.enabled ? 'true' : 'false')
+}
+
+export const MOCK_NOTE = '当前页面含演示数据,仅用于界面预览,不代表真实业务状态。'
diff --git a/frontend/src/demo/planned.js b/frontend/src/demo/planned.js
new file mode 100644
index 0000000..3adee81
--- /dev/null
+++ b/frontend/src/demo/planned.js
@@ -0,0 +1,150 @@
+/**
+ * 演示数据集(未实现能力的占位内容)。
+ * 规则:所有引用处必须同时渲染「演示数据」标识;不得与真实接口返回值混用;
+ * 关闭 MOCK_ENABLED 后这些数据不再渲染,页面回到「未开发 / 规划中」。
+ */
+
+export const PLANNED_DEPS = {
+ dashboard: ['/system/alerts 实时告警', '/messages/stats 今日与时间序列', '/automation/runs 执行统计', '/ai/calls 调用统计'],
+ automation: ['/automation/rules 规则与草稿', '/automation/rules/{id}/versions 版本', '/automation/debug-runs 调试', '/automation/runs 执行记录'],
+ ai: ['/ai/providers 与 /ai/providers/{id}/test', '/ai/capabilities', '/ai/calls 与成本统计'],
+ ops: ['/health 依赖分项(MySQL / MinIO / 队列 / 主机资源)', '/alerts 告警处理(确认 / 分派 / 静默 / 关闭)'],
+ logs: ['/logs 统一日志', '/traces/{traceId} 链路详情', '/export-tasks 导出任务'],
+ backup: ['/backups 备份与校验', '/restore-drills 恢复演练'],
+ security: ['/users /roles /tokens /approvals /audit-events', '紧急停止后端控制'],
+ settings: ['/settings 实例设置读写']
+}
+
+export const dashboardTrend24h = [
+ 28, 36, 31, 44, 39, 58, 49, 65, 54, 75, 60, 84,
+ 72, 62, 89, 70, 95, 80, 67, 88, 61, 75, 54, 68
+]
+
+export const dashboardTrend7d = [62, 74, 58, 83, 91, 76, 88]
+
+export const dashboardAlerts = [
+ { level: 'warning', title: 'NapCat-03 连接不稳定', detail: '连续重连 3 次 · 8 分钟前', status: '警告' },
+ { level: 'error', title: '规则「群消息归档」执行失败', detail: '节点:文件上传 · 21 分钟前', status: '失败' },
+ { level: 'success', title: '备份任务已完成', detail: '数据完整性检查通过 · 1 小时前', status: '已恢复' }
+]
+
+export const automationSummary = { successRate: 98.6, success: 1266, failed: 18, recent: '群消息智能分流' }
+
+export const automationRules = [
+ { name: '群消息智能分流', trigger: '收到群消息', lastRun: '09:44:12', successRate: '99.2%', status: '运行中', version: 'v2.1' },
+ { name: '群消息归档', trigger: '收到群消息', lastRun: '09:42:08', successRate: '96.4%', status: '运行中', version: 'v1.3' },
+ { name: '关键词自动回复', trigger: '关键词命中', lastRun: '09:31:46', successRate: '98.8%', status: '已停用', version: 'v1.0' }
+]
+
+export const automationNodes = [
+ { id: 'trigger', kind: 'EVENT', title: '收到群消息', sub: '触发器', x: 18, y: 70 },
+ { id: 'condition', kind: 'IF', title: '关键词判断', sub: '条件', x: 300, y: 70 },
+ { id: 'ai', kind: 'LLM', title: 'AI 内容分类', sub: 'AI 调用', x: 582, y: 70 },
+ { id: 'send', kind: 'SEND', title: '发送处理结果', sub: '动作', x: 864, y: 70 }
+]
+
+export const automationRuns = [
+ { id: 'run_20261104_01', rule: '群消息智能分流', status: 'SUCCEEDED', startedAt: '09:44:12', duration: '860ms', node: '全部通过' },
+ { id: 'run_20261104_02', rule: '群消息归档', status: 'FAILED', startedAt: '09:42:08', duration: '1.4s', node: '文件上传' },
+ { id: 'run_20261104_03', rule: '关键词自动回复', status: 'SUCCEEDED', startedAt: '09:31:46', duration: '320ms', node: '全部通过' }
+]
+
+export const aiProviders = [
+ { name: 'OpenAI 兼容', protocol: 'OpenAI Compatible', model: 'GPT-4.1', todayCalls: 328, budget: 92, status: '已启用', test: '成功 · 09:12' },
+ { name: 'DeepSeek', protocol: 'OpenAI Compatible', model: 'V3 / R1', todayCalls: 241, budget: 86, status: '已启用', test: '成功 · 08:58' },
+ { name: 'Qwen', protocol: 'OpenAI Compatible', model: 'Plus', todayCalls: 73, budget: 64, status: '已启用', test: '成功 · 08:40' }
+]
+
+export const aiCapabilities = [
+ { name: '消息智能分类', model: 'GPT-4.1', enabled: true, desc: '按规则对入站消息打标签' },
+ { name: '自动摘要', model: 'DeepSeek V3', enabled: true, desc: '群聊与长消息摘要' },
+ { name: 'AI 回复建议', model: 'DeepSeek R1', enabled: true, desc: '生成建议草稿,不自动发送' },
+ { name: '自动发送回复', model: '—', enabled: false, desc: '高风险:当前未启用' }
+]
+
+export const aiCalls = [
+ { time: '09:43:20', capability: '消息智能分类', model: 'GPT-4.1', duration: '1.28s', tokens: '1,240', result: '成功' },
+ { time: '09:38:12', capability: '自动摘要', model: 'DeepSeek V3', duration: '2.04s', tokens: '3,180', result: '成功' },
+ { time: '09:26:44', capability: 'AI 回复建议', model: 'DeepSeek R1', duration: '3.10s', tokens: '2,460', result: '成功' },
+ { time: '09:12:03', capability: '消息智能分类', model: 'Qwen Plus', duration: '1.62s', tokens: '980', result: '限流失败' },
+ { time: '08:58:37', capability: '自动摘要', model: 'GPT-4.1', duration: '2.38s', tokens: '4,020', result: '成功' }
+]
+
+export const opsDependencies = [
+ { name: 'QLinker API', status: '正常', latency: '86 ms' },
+ { name: 'MySQL', status: '正常', latency: '12 ms' },
+ { name: 'MinIO', status: '正常', latency: '24 ms' },
+ { name: 'NapCat 连接', status: '部分异常', latency: '—' },
+ { name: '任务队列', status: '正常', latency: '28 条积压' }
+]
+
+export const opsResources = [
+ { name: 'CPU', value: '38%', width: 38 },
+ { name: '内存', value: '62%', width: 62 },
+ { name: '磁盘', value: '42%', width: 42 }
+]
+
+export const opsAlerts = [
+ { level: 'warning', title: 'NapCat-03 连续重连', time: '09:36', status: '未确认' },
+ { level: 'error', title: '规则执行失败:文件上传节点', time: '09:23', status: '未确认' },
+ { level: 'info', title: '备份完整性校验通过', time: '08:40', status: '已关闭' }
+]
+
+export const logRows = [
+ { time: '09:44:12', level: 'INFO', source: 'event.ingest', summary: '群消息事件已持久化', trace: 'trc_9f21', cost: '12 ms' },
+ { time: '09:42:18', level: 'INFO', source: 'media.download', summary: '图片下载完成并写入对象存储', trace: 'trc_9f18', cost: '860 ms' },
+ { time: '09:42:08', level: 'ERROR', source: 'automation.run', summary: '节点「文件上传」执行失败:对象存储超时', trace: 'trc_9f16', cost: '1.4 s' },
+ { time: '09:38:12', level: 'INFO', source: 'ai.call', summary: '摘要调用完成,tokens=3180', trace: 'trc_9f12', cost: '2.04 s' },
+ { time: '09:26:44', level: 'WARN', source: 'send.operation', summary: '发送结果未知,等待人工核实', trace: 'trc_9f09', cost: '5.0 s' },
+ { time: '09:12:03', level: 'WARN', source: 'ai.call', summary: '供应商返回限流,已按策略降级', trace: 'trc_9f04', cost: '1.62 s' },
+ { time: '08:58:37', level: 'INFO', source: 'napcat.connection', summary: '反向 WebSocket 连接恢复', trace: 'trc_9ef8', cost: '40 ms' },
+ { time: '08:40:00', level: 'INFO', source: 'backup.task', summary: '数据库全量备份完成,校验通过', trace: 'trc_9ef1', cost: '6.2 s' }
+]
+
+export const backupPlans = [
+ { name: '数据库全量', scope: '业务库', schedule: '每日 03:30', retention: '14 天', enabled: true },
+ { name: '配置与规则', scope: '规则 / 设置', schedule: '每日 04:00', retention: '30 天', enabled: true },
+ { name: '对象存储元数据', scope: 'MinIO 元数据', schedule: '每日 04:20', retention: '30 天', enabled: true },
+ { name: '媒体文件', scope: 'MinIO 对象', schedule: '每周日 05:00', retention: '8 周', enabled: true }
+]
+
+export const backupRecords = [
+ { time: '今天 08:40', scope: '数据库全量', type: '自动', size: '1.8 GB', verify: '校验通过' },
+ { time: '今天 04:20', scope: '对象存储元数据', type: '自动', size: '246 MB', verify: '校验通过' },
+ { time: '今天 04:00', scope: '配置与规则', type: '自动', size: '12 MB', verify: '校验通过' },
+ { time: '昨天 03:30', scope: '数据库全量', type: '自动', size: '1.7 GB', verify: '校验通过' },
+ { time: '昨天 05:00', scope: '媒体文件', type: '自动', size: '38 GB', verify: '校验通过' }
+]
+
+export const securityUsers = [
+ { name: '王明', account: 'admin', role: '系统管理员', status: '启用', lastLogin: '09:02' },
+ { name: '李静', account: 'ops_li', role: '运维管理员', status: '启用', lastLogin: '08:41' },
+ { name: '陈晨', account: 'msg_chen', role: '消息运营', status: '启用', lastLogin: '08:20' }
+]
+
+export const securityRoles = [
+ { name: '系统管理员', members: 2, scope: '全部资源', changed: '10-28' },
+ { name: '运维管理员', members: 3, scope: '连接 / 运维 / 日志', changed: '10-21' },
+ { name: '消息运营', members: 5, scope: '消息 / 发送 / 检索', changed: '10-12' }
+]
+
+export const securityTokens = [
+ { name: 'napcat-ops', scope: 'NAPCAT_READ', expires: '2026-12-01', status: '有效' },
+ { name: 'ci-readonly', scope: 'MESSAGE_READ', expires: '2026-11-09', status: '临期' },
+ { name: 'legacy', scope: 'MESSAGE_READ', expires: '2026-10-01', status: '已过期' }
+]
+
+export const securityApprovals = [
+ { title: '批量停用 3 个 QQ 账号', submitter: '李静', time: '09:41', risk: '高' },
+ { title: '修改 AI 自动发送权限', submitter: '陈晨', time: '09:28', risk: '高' }
+]
+
+export const settingsValues = {
+ instanceName: '生产实例 · QL-01',
+ instanceCode: 'QL-01',
+ timezone: 'Asia/Shanghai',
+ retention: '365',
+ theme: 'system',
+ realtime: true,
+ mobileNotify: true
+}
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 755908c..ea8126b 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -1,24 +1,47 @@
import { createApp } from 'vue'
-import { createRouter, createWebHistory } from 'vue-router'
+import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App.vue'
-import BootstrapView from './views/BootstrapView.vue'
-import LoginView from './views/LoginView.vue'
-import OverviewView from './views/OverviewView.vue'
-import BindingsView from './views/BindingsView.vue'
-import MessagesView from './views/MessagesView.vue'
-import SendView from './views/SendView.vue'
import { getToken } from './api'
+import './styles/prototype.css'
+import './styles/app.css'
+import DashboardView from './views/DashboardView.vue'
+import MessagesView from './views/MessagesView.vue'
+import MessageSearchView from './views/MessageSearchView.vue'
+import ConnectionsView from './views/ConnectionsView.vue'
+import AutomationView from './views/AutomationView.vue'
+import AiView from './views/AiView.vue'
+import OpsView from './views/OpsView.vue'
+import LogsView from './views/LogsView.vue'
+import BackupView from './views/BackupView.vue'
+import SecurityView from './views/SecurityView.vue'
+import SettingsView from './views/SettingsView.vue'
+import LoginView from './views/LoginView.vue'
+import BootstrapView from './views/BootstrapView.vue'
+
+// 使用 hash 路由:构建产物 dist/index.html 可被 file:// 直接打开预览,
+// 部署到任意子路径时也不需要额外的服务端路由重写。
const router = createRouter({
- history: createWebHistory(),
+ history: createWebHashHistory(),
routes: [
- { path: '/', redirect: '/overview' },
- { path: '/bootstrap', component: BootstrapView, meta: { public: true } },
- { path: '/login', component: LoginView, meta: { public: true } },
- { path: '/overview', component: OverviewView },
- { path: '/bindings', component: BindingsView },
- { path: '/messages', component: MessagesView },
- { path: '/send', component: SendView }
+ { path: '/', redirect: '/dashboard' },
+
+ { path: '/bootstrap', component: BootstrapView, meta: { public: true, title: '首次初始化' } },
+ { path: '/login', component: LoginView, meta: { public: true, title: '管理员登录' } },
+
+ { path: '/dashboard', component: DashboardView, meta: { title: '工作台', group: '工作空间' } },
+ { path: '/messages', component: MessagesView, meta: { title: '消息中心', group: '工作空间' } },
+ { path: '/message-search', component: MessageSearchView, meta: { title: '消息检索', group: '工作空间' } },
+ { path: '/connections', component: ConnectionsView, meta: { title: '接入管理', group: '工作空间' } },
+ { path: '/automation', component: AutomationView, meta: { title: '自动化规则', group: '工作空间' } },
+ { path: '/ai', component: AiView, meta: { title: 'AI 能力', group: '工作空间' } },
+ { path: '/ops', component: OpsView, meta: { title: '运维监控', group: '工作空间' } },
+ { path: '/logs', component: LogsView, meta: { title: '日志中心', group: '工作空间' } },
+ { path: '/backup', component: BackupView, meta: { title: '备份与恢复', group: '平台管理' } },
+ { path: '/security', component: SecurityView, meta: { title: '安全中心', group: '平台管理' } },
+ { path: '/settings', component: SettingsView, meta: { title: '系统设置', group: '平台管理' } },
+
+ { path: '/:pathMatch(.*)*', redirect: '/dashboard' }
]
})
diff --git a/frontend/src/styles/app.css b/frontend/src/styles/app.css
new file mode 100644
index 0000000..eefc827
--- /dev/null
+++ b/frontend/src/styles/app.css
@@ -0,0 +1,218 @@
+/* 在原型 token 之上补齐语义变量与新增组件;所有页面共用同一套颜色与排版。 */
+:root {
+ --line: light-dark(#e5e9f2, #273247);
+ --line-soft: light-dark(#edf0f5, #253147);
+ --line-strong: light-dark(#dce2ed, #3a465d);
+ --muted: light-dark(#8792a7, #9aa7bd);
+ --muted-strong: light-dark(#6b788f, #b3bed0);
+ --card-bg: light-dark(#ffffff, #121b2b);
+ --field-bg: light-dark(#ffffff, #172235);
+ --soft-bg: light-dark(#f8faff, #182337);
+ --primary-soft: light-dark(#eaf0ff, #1c2d52);
+ --danger: #d94841;
+ --success: #13865c;
+}
+
+body { min-height: 100vh; }
+a { color: inherit; }
+button:disabled { cursor: not-allowed; opacity: .55; }
+
+.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
+.brand-text strong { font-size: 18px; letter-spacing: -.4px; }
+.brand-text span { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
+
+.nav-group { display: flex; flex-direction: column; gap: 3px; }
+.nav-item .nav-meta { margin-left: auto; font-size: 10px; color: var(--muted); font-weight: 500; }
+.nav-item.active .nav-meta { color: inherit; }
+
+.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
+.btn.block { width: 100%; justify-content: center; }
+.btn.ghost { border-color: transparent; background: transparent; }
+.btn.ghost:hover { background: light-dark(#f2f5ff, #1d2a40); border-color: transparent; }
+
+.topbar .instance strong { font-size: 12px; }
+.topbar .instance span { font-size: 11px; color: var(--muted); }
+.top-actions .avatar { cursor: pointer; }
+.top-actions { position: relative; }
+.dropdown {
+ position: absolute; right: 0; top: 46px; min-width: 210px; z-index: 15;
+ background: var(--card-bg); border: 1px solid var(--line); border-radius: 12px;
+ box-shadow: 0 18px 46px #10182822; padding: 8px;
+}
+.dropdown .dd-head { padding: 9px 10px 11px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
+.dropdown .dd-head strong { display: block; font-size: 13px; }
+.dropdown .dd-head span { font-size: 11px; color: var(--muted); }
+.dropdown button {
+ display: flex; width: 100%; gap: 8px; align-items: center; padding: 9px 10px;
+ border: 0; background: transparent; color: inherit; border-radius: 8px; text-align: left;
+}
+.dropdown button:hover { background: light-dark(#f2f5ff, #1d2a40); }
+
+.demo-badge {
+ display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px;
+ background: light-dark(#fff5df, #3d2c13); color: #b7791f; font-size: 10px; font-weight: 700;
+ border: 1px solid light-dark(#f5e2b8, #5a431c); white-space: nowrap;
+}
+.demo-banner {
+ display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: -6px 0 18px;
+ padding: 10px 13px; border-radius: 10px; font-size: 12px;
+ background: light-dark(#fffaf0, #2c2414); border: 1px solid light-dark(#f3e3c3, #4a3b1c); color: #9a7320;
+}
+.demo-banner .btn { margin-left: auto; }
+
+.notice {
+ border: 1px solid light-dark(#dbe3ff, #314a7a); background: light-dark(#f4f7ff, #1a2b4d);
+ color: light-dark(#25409a, #b7c9ff); border-radius: 10px; padding: 11px 13px; font-size: 12px;
+ line-height: 1.6; display: flex; gap: 9px; align-items: flex-start;
+}
+.notice.warn { border-color: light-dark(#f3e3c3, #5a431c); background: light-dark(#fffaf0, #2c2414); color: #9a7320; }
+.notice.danger { border-color: light-dark(#f3d2cf, #5c2a2a); background: light-dark(#fff5f4, #341d1f); color: #b23b34; }
+.notice + .notice { margin-top: 10px; }
+.notice .btn { margin-left: auto; flex-shrink: 0; }
+
+.state-block {
+ display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
+ padding: 42px 20px; color: var(--muted); text-align: center; border-radius: 12px;
+ border: 1px dashed var(--line-strong); background: var(--soft-bg);
+}
+.state-block strong { color: inherit; font-size: 14px; }
+.state-block p { margin: 0; max-width: 560px; line-height: 1.6; font-size: 12px; }
+.skeleton { height: 14px; border-radius: 6px; background: light-dark(#eef1f7, #1f2b3d); animation: pulse 1.4s ease-in-out infinite; }
+@keyframes pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
+
+.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
+.pager .pager-info { font-size: 12px; color: var(--muted); }
+.pager .pager-actions { display: flex; gap: 8px; align-items: center; }
+.pager select { height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field-bg); color: inherit; }
+
+.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
+.form-grid .full { grid-column: 1 / -1; }
+.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
+.fld > label { font-size: 12px; font-weight: 650; color: var(--muted-strong); }
+.fld > label .req { color: var(--danger); margin-left: 3px; }
+.fld .field { width: 100%; min-width: 0; }
+.fld .field.invalid { border-color: #e0827c; box-shadow: 0 0 0 3px #d9484118; }
+.fld .field-hint { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
+.fld .field-error { margin: 0; font-size: 11px; color: var(--danger); }
+.fld textarea.field { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
+.field[disabled], .field:disabled { opacity: .6; }
+
+.kv { display: flex; flex-direction: column; gap: 9px; }
+.kv-row { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; }
+.kv-row span:first-child { color: var(--muted); flex-shrink: 0; }
+.kv-row span:last-child { text-align: right; word-break: break-all; }
+
+.drawer-backdrop {
+ position: fixed; inset: 0; background: #0b122080; z-index: 40;
+ display: flex; justify-content: flex-end;
+}
+.drawer {
+ width: min(720px, 100%); height: 100%; background: var(--card-bg);
+ border-left: 1px solid var(--line); display: flex; flex-direction: column;
+ animation: slide-in .18s ease;
+}
+@keyframes slide-in { from { transform: translateX(24px); opacity: .6 } to { transform: translateX(0); opacity: 1 } }
+.drawer-head { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
+.drawer-head h3 { margin: 0 0 5px; font-size: 17px; }
+.drawer-head p { margin: 0; color: var(--muted); font-size: 12px; }
+.drawer-body { padding: 18px 22px 32px; overflow: auto; flex: 1; }
+.drawer-section { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
+.drawer-section:last-child { border-bottom: 0; }
+.drawer-section h4 { margin: 0 0 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
+
+.raw-pre {
+ margin: 0; padding: 12px; border-radius: 10px; overflow: auto; max-height: 320px;
+ background: light-dark(#f7f9fd, #0f1929); border: 1px solid var(--line);
+ font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.6;
+ white-space: pre-wrap; word-break: break-all;
+}
+.segment {
+ border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
+ background: light-dark(#fbfcff, #172235);
+}
+.segment .seg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 6px; }
+.segment .seg-body { font-size: 12px; color: var(--muted-strong); word-break: break-all; line-height: 1.6; }
+.segment img { max-width: 100%; border-radius: 8px; margin-top: 8px; display: block; }
+
+.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 8px; }
+.bar-chart .bar { flex: 1; background: linear-gradient(180deg, #6d8dff, var(--site-primary)); border-radius: 5px 5px 2px 2px; min-height: 4px; position: relative; }
+.bar-chart .bar:hover:after {
+ content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
+ background: #172033; color: #fff; font-size: 10px; padding: 3px 6px; border-radius: 5px; white-space: nowrap;
+}
+.chart-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 8px; }
+
+.auth-shell {
+ min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
+ background: light-dark(#f4f6fb, #0c1220);
+}
+.auth-brand {
+ padding: 38px 34px; background: light-dark(#172554, #0b1120); color: #fff;
+ display: flex; flex-direction: column; gap: 34px;
+}
+.auth-brand .brand-text strong { color: #fff; }
+.auth-brand .brand-text span { color: #9fb0d8; }
+.auth-brand .logo { background: #fff; color: var(--site-primary); box-shadow: none; }
+.auth-pitch h1 { font-size: 26px; line-height: 1.35; letter-spacing: -.6px; margin: 0 0 12px; }
+.auth-pitch p { color: #b8c6e6; line-height: 1.7; margin: 0 0 22px; font-size: 13px; }
+.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
+.auth-points li { display: flex; gap: 10px; font-size: 12px; color: #cdd8ef; line-height: 1.6; }
+.auth-points li span { width: 6px; height: 6px; border-radius: 50%; background: #7c9aFF; margin-top: 7px; flex-shrink: 0; }
+.auth-foot { margin: auto 0 0; font-size: 11px; color: #7f90b8; }
+.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
+.auth-card {
+ width: min(460px, 100%); background: var(--card-bg); border: 1px solid var(--line);
+ border-radius: 16px; padding: 28px; box-shadow: 0 22px 60px #10182812;
+}
+.auth-card-head { margin-bottom: 20px; }
+.auth-title { font-size: 23px; margin: 0 0 8px; letter-spacing: -.5px; }
+.auth-sub { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
+.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
+.auth-form .input {
+ height: 40px; border: 1px solid var(--line-strong); border-radius: 9px;
+ background: var(--field-bg); color: inherit; padding: 0 11px; outline: none; width: 100%;
+}
+.auth-form .input:focus { border-color: #8299ff; box-shadow: 0 0 0 3px #315efb1c; }
+.auth-form .input.invalid { border-color: #e0827c; }
+.auth-note { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 16px 0 0; }
+.auth-note a { color: var(--site-primary); }
+.loading-row { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; padding: 10px 0; }
+.spinner {
+ width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--site-primary);
+ border-radius: 50%; animation: spin .8s linear infinite;
+}
+@keyframes spin { to { transform: rotate(360deg) } }
+.guide-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
+.guide-step { display: flex; gap: 10px; font-size: 12px; color: var(--muted-strong); line-height: 1.55; }
+.guide-step b { width: 20px; height: 20px; border-radius: 6px; background: var(--primary-soft); color: var(--site-primary); display: grid; place-items: center; flex-shrink: 0; font-size: 11px; }
+
+.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
+.tabs { overflow-x: auto; }
+.tab:disabled { opacity: .55; cursor: not-allowed; }
+.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
+.filterbar .field { flex: 0 0 auto; }
+.filterbar .searchfield { flex: 1 1 240px; }
+.filterbar .full { flex-basis: 100%; }
+.inline-warn { font-size: 11px; color: #b7791f; }
+.switch { cursor: pointer; border: 0; }
+.switch.off:after { background: #fff; }
+
+.status.muted { color: #7a869a; background: light-dark(#f0f2f6, #252f40); }
+.small-muted { font-size: 11px; color: var(--muted); }
+.two-col > .card, .three-col > .card { min-width: 0; }
+.card-head .card-title { display: flex; align-items: center; gap: 8px; }
+.scroll-area { max-height: 340px; overflow: auto; }
+
+@media (max-width: 1200px) {
+ .auth-shell { grid-template-columns: 1fr; }
+ .auth-brand { display: none; }
+ .form-grid { grid-template-columns: 1fr; }
+}
+@media (max-width: 760px) {
+ .auth-main { padding: 24px 13px; }
+ .auth-card { padding: 20px; border-radius: 12px; }
+ .drawer { width: 100%; }
+ .topbar .brand-text { display: none; }
+ .filterbar .field { flex: 1 1 120px; }
+ .pager { flex-direction: column; align-items: flex-start; }
+}
diff --git a/frontend/src/styles/prototype.css b/frontend/src/styles/prototype.css
new file mode 100644
index 0000000..5dfee5d
--- /dev/null
+++ b/frontend/src/styles/prototype.css
@@ -0,0 +1,7 @@
+
+:root{--site-primary:#315efb;--site-on-primary:#ffffff;--site-secondary:#172554;--site-on-secondary:#ffffff;--site-background:#f4f6fb;--site-on-background:#172033;--site-font-body:Inter,"PingFang SC","Microsoft YaHei",sans-serif;--site-font-heading:Inter,"PingFang SC","Microsoft YaHei",sans-serif;--site-heading-scale:1;--site-spacing-scale:1;--site-radius-scale:1;--site-decoration-opacity:1;color-scheme:light dark}
+*{box-sizing:border-box}body{margin:0;font-family:var(--site-font-body);background:light-dark(#f4f6fb,#0c1220);color:light-dark(#172033,#e7ecf6);font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}.app{min-height:100vh;background-color:light-dark(#f4f6fb,#0c1220);color:light-dark(#172033,#e7ecf6);display:flex;flex-direction:column}.topbar{height:68px;background:light-dark(#fff,#121b2b);border-bottom:1px solid light-dark(#e5e9f2,#273247);display:flex;align-items:center;padding:0 26px;gap:22px;position:sticky;top:0;z-index:5}.brand{display:flex;align-items:center;gap:10px;min-width:228px;font-weight:800;font-size:19px;letter-spacing:-.4px}.logo{width:34px;height:34px;border-radius:11px;background:var(--site-primary);color:#fff;display:grid;place-items:center;font-weight:900;box-shadow:0 5px 15px #315efb44}.instance{border:1px solid light-dark(#e3e8f2,#344158);border-radius:9px;padding:8px 11px;background:light-dark(#f8faff,#1b2638);color:inherit;display:flex;gap:8px;align-items:center}.global-search{height:38px;max-width:430px;flex:1;display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid light-dark(#e4e8f0,#334057);border-radius:10px;background:light-dark(#f8f9fc,#192437);color:#8490a6}.global-search input{border:0;outline:0;background:transparent;width:100%;color:inherit}.top-actions{margin-left:auto;display:flex;gap:10px;align-items:center}.icon-btn{position:relative;border:1px solid light-dark(#e5e9f2,#344158);background:light-dark(#fff,#1a2638);color:inherit;border-radius:10px;width:38px;height:38px;display:grid;place-items:center;font-size:17px}.dot{position:absolute;right:7px;top:6px;width:7px;height:7px;border-radius:50%;background:#ef4444;border:1px solid white}.avatar{width:34px;height:34px;border-radius:50%;background:#dbeafe;color:#1d4ed8;display:grid;place-items:center;font-weight:700}.shell{display:flex;min-height:calc(100vh - 68px);flex:1}.sidebar{width:238px;flex-shrink:0;padding:20px 12px;background:light-dark(#fff,#121b2b);border-right:1px solid light-dark(#e5e9f2,#273247);display:flex;flex-direction:column;gap:4px}.nav-label{font-size:11px;color:#98a2b5;font-weight:700;letter-spacing:1px;padding:15px 13px 7px}.nav-item{display:flex;align-items:center;gap:12px;padding:11px 13px;border-radius:9px;color:light-dark(#58657b,#a8b3c8);font-weight:550;text-decoration:none;cursor:pointer;border:0;background:transparent;text-align:left;width:100%}.nav-item:hover{background:light-dark(#f2f5ff,#1d2a40);color:var(--site-primary)}.nav-item.active{background:light-dark(#eaf0ff,#1c2d52);color:light-dark(#254fe3,#9cb5ff);font-weight:700}.nav-icon{width:20px;text-align:center;font-size:16px}.nav-badge{margin-left:auto;background:#fff0ed;color:#d94841;font-size:11px;padding:2px 7px;border-radius:10px}.sidebar-bottom{margin-top:auto;padding:13px;border:1px solid light-dark(#e6eaf2,#2b374d);border-radius:12px;background:light-dark(#f8faff,#182337)}.sidebar-bottom strong{display:block;margin-bottom:6px}.sidebar-bottom p{font-size:12px;line-height:1.6;color:#8a96aa;margin:0 0 10px}.content{min-width:0;flex:1;padding:27px 30px 44px;max-width:1700px;margin:0 auto;width:100%}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:23px}.eyebrow{font-size:12px;color:#8792a7;margin-bottom:7px}.page-title{font-size:calc(27px * var(--site-heading-scale));letter-spacing:-.7px;margin:0 0 7px;font-weight:780}.subtitle{color:#8792a7;margin:0;line-height:1.5}.actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.btn{border:1px solid light-dark(#dce2ed,#3a465d);border-radius:9px;padding:9px 13px;background:light-dark(#fff,#1a2638);color:inherit;font-weight:600;display:inline-flex;align-items:center;gap:7px;white-space:nowrap}.btn:hover{border-color:#9bb0ff}.btn.primary{background:var(--site-primary);border-color:var(--site-primary);color:#fff}.btn.subtle{background:light-dark(#f7f9fc,#1a2638)}.btn.danger{color:#d94841}.grid{display:grid;gap:17px}.stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:18px}.card{background:light-dark(#fff,#121b2b);border:1px solid light-dark(#e5e9f2,#273247);border-radius:14px;padding:19px;min-width:0}.stat-top{display:flex;justify-content:space-between;align-items:center;color:#8792a7;font-size:13px}.stat-icon{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;font-size:17px;background:light-dark(#eef2ff,#1c2d52);color:#4c6fff}.stat-value{font-size:29px;font-weight:780;letter-spacing:-1px;margin:12px 0 6px}.stat-foot{font-size:12px;color:#8b96a9}.up{color:#16a36a;font-weight:700}.down{color:#d97706;font-weight:700}.two-col{grid-template-columns:minmax(0,1.5fr) minmax(290px,1fr)}.three-col{grid-template-columns:repeat(3,minmax(0,1fr))}.card-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.card-title{font-size:15px;font-weight:750;margin:0}.muted{color:#8b96a9}.small{font-size:12px}.link{color:var(--site-primary);font-weight:650;cursor:pointer;border:0;background:none;padding:0}.status{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:6px;font-size:11px;font-weight:700;white-space:nowrap}.status:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.success{color:#13865c;background:light-dark(#e8f8f0,#12372d)}.warning{color:#b7791f;background:light-dark(#fff5df,#3d2c13)}.error{color:#d94841;background:light-dark(#fff0ed,#401f24)}.info{color:#315efb;background:light-dark(#edf1ff,#1c2d52)}.neutral{color:#7a869a;background:light-dark(#f0f2f6,#252f40)}table{width:100%;border-collapse:collapse}th{text-align:left;color:#8994a7;font-size:12px;font-weight:650;background:light-dark(#fafbfe,#172235);padding:12px 13px;border-bottom:1px solid light-dark(#e9edf4,#2b374c);white-space:nowrap}td{padding:14px 13px;border-bottom:1px solid light-dark(#edf0f5,#253147);vertical-align:middle}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:light-dark(#fafbff,#172235)}.table-wrap{overflow:auto;margin:0 -4px}.identity{display:flex;align-items:center;gap:10px;min-width:140px}.mini-avatar{width:34px;height:34px;border-radius:10px;background:#e8edff;color:#315efb;display:grid;place-items:center;font-weight:750;flex-shrink:0}.identity strong{display:block;font-size:13px}.identity span{display:block;color:#8b96a9;font-size:11px;margin-top:4px}.progress{height:6px;border-radius:8px;background:light-dark(#e9edf5,#2b374c);overflow:hidden}.progress span{height:100%;display:block;background:var(--site-primary);border-radius:8px}.activity{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid light-dark(#edf0f5,#253147)}.activity:last-child{border:0}.activity-icon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;flex-shrink:0}.activity p{margin:0 0 5px;line-height:1.45}.activity small{color:#8b96a9}.pill{display:inline-flex;align-items:center;border:1px solid light-dark(#e3e8f1,#344158);padding:6px 9px;border-radius:8px;color:#7f8ba0;font-size:12px}.filterbar{display:flex;gap:9px;flex-wrap:wrap;margin-bottom:16px}.field{height:38px;padding:0 11px;border:1px solid light-dark(#dfe5ef,#37445b);border-radius:9px;background:light-dark(#fff,#172235);color:inherit;outline:none;min-width:120px}.field:focus{border-color:#8299ff;box-shadow:0 0 0 3px #315efb1c}.searchfield{min-width:210px;flex:1}.tabs{display:flex;gap:5px;border-bottom:1px solid light-dark(#e6eaf2,#2b374c);margin-bottom:16px}.tab{padding:10px 13px;border:0;border-bottom:2px solid transparent;background:transparent;color:#8994a7;font-weight:650}.tab.active{color:var(--site-primary);border-bottom-color:var(--site-primary)}.chat-layout{display:grid;grid-template-columns:minmax(250px,310px) minmax(300px,1fr) minmax(220px,270px);height:620px;overflow:hidden}.chat-list{border-right:1px solid light-dark(#e5e9f2,#273247);min-width:0}.chat-list-head{padding:14px;border-bottom:1px solid light-dark(#e5e9f2,#273247)}.chat-person{display:flex;gap:10px;padding:14px;border-bottom:1px solid light-dark(#edf0f5,#253147);cursor:pointer}.chat-person.active{background:light-dark(#edf2ff,#1a2b4d)}.chat-person .meta{margin-left:auto;text-align:right;font-size:11px;color:#8994a7}.chat-person p{margin:5px 0 0;color:#8994a7;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:145px}.chat-main{display:flex;flex-direction:column;min-width:0}.chat-header{padding:15px 18px;border-bottom:1px solid light-dark(#e5e9f2,#273247);display:flex;justify-content:space-between;align-items:center}.chat-messages{padding:20px;overflow:auto;flex:1;background:light-dark(#fafbfe,#0f1929)}.dayline{text-align:center;color:#9aa4b6;font-size:11px;margin:2px 0 18px}.bubble-row{display:flex;gap:8px;margin:12px 0;align-items:flex-start}.bubble-row.mine{justify-content:flex-end}.bubble{max-width:78%;padding:11px 13px;border-radius:12px;background:light-dark(#fff,#202d41);border:1px solid light-dark(#e7ebf3,#334057);line-height:1.55}.mine .bubble{background:light-dark(#eaf0ff,#1c2d52);border-color:light-dark(#d7e1ff,#314a7a)}.bubble-meta{font-size:10px;color:#929db0;margin-top:5px}.chat-composer{padding:12px;border-top:1px solid light-dark(#e5e9f2,#273247)}.composer-input{width:100%;min-height:65px;resize:vertical;border:1px solid light-dark(#e0e5ee,#37445b);border-radius:9px;background:light-dark(#fff,#172235);padding:10px;color:inherit}.composer-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:9px}.context-panel{border-left:1px solid light-dark(#e5e9f2,#273247);padding:16px;overflow:auto}.context-section{padding:14px 0;border-bottom:1px solid light-dark(#edf0f5,#253147)}.context-section h4{margin:0 0 12px;font-size:12px}.context-line{display:flex;justify-content:space-between;gap:8px;font-size:12px;margin:10px 0}.node-canvas{min-height:430px;background-color:light-dark(#fafbff,#0f1929);background-image:radial-gradient(light-dark(#dce2ee,#2a374d) 1px,transparent 1px);background-size:18px 18px;border:1px solid light-dark(#e3e8f1,#2b374c);border-radius:12px;position:relative;overflow:hidden}.node{position:absolute;width:165px;padding:13px;background:light-dark(#fff,#172235);border:1px solid light-dark(#dce3ef,#3a4861);border-radius:11px;box-shadow:0 7px 20px #1720330a;cursor:pointer}.node.selected{border-color:var(--site-primary);box-shadow:0 0 0 3px #315efb20}.node .node-type{font-size:10px;color:#8994a7;margin-bottom:8px}.node strong{font-size:12px}.node .node-icon{display:inline-grid;place-items:center;width:23px;height:23px;border-radius:7px;margin-right:7px;background:#eaf0ff;color:#315efb}.connector{position:absolute;height:2px;background:#aab7d0;transform-origin:left center}.step-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid light-dark(#edf0f5,#253147)}.step-num{width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:light-dark(#edf1ff,#1c2d52);color:#315efb;font-weight:750}.model-card{border:1px solid light-dark(#e5e9f2,#2b374c);border-radius:12px;padding:15px}.model-logo{width:36px;height:36px;border-radius:10px;background:light-dark(#edf1ff,#1c2d52);color:#315efb;display:grid;place-items:center;font-weight:800;font-size:16px;margin-bottom:13px}.model-card h4{margin:0 0 5px}.model-card p{margin:0 0 12px;color:#8b96a9;font-size:12px}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0;border-bottom:1px solid light-dark(#edf0f5,#253147)}.setting-row:last-child{border:0}.setting-row p{margin:5px 0 0;font-size:12px;color:#8b96a9}.switch{width:38px;height:22px;border-radius:20px;background:#315efb;padding:3px;display:flex;justify-content:flex-end;flex-shrink:0}.switch:after{content:"";width:16px;height:16px;background:white;border-radius:50%}.switch.off{background:#b7c0ce;justify-content:flex-start}.toast{position:fixed;right:24px;top:82px;background:light-dark(#fff,#1c293c);border:1px solid light-dark(#dfe5ef,#344158);box-shadow:0 14px 40px #10182820;border-radius:12px;padding:14px 17px;z-index:20;display:none;max-width:330px}.toast.show{display:block;animation:appear .2s ease}.toast strong{display:block;margin-bottom:4px}.toast span{color:#8b96a9;font-size:12px}.modal-backdrop{position:fixed;inset:0;background:#0b122080;z-index:30;display:none;align-items:center;justify-content:center;padding:20px}.modal-backdrop.show{display:flex}.modal{background:light-dark(#fff,#121b2b);border:1px solid light-dark(#e5e9f2,#344158);border-radius:16px;width:min(560px,100%);padding:22px;box-shadow:0 25px 80px #0003}.modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.modal h3{margin:0}.modal p{line-height:1.6;color:#8994a7}.modal-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.hidden{display:none!important}.mobile-nav{display:none}
+@keyframes appear{from{transform:translateY(-5px);opacity:0}to{transform:translateY(0);opacity:1}}
+@media(max-width:1200px){.sidebar{width:210px}.content{padding:23px 20px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-layout{grid-template-columns:240px minmax(300px,1fr)}.context-panel{display:none}.two-col{grid-template-columns:1fr}.three-col{grid-template-columns:repeat(2,minmax(0,1fr))}.brand{min-width:190px}}
+@media(max-width:760px){.topbar{height:60px;padding:0 13px;gap:10px}.brand{min-width:0;font-size:17px}.brand .brand-text{display:none}.instance{display:none}.global-search{max-width:none}.top-actions .icon-btn:nth-child(2){display:none}.shell{display:block;min-height:calc(100vh - 60px)}.sidebar{display:none}.content{padding:20px 13px 80px}.page-head{display:block}.page-head .actions{margin-top:15px}.page-title{font-size:24px}.stats{gap:10px}.card{padding:14px;border-radius:12px}.stat-value{font-size:24px}.three-col{grid-template-columns:1fr}.chat-layout{display:flex;flex-direction:column;height:auto}.chat-list{display:none}.chat-main{min-height:570px}.chat-messages{min-height:330px}.chat-header{padding:12px}.node-canvas{min-height:430px}.node{width:140px;padding:10px}.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:10;background:light-dark(#fff,#121b2b);border-top:1px solid light-dark(#e5e9f2,#273247);justify-content:space-around;padding:8px 4px calc(8px + env(safe-area-inset-bottom))}.mobile-nav button{border:0;background:transparent;color:#8b96a9;font-size:10px;display:flex;flex-direction:column;gap:4px;align-items:center;min-width:52px}.mobile-nav button span{font-size:18px}.mobile-nav button.active{color:var(--site-primary)}.table-wrap{margin:0}.searchfield{min-width:100%}.filterbar .field{flex:1;min-width:100px}.top-actions .avatar{display:none}}
+
diff --git a/frontend/src/ui.js b/frontend/src/ui.js
new file mode 100644
index 0000000..d0ddba5
--- /dev/null
+++ b/frontend/src/ui.js
@@ -0,0 +1,144 @@
+import { reactive } from 'vue'
+
+/** 全局轻提示。只在真实操作返回后调用,禁止用它在请求前伪造成功。 */
+export const toastState = reactive({ visible: false, title: '', body: '', tone: 'info' })
+
+let toastTimer = 0
+
+export function notify(title, body = '', tone = 'info') {
+ toastState.title = title
+ toastState.body = body
+ toastState.tone = tone
+ toastState.visible = true
+ window.clearTimeout(toastTimer)
+ toastTimer = window.setTimeout(() => {
+ toastState.visible = false
+ }, 4200)
+}
+
+export function hideToast() {
+ toastState.visible = false
+}
+
+export function describeError(error) {
+ const httpStatus = error?.httpStatus
+ const code = error?.code || ''
+ let title = '请求失败'
+ let hint = '请稍后重试;若持续失败,请查看服务端日志。'
+
+ if (code === 'NETWORK_ERROR') {
+ title = '无法连接后端'
+ hint = '后端可能未启动或网络不可达。当前页面不会显示任何伪造数据。'
+ } else if (code === 'UNAUTHENTICATED' || httpStatus === 401) {
+ title = '会话已过期'
+ hint = '请重新登录后继续操作。'
+ } else if (code === 'FORBIDDEN' || httpStatus === 403) {
+ title = '权限不足'
+ hint = '当前账号没有执行该操作的权限,如需授权请联系管理员。'
+ } else if (code === 'RESOURCE_NOT_FOUND' || httpStatus === 404) {
+ title = '资源不存在或不可见'
+ hint = '该对象可能已被删除,或不在当前实例的访问范围内。'
+ } else if (code === 'RESOURCE_CONFLICT' || httpStatus === 409) {
+ title = '状态冲突'
+ hint = '对象当前状态不允许该操作,请刷新后确认最新状态。'
+ } else if (code === 'VALIDATION_ERROR' || httpStatus === 400 || httpStatus === 422) {
+ title = '请求参数不合法'
+ hint = '请检查输入内容后重试。'
+ } else if (httpStatus === 429) {
+ title = '请求过于频繁'
+ hint = '已触发限流,请稍后再试。'
+ } else if (httpStatus >= 500) {
+ title = '服务异常'
+ hint = '后端处理失败,请稍后重试并查看服务端日志。'
+ }
+
+ return {
+ title,
+ message: error?.message || '未知错误',
+ hint,
+ code: error?.code || (httpStatus ? `HTTP_${httpStatus}` : ''),
+ requestId: error?.requestId || ''
+ }
+}
+
+export function formatTime(value) {
+ if (!value) return '—'
+ const date = new Date(value)
+ if (Number.isNaN(date.getTime())) return String(value)
+ const pad = (n) => String(n).padStart(2, '0')
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`
+}
+
+export function formatShortTime(value) {
+ if (!value) return '—'
+ const date = new Date(value)
+ if (Number.isNaN(date.getTime())) return String(value)
+ const pad = (n) => String(n).padStart(2, '0')
+ return `${pad(date.getHours())}:${pad(date.getMinutes())}`
+}
+
+export function formatNumber(value) {
+ if (value === null || value === undefined || value === '') return '—'
+ const number = Number(value)
+ if (Number.isNaN(number)) return String(value)
+ return number.toLocaleString('zh-CN')
+}
+
+export function formatBytes(value) {
+ const number = Number(value)
+ if (!number || Number.isNaN(number)) return '—'
+ const units = ['B', 'KB', 'MB', 'GB', 'TB']
+ let size = number
+ let index = 0
+ while (size >= 1024 && index < units.length - 1) {
+ size /= 1024
+ index += 1
+ }
+ return `${size.toFixed(index === 0 ? 0 : 1)} ${units[index]}`
+}
+
+/** 连接状态/消息状态到语义色调;未知值一律灰,不猜成功。 */
+export function statusTone(value) {
+ const text = String(value || '').toUpperCase()
+ if (/FAIL|ERROR|OFFLINE|DISCONNECT|UNBOUND|REJECT/.test(text)) return 'error'
+ if (/WARN|UNKNOWN|PENDING|RETRY|DOWNLOAD|SILENCED/.test(text)) return 'warning'
+ if (/CONNECT|ONLINE|SUCCESS|SUCCEED|STORED|NORMAL|BOUND|ACTIVE|UP/.test(text)) return 'success'
+ if (/RUN|PROCESS|SENDING|QUEUED/.test(text)) return 'info'
+ return 'muted'
+}
+
+export function connectionLabel(value) {
+ const map = {
+ forward_websocket: '正向 WebSocket',
+ reverse_websocket: '反向 WebSocket',
+ http_callback: 'HTTP 回调'
+ }
+ return map[String(value)] || String(value || '—')
+}
+
+export function directionLabel(value) {
+ const text = String(value || '').toUpperCase()
+ if (text === 'INBOUND') return '收到'
+ if (text === 'OUTBOUND') return '发出'
+ return value || '—'
+}
+
+export function typeLabel(value) {
+ const text = String(value || '').toUpperCase()
+ const map = {
+ TEXT: '文字',
+ IMAGE: '图片',
+ FILE: '文件',
+ RECORD: '语音',
+ VOICE: '语音',
+ VIDEO: '视频',
+ FACE: '表情',
+ STICKER: '表情',
+ REPLY: '引用',
+ FORWARD: '合并转发',
+ CARD: '卡片',
+ JSON: '卡片',
+ UNKNOWN: '未知'
+ }
+ return map[text] || String(value || '—')
+}
diff --git a/frontend/src/views/AiView.vue b/frontend/src/views/AiView.vue
new file mode 100644
index 0000000..e34469e
--- /dev/null
+++ b/frontend/src/views/AiView.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ MOCK_NOTE }}
+
+
+
+
已启用服务商✦
+
{{ aiProviders.length }}
+
+
+
+
今日调用≡
+
{{ aiProviders.reduce((sum, item) => sum + item.todayCalls, 0) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ provider.name }}
+
+
+
+
协议{{ provider.protocol }}
+
模型{{ provider.model }}
+
今日调用{{ provider.todayCalls }}
+
预算使用{{ provider.budget }}%
+
最近测试{{ provider.test }}
+
+
+
+
+
+
+
+
+
+
+
+
模型能力声明
+ 服务商宣传能力不等同于项目已验证能力
+
+
+
+ | 能力 | 使用模型 | 说明 | 状态 | 操作 |
+
+
+ | {{ item.name }} |
+ {{ item.model }} |
+ {{ item.desc }} |
+ |
+ |
+
+
+
+
+
+
+
+
+
调用记录
+ 真实调用日志需后端 /ai/calls 接口
+
+
+
+ | 时间 | 能力 | 模型 | 耗时 | Token | 结果 |
+
+
+ | {{ call.time }} |
+ {{ call.capability }} |
+ {{ call.model }} |
+ {{ call.duration }} |
+ {{ call.tokens }} |
+ |
+
+
+
+
+
+
+
diff --git a/frontend/src/views/AutomationView.vue b/frontend/src/views/AutomationView.vue
new file mode 100644
index 0000000..9554a00
--- /dev/null
+++ b/frontend/src/views/AutomationView.vue
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ MOCK_NOTE }}
+
+
+
+
执行成功率%
+
{{ automationSummary.successRate }}%
+
+
+
+
已发布规则⌗
+
{{ automationRules.length }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | 规则 | 触发条件 | 版本 | 状态 | 成功率 | 最近执行 | 操作 |
+
+
+
+ | {{ rule.name }} |
+ {{ rule.trigger }} |
+ {{ rule.version }} |
+ |
+ {{ rule.successRate }} |
+ {{ rule.lastRun }} |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
节点编排 · 群消息智能分流
+
+
+
+
+ {{ node.kind }}
+ {{ node.title }}
+ {{ node.sub }}
+
+
+
节点位置与连线的编辑能力待后端提供规则草稿与版本接口后实现。
+
+
+
+
+
执行记录
+ 仅演示,真实执行记录后端未提供
+
+
+
+
+ | 任务 | 规则 | 开始时间 | 耗时 | 节点结果 | 状态 | 操作 |
+
+
+
+ | {{ run.id }} |
+ {{ run.rule }} |
+ {{ run.startedAt }} |
+ {{ run.duration }} |
+ {{ run.node }} |
+ |
+ |
+
+
+
+
+
+
+
diff --git a/frontend/src/views/BackupView.vue b/frontend/src/views/BackupView.vue
new file mode 100644
index 0000000..5c0d4a7
--- /dev/null
+++ b/frontend/src/views/BackupView.vue
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ MOCK_NOTE }}
+
+
+
+
备份策略⛁
+
{{ backupPlans.length }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
备份策略
+
+
+
+
+ | 策略 | 范围 | 计划 | 保留 | 状态 | 操作 |
+
+
+ | {{ plan.name }} |
+ {{ plan.scope }} |
+ {{ plan.schedule }} |
+ {{ plan.retention }} |
+ |
+ |
+
+
+
+
+
+
+
+
+
备份记录
+
+
+
+
+ | 时间 | 范围 | 方式 | 大小 | 校验 | 操作 |
+
+
+ | {{ record.time }} |
+ {{ record.scope }} |
+ {{ record.type }} |
+ {{ record.size }} |
+ |
+ |
+
+
+
+
+
+
+
diff --git a/frontend/src/views/BindingsView.vue b/frontend/src/views/BindingsView.vue
deleted file mode 100644
index 5adabe8..0000000
--- a/frontend/src/views/BindingsView.vue
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
新增 NapCat 绑定
-
- 采用正向 WebSocket:QLinker 主动连接 NapCat 的事件上报地址。同一 NapCat 实例最多保留一条有效绑定。
-
-
-
{{ notice }}
-
-
-
-
-
绑定列表
-
-
-
{{ error }}
-
-
- | 名称 | 地址 | 绑定状态 | 连接状态 | QQ 账号 | 凭据 | 操作 |
-
-
-
- | {{ row.displayName }} |
- {{ row.endpoint }} |
- {{ row.bindingStatus }} |
- {{ row.connectionStatus }} |
- {{ row.qqAccountId || '-' }} |
- {{ row.hasCredential ? '已保存' : '未设置' }} |
-
-
-
- |
-
- | 暂无绑定。 |
-
-
-
-
-
-
-
-
{{ rotateError }}
-
-
-
diff --git a/frontend/src/views/BootstrapView.vue b/frontend/src/views/BootstrapView.vue
index 5e70e7f..28cf0c8 100644
--- a/frontend/src/views/BootstrapView.vue
+++ b/frontend/src/views/BootstrapView.vue
@@ -1,37 +1,89 @@
-
-
首次初始化:创建唯一管理员
-
- 本实例已存在管理员,引导流程已永久关闭。请直接登录。
+
+
+
FIRST RUN
+
初始化管理员
+
首次启动专用。创建第一个管理员后,引导入口会永久关闭。
+
+
+
+
+
管理员已创建
+
{{ success.message }}
+
+ 引导令牌已永久失效。请使用刚创建的管理员用户名与口令登录管理台。
+
+
+
前往登录
+
+
+
+
+
+ 正在读取初始化状态…
+
+
+
+
+
{{ statusError.title }}
+
{{ statusError.message }}
+
{{ statusError.hint }}
+
+
+
+
+
+
+
+
实例已完成初始化
+
已存在管理员,引导入口已永久关闭,无法再次创建管理员。
+
请返回登录页使用已有账号登录。
+
+
返回登录
+
+
+
+
+
当前没有有效的引导令牌
+
+ 实例尚未创建管理员,但引导令牌未签发或已失效,本页不会接受初始化请求。
+
+
+ 请查看实例启动日志或部署配置获取引导令牌,必要时按初始化流程重新签发后再刷新本页。
+
+
+
+
+
+
+
+
实例需要恢复
+
{{ recoveryMessage }}
+
+ 请先核实数据库与对象存储身份,不要在未确认的情况下重新初始化,以免旧数据被遗弃。
+
+
+
+
+
+
+
1从实例启动日志或部署配置中获取一次性引导令牌。
+
2设置管理员用户名与至少 12 位口令,口令需再次确认。
+
3创建成功后令牌永久失效,返回登录页使用新账号登录。
+
+
+
+
+
{{ submitError.title }}
+
{{ submitError.message }}
+
{{ submitError.hint }}
+
+
+
+
+
+
+
+
+
+
+ 引导入口只允许创建第一个管理员;任何情况下都不应把真实引导令牌写入代码、日志或公开文档。
+ 返回登录
-
- 当前没有有效引导令牌。请查看后端启动日志中的「首次初始化引导令牌」。
-
-
- 引导令牌只输出一次且不可找回;创建管理员后令牌立即失效,无法再次创建管理员。
-
-
-
返回登录
diff --git a/frontend/src/views/ConnectionsView.vue b/frontend/src/views/ConnectionsView.vue
new file mode 100644
index 0000000..c05721c
--- /dev/null
+++ b/frontend/src/views/ConnectionsView.vue
@@ -0,0 +1,324 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
绑定总数⇄
+
{{ items.length }}
+
+
+
+
在线连接◉
+
{{ online }}
+
+
+
+
+
+
+
+ 绑定只支持正向 WebSocket(accessType 固定 forward_websocket)。QQ 账号、NapCat 版本、最近事件由 NapCat 上报后回填,未上报时显示「—」。
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | 绑定 / 实例 |
+ QQ 账号 |
+ 连接 |
+ 状态 |
+ NapCat 版本 |
+ 最近事件 |
+ 最近错误 |
+ 操作 |
+
+
+
+
+
+
+ {{ (item.displayName || 'N').slice(0, 1) }}
+
+ {{ item.displayName || '—' }}
+ {{ item.endpoint || '—' }}
+
+
+ |
+ {{ item.qqAccountId || '—' }} |
+
+ {{ connectionLabel(item.connectionType) }}
+ 令牌{{ item.hasCredential ? '已保存' : '未保存' }}
+ |
+
+
+
+ |
+ {{ item.napcatVersion || '—' }} |
+ {{ formatTime(item.lastEventAt) }} |
+
+ {{ item.lastErrorCode }}
+ —
+ {{ formatTime(item.lastErrorAt) }}
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
新增 NapCat 绑定
+
+
+
+
+
{{ createError.title }}
+
{{ createError.message }}
+
{{ createError.hint }}
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ rotateError.message }}
+
+
+
+
+ {{ removeError.message }}
+
+
+
+
+
绑定标识{{ detail.bindingUid }}
+
实例标识{{ detail.instanceUid || '—' }}
+
显示名称{{ detail.displayName || '—' }}
+
连接方式{{ connectionLabel(detail.connectionType) }}
+
端点{{ detail.endpoint || '—' }}
+
绑定状态{{ detail.bindingStatus || '—' }}
+
连接状态{{ detail.connectionStatus || '—' }}
+
QQ 账号{{ detail.qqAccountId || '—' }}
+
NapCat 版本{{ detail.napcatVersion || '—' }}
+
令牌{{ detail.hasCredential ? '已保存' : '未保存' }}
+
最近连接{{ formatTime(detail.lastConnectedAt) }}
+
最近事件{{ formatTime(detail.lastEventAt) }}
+
最近错误{{ detail.lastErrorCode || '—' }} · {{ formatTime(detail.lastErrorAt) }}
+
+
+
diff --git a/frontend/src/views/DashboardView.vue b/frontend/src/views/DashboardView.vue
new file mode 100644
index 0000000..6b5a76f
--- /dev/null
+++ b/frontend/src/views/DashboardView.vue
@@ -0,0 +1,251 @@
+
+
+
+
+
+
+ 接入管理
+
+
+
+
+
+
{{ error.title }}
+
{{ error.message }}
+
{{ error.hint }}
+
+ 错误码 {{ error.code }} · 请求 {{ error.requestId }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
接入实例状态
+ 管理绑定
+
+
暂无绑定。前往「接入管理」新增 NapCat 正向 WebSocket 连接。
+
+
+
+
+ | 绑定 / 实例 |
+ QQ 账号 |
+ 连接方式 |
+ 状态 |
+ 最近事件 |
+ 今日消息 |
+
+
+
+
+
+
+ {{ (item.displayName || 'N').slice(0, 1) }}
+
+ {{ item.displayName || '—' }}
+ {{ item.endpoint || '—' }}
+
+
+ |
+ {{ item.qqAccountId || '—' }} |
+ {{ connectionLabel(item.connectionType) }} |
+
+
+ {{ item.connectionStatus || '—' }}
+ |
+ {{ formatTime(item.lastEventAt) }} |
+ — |
+
+
+
+
+
+
+
+
+
运行提醒
+ 后端真实状态
+
+
+
暂无异常
+
失败事件、待处理事件、发送结果未知与媒体异常均为 0。
+
+
+
{{ item.level === 'error' ? '!' : 'i' }}
+
+
{{ item.title }}
+
{{ item.detail }}
+
+
+
+
+
+
+
+
+
+
消息趋势(近 24 小时)
+ 演示
+
+
+
+
+
0:006:0012:0018:0024:00
+
后端 /messages/stats 只提供累计计数,暂无时间序列接口。
+
+
+
+
+
自动化概览
+ 查看规则
+
+
+
%
+
+
成功率 {{ automationSummary.successRate }}%
+
成功 {{ automationSummary.success }} · 失败 {{ automationSummary.failed }} · 最近执行「{{ automationSummary.recent }}」
+
+
+
+ {{ rule.name }}
+ {{ rule.version }} · {{ rule.status }}
+
+
+
+
+
+ 演示数据已关闭:消息趋势与自动化概览依赖的后端接口尚未提供,相关区块不显示。
+
+
+
+
+
快捷入口
+ 数据更新于 {{ updatedAt }}
+
+
+
+ 消息中心◫
+ 查看会话与详情
+
+
+
+ 消息检索⌕
+ 条件筛选与分页
+
+
+
+ 运维监控◉
+ 依赖健康总览
+
+
+
+ 系统设置◌
+ 外观与演示开关
+
+
+
+
+
diff --git a/frontend/src/views/LoginView.vue b/frontend/src/views/LoginView.vue
index 035f1c9..395c9c8 100644
--- a/frontend/src/views/LoginView.vue
+++ b/frontend/src/views/LoginView.vue
@@ -1,35 +1,69 @@
-
-
登录
-
无法读取实例状态:{{ statusError }}
-
- 本实例尚未创建管理员,需要先使用启动日志中的引导令牌完成初始化。
- 前往初始化
+
+
+
QLINKER ADMIN
+
登录管理台
+
单管理员实例。登录后可查看消息、管理连接、执行受控发送。
+
+
+
+
+ 正在读取实例状态…
+
+
+
+
+
{{ statusError.title }}
+
{{ statusError.message }}
+
{{ statusError.hint }}
+
+
+
+
+
+
+
+
实例需要恢复
+
{{ recoveryMessage }}
+
+ 请先按部署文档核实数据库与对象存储身份,不要在未确认的情况下重新初始化。
+
+
+
+
+
+
+
实例尚未初始化
+
尚未创建管理员,当前无法登录管理台。
+
{{ bootstrapHint }}
+
+
+ {{ status.bootstrapTokenActive ? '前往初始化' : '查看初始化页' }}
+
+
+
+
+
+
引导入口仍然开放
+
实例已存在管理员,但引导令牌仍处于有效状态。
+
+ 首次初始化完成后引导入口应永久关闭;如非预期,请检查实例配置。
+
+
+
-
- 实例尚未初始化,且当前没有有效引导令牌。请检查后端启动日志或实例状态。
- {{ status.recoveryRequired }}
-
-
+
+
+ 管理员创建完成后,本页的登录表单才会开放。
+ 前往初始化
+
diff --git a/frontend/src/views/LogsView.vue b/frontend/src/views/LogsView.vue
new file mode 100644
index 0000000..57117a5
--- /dev/null
+++ b/frontend/src/views/LogsView.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ MOCK_NOTE }}
+
+
+
+
日志条数≡
+
{{ logRows.length }}
+
+
+
+
错误!
+
{{ errorCount }}
+
+
+
+
警告△
+
{{ warnCount }}
+
+
+
+
+
+
+
+
日志检索
+ 本地筛选仅作用于演示样本
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | 时间 | 级别 | 来源 | 摘要 | 追踪号 | 耗时 | 操作 |
+
+
+ | {{ row.time }} |
+ |
+ {{ row.source }} |
+ {{ row.summary }} |
+ {{ row.trace }} |
+ {{ row.cost }} |
+ |
+
+
+
+
+
没有匹配的演示日志。
+
按用户确认,日志页不再显示「检索延迟 86ms」等无法由后端验证的指标。
+
+
+
diff --git a/frontend/src/views/MessageSearchView.vue b/frontend/src/views/MessageSearchView.vue
new file mode 100644
index 0000000..26ce576
--- /dev/null
+++ b/frontend/src/views/MessageSearchView.vue
@@ -0,0 +1,408 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
检索条件
+ 时间按浏览器本地输入,提交时转换为 ISO-8601 UTC
+
+
+
+
+
+
+
当前生效条件
+
{{ appliedList.join(' · ') }}
+
没有匹配的消息,可清除部分条件后重试。
+
+
+
+
+
+
+
检索结果
+ 分页按后端 PageData:items / page / pageSize / total
+
+
+
+
+
+
+
+
+
+
+
+
+ | 消息时间 |
+ 会话 |
+ 发送者 |
+ 方向 |
+ 类型 |
+ 摘要 |
+ 段 / 媒体 |
+ 处理状态 |
+ 操作 |
+
+
+
+
+ | {{ formatTime(row.messageTime) }} |
+ {{ row.conversationType }} · {{ row.conversationId }} |
+ {{ row.senderName || '—' }} {{ row.senderId || '—' }} |
+ {{ directionLabel(row.direction) }} |
+ {{ typeLabel(row.messageType) }} {{ row.messageType }} |
+ {{ row.summary || '(无摘要)' }} |
+ {{ row.segmentCount }} / {{ row.mediaCount }} |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+ 正在读取消息详情…
+
+
+
{{ detailError.title }}
+
{{ detailError.message }}
+
{{ detailError.hint }}
+
+
+
+
+
基本信息
+
+
消息标识{{ detail.message?.messageUid }}
+
来源绑定{{ detail.message?.bindingUid || '—' }}
+
会话{{ detail.message?.conversationType }} · {{ detail.message?.conversationId }}
+
发送者{{ detail.message?.senderName || '—' }} ({{ detail.message?.senderId || '—' }})
+
方向 / 类型{{ directionLabel(detail.message?.direction) }} · {{ typeLabel(detail.message?.messageType) }}
+
消息时间{{ formatTime(detail.message?.messageTime) }}
+
归一化状态
+
段 / 媒体{{ detail.message?.segmentCount }} / {{ detail.message?.mediaCount }}
+
上游消息 ID{{ detail.message?.sourceMessageId || '—' }}
+
原始事件{{ detail.rawEventUid || '—' }} · {{ detail.rawEventType || '—' }}
+
+
+
+
+
消息段
+
该消息没有保存任何消息段。
+
+
+ #{{ segment.index }} · {{ typeLabel(segment.type) }} ({{ segment.type }})
+
+
+
{{ segment.content || '—' }}
+
+
+
{{ segment.mediaUid }}
+
正在获取预签名地址…
+
+ {{ mediaMap[segment.mediaUid].error.message }}
+
+
+
![消息媒体预览]()
+
打开媒体地址
+
地址为短时效预签名地址,过期后需重新获取。
+
+
+
+
+
+
+
原始事件 payload
+
{{ prettyRaw(detail.rawPayload) }}
+
+
+
+
发送记录
+
+ 后端未提供「按消息反查发送操作」接口。方向筛选为 OUTBOUND 的消息即管理台/规则发出的记录;
+ 发送操作的状态、错误码与尝试次数在 /api/v1/send/operations 中查看。
+
+
+
+
+
diff --git a/frontend/src/views/MessagesView.vue b/frontend/src/views/MessagesView.vue
index 4256b05..33c22e3 100644
--- a/frontend/src/views/MessagesView.vue
+++ b/frontend/src/views/MessagesView.vue
@@ -1,145 +1,434 @@
-
-
-
消息查询
-
-
-
-
-
-
-
-
{{ error }}
-
共 {{ data.total }} 条,第 {{ data.page }} 页(每页 {{ data.pageSize }} 条)。
-
-
- | 时间 | 会话 | 方向 | 发送者 | 摘要 | 段/媒体 | 解析 |
-
-
-
- | {{ row.messageTime }} |
- {{ row.conversationType }}:{{ row.conversationId }} |
- {{ row.direction }} |
- {{ row.senderName || row.senderId || '-' }} |
- {{ row.summary }} |
- {{ row.segmentCount }} / {{ row.mediaCount }} |
- {{ row.normalizedStatus }} |
-
- | 没有符合条件的消息。 |
-
-
-
-
-
-
-
+
+
+
+ 消息检索
+
+
-
详情加载中…
-
-
-
消息详情 {{ detail.message.messageUid }}
-
- 会话 {{ detail.message.conversationType }}:{{ detail.message.conversationId }},
- 来源事件 {{ detail.rawEventUid || '-' }}({{ detail.rawEventType || '-' }})
-
-
- | # | 类型 | 状态 | 内容 | 媒体 |
-
-
- | {{ seg.index }} |
- {{ seg.type }} |
- {{ seg.status }} |
- {{ seg.content || '-' }} |
-
-
- -
- |
-
-
-
-
临时访问地址:{{ accessUrl }}
-
{{ accessError }}
-
原始事件
-
{{ detail.rawPayload }}
+
+
+ 前往接入管理
+
+
+
+
+
+
+ 请选择左侧会话查看消息。
+
+
+
+
+
+
+
+
{{ row.summary || '(无摘要)' }}
+
+ {{ formatShortTime(row.messageTime) }} · {{ directionLabel(row.direction) }} · {{ typeLabel(row.messageType) }}
+ · 段 {{ row.segmentCount }} · 媒体 {{ row.mediaCount }}
+
+
+
+
+
+
+
+
+
+
+
{{ prepareError.title }}
+
{{ prepareError.message }}
+
{{ prepareError.hint }}
+
+
+
+
+
+
发送操作 {{ lastResult.status }}
+
操作 {{ lastResult.operationUid }} · 尝试 {{ lastResult.attemptCount }} 次
+
{{ lastResult.errorCode }} {{ lastResult.errorMessage }}
+
上游可能已执行且本地未收到确认:禁止自动重试,请人工核实后再决定。
+
+
+
+
+ 当前会话缺少绑定信息,无法确定发送账号;请先确认消息来源绑定。
+
+
+
+
+
+
+
-
+
+
+
+
+
+
待发送内容
+
{{ pending.text || text }}
+
操作 {{ pending.operationUid }}
+
+
+
+
+
{{ executeError.title }}
+
{{ executeError.message }}
+
{{ executeError.hint }}
+
+
+
+
+
+ 正在读取消息详情…
+
+
+
{{ detailError.title }}
+
{{ detailError.message }}
+
{{ detailError.hint }}
+
+
+
+
+
基本信息
+
+
消息标识{{ detail.message?.messageUid }}
+
来源绑定{{ detail.message?.bindingUid || '—' }}
+
会话{{ detail.message?.conversationType }} · {{ detail.message?.conversationId }}
+
发送者{{ detail.message?.senderName || '—' }} ({{ detail.message?.senderId || '—' }})
+
方向 / 类型{{ directionLabel(detail.message?.direction) }} · {{ typeLabel(detail.message?.messageType) }}
+
消息时间{{ formatTime(detail.message?.messageTime) }}
+
归一化状态
+
段 / 媒体{{ detail.message?.segmentCount }} / {{ detail.message?.mediaCount }}
+
上游消息 ID{{ detail.message?.sourceMessageId || '—' }}
+
原始事件{{ detail.rawEventUid || '—' }} · {{ detail.rawEventType || '—' }}
+
+
+
+
+
消息段
+
该消息没有保存任何消息段。
+
+
+ #{{ segment.index }} · {{ typeLabel(segment.type) }} ({{ segment.type }})
+
+
+
{{ segment.content || '—' }}
+
+
+
{{ segment.mediaUid }}
+
正在获取预签名地址…
+
+ {{ mediaMap[segment.mediaUid].error.message }}
+
+
+
![消息媒体预览]()
+
打开媒体地址
+
地址为短时效预签名地址,过期后需重新获取。
+
+
+
+
+
+
+
原始事件 payload
+
{{ prettyRaw(detail.rawPayload) }}
+
+
+
+
媒体与发送记录
+
媒体通过 /api/v1/media/{uid}/access-url 按需获取;后端未提供按消息反查发送记录,发送记录请使用「消息检索」的方向筛选查看出站消息与发送操作列表。
+
在消息检索中查看
+
+
+
diff --git a/frontend/src/views/OpsView.vue b/frontend/src/views/OpsView.vue
new file mode 100644
index 0000000..ea154d2
--- /dev/null
+++ b/frontend/src/views/OpsView.vue
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
应用进程◉
+
{{ health?.application || '—' }}
+
+
+
+
NapCat 受管连接⇄
+
{{ health ? formatNumber(health.napcat?.connections?.managedConnections) : '—' }}
+
+
+
+
消息失败 / 待处理≡
+
{{ health ? `${formatNumber(health.messages?.failedEvents)} / ${formatNumber(health.messages?.unprocessedEvents)}` : '—' }}
+
+
+
+
发送结果未知➤
+
{{ health ? formatNumber(health.send?.UNKNOWN) : '—' }}
+
+
+
+
+
+
+
+
健康总览
+ 最近事件已并入本表,不另设独立列表
+
+
+
+ | 依赖项 | 状态 | 说明 | 最近事件 |
+
+
+ | {{ row.name }} |
+ |
+ {{ row.detail }} |
+ {{ row.at }} |
+
+
+
+
+
+
+
+
+ 以下主机资源与告警为演示数据,仅用于界面预览;后端未提供对应接口。
+
+
+
主机资源
演示
+
+
{{ item.name }}{{ item.value }}
+
+
+
CPU / 内存 / 磁盘使用率需后端主机监控接口。
+
+
+
告警
演示
+
+
!
+
+
{{ alert.title }}
+
{{ alert.time }} · {{ alert.status }}
+
+
+
+
+
+
+
+
+ 演示数据已关闭:主机资源与告警区块依赖的后端接口尚未提供,因此不显示。
+
diff --git a/frontend/src/views/OverviewView.vue b/frontend/src/views/OverviewView.vue
deleted file mode 100644
index e414a9a..0000000
--- a/frontend/src/views/OverviewView.vue
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
系统总览
-
-
-
{{ error }}
-
暂无数据。
-
-
-
-
-
实例与依赖
-
-
{{ detail.instance || '-' }}
实例标识
-
{{ detail.napcat?.total ?? '-' }}
NapCat 绑定数
-
{{ detail.messages?.totalMessages ?? '-' }}
已入库消息
-
{{ detail.messages?.unprocessedEvents ?? '-' }}
待处理事件
-
-
- 事件处理失败 {{ detail.messages?.failedEvents ?? 0 }} 条,未知类型事件 {{ detail.messages?.unknownTypeEvents ?? 0 }} 条。
- 未知类型不会被丢弃,但也不会被强行归一化为已知消息。
-
-
-
-
-
NapCat 连接状态
-
在线状态以收到 lifecycle 或有效事件为准,握手成功不代表在线。
-
-
- | 绑定 | 绑定状态 | 连接状态 | QQ 账号 | 最近事件 | 最近错误 |
-
-
-
- | {{ item.displayName || item.bindingUid }} |
- {{ item.bindingStatus }} |
- {{ item.connectionStatus }} |
- {{ item.qqAccountId || '-' }} |
- {{ item.lastEventAt || '-' }} |
- {{ item.lastErrorCode || '-' }} |
-
-
- | 尚未绑定 NapCat 实例。 |
-
-
-
-
-
-
-
媒体与发送
-
-
{{ detail.media?.STORED ?? 0 }}
媒体已入库
-
{{ detail.media?.FAILED ?? 0 }}
媒体下载失败
-
{{ detail.media?.SOURCE_EXPIRED ?? 0 }}
媒体源已过期
-
{{ detail.send?.SUCCEEDED ?? 0 }}
发送成功
-
{{ detail.send?.UNKNOWN ?? 0 }}
发送结果未知
-
{{ detail.send?.FAILED ?? 0 }}
发送失败
-
-
「结果未知」表示上游可能已执行但本地未收到确认,不会自动重试,需要人工核实。
-
-
-
-
diff --git a/frontend/src/views/SecurityView.vue b/frontend/src/views/SecurityView.vue
new file mode 100644
index 0000000..408548b
--- /dev/null
+++ b/frontend/src/views/SecurityView.vue
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
当前会话(真实)
+ /auth/me
+
+
+
+
账号{{ me.username || '—' }}
+
显示名称{{ me.displayName || '—' }}
+
用户标识{{ me.userId || '—' }}
+
管理员{{ me.hasAdministrator ? '是' : '否' }}
+
权限{{ permissions.length ? permissions.join('、') : '—' }}
+
+
+
+
+
+
+
+ {{ MOCK_NOTE }}
+
+
+
+
+
+
+
+
+
+
用户
演示数据
+
+
+ | 姓名 | 账号 | 角色 | 状态 | 最近登录 | 操作 |
+
+
+ | {{ user.name }} |
+ {{ user.account }} |
+ {{ user.role }} |
+ |
+ {{ user.lastLogin }} |
+ |
+
+
+
+
+
+
+
+
角色
演示数据
+
+
+ | 角色 | 成员 | 授权范围 | 最近变更 | 操作 |
+
+
+ | {{ role.name }} |
+ {{ role.members }} |
+ {{ role.scope }} |
+ {{ role.changed }} |
+ |
+
+
+
+
+
+
+
+
API 令牌
演示数据
+
+
+ | 名称 | 授权范围 | 到期 | 状态 | 操作 |
+
+
+ | {{ token.name }} |
+ {{ token.scope }} |
+ {{ token.expires }} |
+ |
+ |
+
+
+
+
+
+
+
+
高风险审批
演示数据
+
+
+ | 申请内容 | 提交人 | 时间 | 风险 | 操作 |
+
+
+ | {{ item.title }} |
+ {{ item.submitter }} |
+ {{ item.time }} |
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
diff --git a/frontend/src/views/SendView.vue b/frontend/src/views/SendView.vue
deleted file mode 100644
index 1a7bbaf..0000000
--- a/frontend/src/views/SendView.vue
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
-
-
发送文本消息(两阶段确认)
-
第一步只创建发送操作,不产生任何外部副作用;第二步携带确认令牌才真正调用 NapCat。
-
-
-
-
-
-
-
-
-
-
-
-
- 即将向 {{ prepared.targetSummary }} 发送消息。确认令牌有效期很短,过期后需要重新创建操作。
-
- {{ form.text }}
-
-
-
-
-
-
{{ notice }}
-
{{ error }}
-
-
-
-
发送操作记录
-
- 待发送 {{ summary.PENDING ?? 0 }},发送中 {{ summary.RUNNING ?? 0 }},成功 {{ summary.SUCCEEDED ?? 0 }},
- 失败 {{ summary.FAILED ?? 0 }},结果未知 {{ summary.UNKNOWN ?? 0 }}
-
-
-
- | 操作号 | 目标 | 状态 | 尝试 | 错误 | 创建时间 | 完成时间 |
-
-
-
- | {{ op.operationUid }} |
- {{ op.targetType }}:{{ op.targetId }} |
- {{ op.status }} |
- {{ op.attemptCount }} |
- {{ op.errorCode || '-' }} |
- {{ op.createdAt }} |
- {{ op.finishedAt || '-' }} |
-
- | 暂无发送操作。 |
-
-
-
-
-
diff --git a/frontend/src/views/SettingsView.vue b/frontend/src/views/SettingsView.vue
new file mode 100644
index 0000000..dbcb27f
--- /dev/null
+++ b/frontend/src/views/SettingsView.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
实例信息
+ 后端真实
+
+
{{ instanceError }}
+
+
实例标识{{ instance?.instanceUid || '—' }}
+
初始化状态{{ instance ? (instance.initialized ? '已初始化' : '未初始化') : '读取中…' }}
+
数据库{{ instance?.databaseName || '—' }}
+
对象存储 Bucket{{ instance?.bucketName || '—' }}
+
+
+
+
+
+
+
+
+
+
+
+
基础配置
后端未提供实例设置接口
+
+
+
+
+
依赖:{{ PLANNED_DEPS.settings.join('、') }}
+
+
+
+
通知
演示数据
+
实时事件提醒{{ settingsValues.realtime ? '开启' : '关闭' }}
+
移动端通知{{ settingsValues.mobileNotify ? '开启' : '关闭' }}
+
+
+
+
+
+
+
外观与预览
本地真实设置
+
主题{{ dark ? '深色' : '浅色' }}
+
+
+
+
+
主题保存在浏览器本地(localStorage),不写入后端配置。
+
+
+
演示数据总开关
+
+ 演示数据
+
+
+
{{ demoState.enabled ? MOCK_NOTE : '演示数据已关闭:所有未实现页面整体显示「未开发 / 规划中」,按钮保持禁用并标注原因。' }}
+
默认值由构建变量 VITE_ENABLE_MOCK 决定;本地切换会覆盖默认值并持久化。
+
+
+
+
+
数据与迁移
后端未提供迁移与容量接口
+
数据库迁移版本—
+
对象存储使用量—
+
日志保留策略7 天(演示)
+
+
+
+
+
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index 324e485..e399c26 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -1,9 +1,44 @@
+import fs from 'node:fs'
+import path from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
+// 浏览器会以 CORS 为由拒绝从 file:// 加载外部 module 脚本,
+// 因此构建结束后把唯一的 JS/CSS 内联进 index.html,让 dist/index.html 可以直接双击预览。
+// 这不会改变接口路径或运行逻辑;通过后端静态托管时同样可用。
+function inlineDistPlugin() {
+ let outDir = ''
+ return {
+ name: 'qlinker-inline-dist',
+ apply: 'build',
+ configResolved(config) {
+ outDir = path.resolve(config.root, config.build.outDir)
+ },
+ closeBundle() {
+ const htmlPath = path.join(outDir, 'index.html')
+ if (!fs.existsSync(htmlPath)) return
+ let html = fs.readFileSync(htmlPath, 'utf8')
+ html = html.replace(/`
+ })
+ html = html.replace(/
]*rel="stylesheet"[^>]*href="\.\/([^"]+\.css)"[^>]*>/g, (match, href) => {
+ const css = fs.readFileSync(path.join(outDir, href), 'utf8').replace(/<\/style/gi, '<\\/style')
+ return ``
+ })
+ fs.writeFileSync(htmlPath, html, 'utf8')
+ console.log('[qlinker] JS/CSS 已内联到 dist/index.html,可直接双击打开做静态预览')
+ }
+ }
+}
+
// 开发期通过代理访问后端,避免在生产配置里写死后端地址。
export default defineConfig({
- plugins: [vue()],
+ plugins: [vue(), inlineDistPlugin()],
+ // 相对 base:dist 资源使用 ./assets 前缀,可直接双击 dist/index.html 预览。
+ base: './',
server: {
port: 5173,
proxy: {
@@ -12,5 +47,15 @@ export default defineConfig({
changeOrigin: true
}
}
+ },
+ // 预览构建产物时同样把 /api 转发到本地后端,便于在 4173 上做真实联调。
+ preview: {
+ port: 4173,
+ proxy: {
+ '/api': {
+ target: 'http://127.0.0.1:8080',
+ changeOrigin: true
+ }
+ }
}
})