-
WeCom Middleware 管理界面
-
企业微信与OpenClaw双向通信中间件
-
-
后端状态: 运行中
-
数据库: 已连接
-
Redis: 已连接
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 01433bc..3eb9057 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -1,4 +1,27 @@
import { createApp } from 'vue'
+import ElementPlus from 'element-plus'
+import 'element-plus/dist/index.css'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
+import router from './router'
+import { createPinia } from 'pinia'
-createApp(App).mount('#app')
+// 创建Vue应用
+const app = createApp(App)
+
+// 注册Element Plus
+app.use(ElementPlus)
+
+// 注册路由
+app.use(router)
+
+// 注册状态管理
+app.use(createPinia())
+
+// 注册所有图标
+for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+ app.component(key, component)
+}
+
+// 挂载应用
+app.mount('#app')
\ No newline at end of file
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
new file mode 100644
index 0000000..c996039
--- /dev/null
+++ b/frontend/src/router/index.ts
@@ -0,0 +1,61 @@
+import { createRouter, createWebHistory } from 'vue-router'
+
+const routes = [
+ {
+ path: '/',
+ name: 'Dashboard',
+ component: () => import('@/views/Dashboard.vue'),
+ meta: { title: '仪表盘' }
+ },
+ {
+ path: '/wecom/bots',
+ name: 'WeComBots',
+ component: () => import('@/views/wecom/Bots.vue'),
+ meta: { title: '企业微信Bot管理' }
+ },
+ {
+ path: '/wecom/messages',
+ name: 'WeComMessages',
+ component: () => import('@/views/wecom/Messages.vue'),
+ meta: { title: '消息记录' }
+ },
+ {
+ path: '/openclaw/pairing',
+ name: 'OpenClawPairing',
+ component: () => import('@/views/openclaw/Pairing.vue'),
+ meta: { title: 'OpenClaw配对管理' }
+ },
+ {
+ path: '/openclaw/rules',
+ name: 'OpenClawRules',
+ component: () => import('@/views/openclaw/Rules.vue'),
+ meta: { title: '配对规则配置' }
+ },
+ {
+ path: '/system/config',
+ name: 'SystemConfig',
+ component: () => import('@/views/system/Config.vue'),
+ meta: { title: '系统配置' }
+ },
+ {
+ path: '/system/logs',
+ name: 'SystemLogs',
+ component: () => import('@/views/system/Logs.vue'),
+ meta: { title: '操作日志' }
+ }
+]
+
+const router = createRouter({
+ history: createWebHistory(),
+ routes
+})
+
+// 路由守卫 - 设置页面标题
+router.beforeEach((to, from, next) => {
+ if (to.meta.title) {
+ document.title = `${to.meta.title} - WeCom Middleware`
+ }
+ next()
+})
+
+export default router
\ No newline at end of file
diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue
new file mode 100644
index 0000000..1ea02d1
--- /dev/null
+++ b/frontend/src/views/Dashboard.vue
@@ -0,0 +1,287 @@
+
+
+
+
+
+
+
+
+
+
+
+
{{ stats.wecomBots }}
+
企业微信Bot
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ stats.openclawNodes }}
+
OpenClaw节点
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ stats.todayMessages }}
+
今日消息
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ stats.pendingRequests }}
+
待处理
+
+
+
+
+
+
+
+
+
+
+
+ 服务状态
+
+
+
+
{{ service.name }}
+
+
+ {{ service.status }}
+
+ {{ service.port }}
+
+
+
+
+
+
+
+
+
+ 快速操作
+
+
+
+
+ 添加企业微信Bot
+
+
+
+ 管理配对请求
+
+
+
+ 数据库管理 (Adminer)
+
+
+
+ 系统配置
+
+
+
+
+
+
+
+
+
+
+
+ 最近活动
+
+
+
+ {{ activity.content }}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/openclaw/Pairing.vue b/frontend/src/views/openclaw/Pairing.vue
new file mode 100644
index 0000000..baeb8b4
--- /dev/null
+++ b/frontend/src/views/openclaw/Pairing.vue
@@ -0,0 +1,378 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.nodeType }}
+
+
+
+
+
+ {{ getStatusText(scope.row.status) }}
+
+
+
+
+
+
+
+
+
+ 批准
+
+
+ 拒绝
+
+
+ 断开
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ currentPairing?.nodeId }}
+ {{ currentPairing?.nodeName }}
+ {{ currentPairing?.nodeType }}
+ {{ currentPairing?.nodeIp }}
+ {{ currentPairing?.nodeVersion }}
+ {{ currentPairing?.requestTime }}
+
+
+ {{ getStatusText(currentPairing?.status || '') }}
+
+
+
+ {{ currentPairing?.remark || '无' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/openclaw/Rules.vue b/frontend/src/views/openclaw/Rules.vue
new file mode 100644
index 0000000..5c03867
--- /dev/null
+++ b/frontend/src/views/openclaw/Rules.vue
@@ -0,0 +1,414 @@
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.priority }}
+
+
+
+
+ {{ getConditionTypeText(scope.row.conditionType) }}
+
+
+
+
+
+
+ {{ scope.row.action === 'approve' ? '自动批准' : '自动拒绝' }}
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 数字越小优先级越高
+
+
+
+
+
+
+
+
+
+
+
+
+ IP地址示例: 192.168.1.*
+ 主机名示例: *.example.com
+ 节点类型: development/testing/production
+
+
+
+
+ 自动批准
+ 自动拒绝
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/system/Config.vue b/frontend/src/views/system/Config.vue
new file mode 100644
index 0000000..0bd7d64
--- /dev/null
+++ b/frontend/src/views/system/Config.vue
@@ -0,0 +1,397 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 连接超时时间(毫秒)
+
+
+
+
+
+
+
+
+
+
+ http://localhost:18080
+
+
+ http://localhost:13000
+
+
+ localhost:13306
+
+ 用户: wecom
+ 数据库: wecom_middleware
+
+
+
+ localhost:16379
+
+ 密码: redis123456
+
+
+
+
+ http://localhost:18081
+
+
+ 数据库管理工具
+
+
+
+
+
+
连接测试
+
+
+
+ 测试数据库连接
+
+
+
+ 测试Redis连接
+
+
+
+ 测试后端API
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/system/Logs.vue b/frontend/src/views/system/Logs.vue
new file mode 100644
index 0000000..4ac951b
--- /dev/null
+++ b/frontend/src/views/system/Logs.vue
@@ -0,0 +1,440 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.level }}
+
+
+
+
+
+
+ {{ getModuleText(scope.row.module) }}
+
+
+
+
+
+
+
+
+ {{ scope.row.description }}
+
+
+
+
+
+
+
+ 详情
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ currentLog.id }}
+ {{ currentLog.timestamp }}
+
+
+ {{ currentLog.level }}
+
+
+
+
+ {{ getModuleText(currentLog.module) }}
+
+
+ {{ currentLog.operator }}
+ {{ currentLog.ip }}
+ {{ currentLog.action }}
+ {{ currentLog.userAgent || 'N/A' }}
+
+
+ {{ currentLog.description }}
+
+
+
+ {{ formatJson(currentLog.requestParams) }}
+
+
+ {{ formatJson(currentLog.responseResult) }}
+
+
+
+ {{ currentLog.error }}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/wecom/Bots.vue b/frontend/src/views/wecom/Bots.vue
new file mode 100644
index 0000000..7a90c04
--- /dev/null
+++ b/frontend/src/views/wecom/Bots.vue
@@ -0,0 +1,381 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.status === 'online' ? '在线' : '离线' }}
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/wecom/Messages.vue b/frontend/src/views/wecom/Messages.vue
new file mode 100644
index 0000000..31d33dd
--- /dev/null
+++ b/frontend/src/views/wecom/Messages.vue
@@ -0,0 +1,386 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
new file mode 100644
index 0000000..c024b95
--- /dev/null
+++ b/frontend/tsconfig.json
@@ -0,0 +1,31 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "jsx": "preserve",
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true,
+
+ /* Paths */
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["src/*"]
+ }
+ },
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
+ "references": [{ "path": "./tsconfig.node.json" }]
+}
\ No newline at end of file
diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json
new file mode 100644
index 0000000..4eb43d0
--- /dev/null
+++ b/frontend/tsconfig.node.json
@@ -0,0 +1,11 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "allowSyntheticDefaultImports": true,
+ "strict": true
+ },
+ "include": ["vite.config.ts"]
+}
\ No newline at end of file
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 51deb09..9d37734 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -1,9 +1,35 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
+import { resolve } from 'path'
+// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
+ resolve: {
+ alias: {
+ '@': resolve(__dirname, 'src')
+ }
+ },
+ server: {
+ port: 3000,
+ host: true,
+ proxy: {
+ '/api': {
+ target: 'http://localhost:18080',
+ changeOrigin: true,
+ rewrite: (path) => path.replace(/^\/api/, '')
+ }
+ }
+ },
build: {
- outDir: 'dist'
+ outDir: 'dist',
+ sourcemap: false,
+ rollupOptions: {
+ output: {
+ chunkFileNames: 'js/[name]-[hash].js',
+ entryFileNames: 'js/[name]-[hash].js',
+ assetFileNames: '[ext]/[name]-[hash].[ext]'
+ }
+ }
}
-})
+})
\ No newline at end of file