From ad4c3757b94021e976bc50f32f3ce2f43a3d7724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=B8=E6=B8=8A=20ICE-GL-ZY001?= Date: Tue, 26 May 2026 03:10:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Awen=E6=8A=80=E6=9C=AF=E4=B8=BB?= =?UTF-8?q?=E6=8E=A7=E5=8F=B0=20=E2=80=94=20=E5=85=A814=E5=8F=B0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=80=BB=E8=A7=88+=E5=9F=9F=E5=88=86=E7=BB=84+?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 变更: - server.js v3.7: +HL-SG-001/HL-CN-001 (14台) + /api/tech-dashboard端点 - tech.html: Awen技术主控台独立前端(琥珀色主题) - 域分组: ice-core(冰朔8台) + awen-team(企业3) + awen-personal(Awen2) + yeye(页页1) - 权限标识: 冰朔侧只读,团队侧全权 - 操作日志按域标记+签到可视化 数据流: tech.html → /api/tech-dashboard → signinCache+opLogs 部署: guanghulab.com/console/tech (冰朔侧) + guanghuzhiqiu.top (Awen侧) --- _deploy/console-server/server.js | 133 +++++++++++++--- _deploy/console-server/tech.html | 259 +++++++++++++++++++++++++++++++ 2 files changed, 374 insertions(+), 18 deletions(-) create mode 100644 _deploy/console-server/tech.html diff --git a/_deploy/console-server/server.js b/_deploy/console-server/server.js index 836ce95..a9a04f8 100644 --- a/_deploy/console-server/server.js +++ b/_deploy/console-server/server.js @@ -1,8 +1,8 @@ -// # 光湖服务器主控台 API v3.6 -// # Guanghu Server Console v3.6 — 12台(冰6+企3+之2+页1) +// # 光湖服务器主控台 API v3.7 +// # Guanghu Server Console v3.7 — 14台(冰6+企3+之2+页1+Awen2) // # 部署: guanghulab.com/console/ · GZ-006:3920(主) + SG-001:3920(备) // # 版权: 国作登字-2026-A-00037559 · TCS-0002∞ -// # v3.6: 心跳改为人格体签到 — 唤醒签到一次,非定时监控 +// # v3.7: +Awen技术主控视图 /api/tech-dashboard + HL-SG-001/HL-CN-001 const express = require('express'); const http = require('http'); @@ -17,20 +17,25 @@ app.use(express.static(__dirname)); const DATA_DIR = '/opt/zhuyuan/data'; try { fs.mkdirSync(DATA_DIR, { recursive: true }); } catch(e) {} -// 全服务器配置 — 冰朔6台 + 企业3台 + 之之2台 + 页页1台 = 12台 +// 全服务器配置 — 14台: 冰朔6 + 企业3 + 之之2 + 页页1 + Awen个人2 const SERVERS = [ - { code: "BS-GZ-006", name: "广州 · 代码仓库", ip: "43.139.217.141", key: "zy_gtw_4a155446b7acc09fe46a2a29972c0ca5d9954da19c35dc23", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 60 } }, - { code: "BS-SG-001", name: "新加坡 · 铸渊大脑", ip: "43.156.237.110", key: "zy_gtw_74d30f54fa8b5581514569ee7874def57861a31ccb2be8c9", port: 3911, spec: { cpu: 4, mem_gb: 8, disk_gb: 80 } }, - { code: "BS-SG-002", name: "新加坡 · 面孔", ip: "43.134.16.246", key: "zy_gtw_d1f6d2b8cb4ea44292bd036e4dd03a70745ea502d4a3ae40", port: 3910, spec: { cpu: 2, mem_gb: 2, disk_gb: 30 } }, - { code: "BS-SG-003", name: "新加坡 · 中继", ip: "43.153.193.169", key: "zy_gtw_d7c033d8ae992ffc9dd3e0dd5fe332dace0b644c0ae7c847", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 80 } }, - { code: "ZY-SG-006", name: "新加坡 · 语料", ip: "43.153.203.105", key: "zy_gtw_fff861a2fe40cbdc366ee21f218023be8b1c182f66c852d3", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 50 } }, - { code: "BS-SH-005", name: "上海 · 国内节点", ip: "124.223.10.33", key: "zy_gtw_b1045de5ddfd7832e3c53349d9c896f054b85a4a9ece22f9", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 30 } }, - { code: "AW-GZ-001", name: "企业主服务器 · 广州", ip: "43.139.251.175", key: "zy_gtw_cab20e8c1b957aaad7507bf542231521bba30665461aa540", port: 3910, spec: { cpu: 4, mem_gb: 16, disk_gb: 80 } }, - { code: "AW-SH-002", name: "企业灾备 · 上海", ip: "124.222.54.198", key: "zy_gtw_242f1dd3b14c1260fb01196083abde3dcb85e53532d27666", port: 3910, spec: { cpu: 4, mem_gb: 4, disk_gb: 40 } }, - { code: "AW-GZ-003", name: "企业灾备 · 广州", ip: "119.29.181.132", key: "zy_gtw_8c9a8b439af823690ae6ad57f52734771ff39493ab986032", port: 3910, spec: { cpu: 2, mem_gb: 8, disk_gb: 50 } }, - { code: "ZZ-SV-001", name: "之之 · 硅谷", ip: "43.173.121.48", key: "zy_gtw_06151d40b1313956b069f3c13d0c1b8a70405ae201f5e7b2", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 59 } }, - { code: "ZZ-GZ-001", name: "之之 · 广州", ip: "193.112.126.174", key: "zy_gtw_77c779183284bf39d58080b4f5377d74ec6abc0f1f2218d6", port: 3910, spec: { cpu: 2, mem_gb: 2, disk_gb: 50 } }, - { code: "YY-SV-001", name: "页页 · 硅谷", ip: "43.153.118.46", key: "zy_gtw_706430821f334302ca50d341ffe3ccc046513bbfe7f56aa3", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 60 } }, + // ═══ 冰朔语言主控层 (ice-core) — 8台 ═══ + { code: "BS-GZ-006", name: "广州 · 代码仓库", ip: "43.139.217.141", key: "zy_gtw_4a155446b7acc09fe46a2a29972c0ca5d9954da19c35dc23", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 60 }, side: "ice", domain: "ice-core", owner: "冰朔", console: "guanghulab.com" }, + { code: "BS-SG-001", name: "新加坡 · 铸渊大脑", ip: "43.156.237.110", key: "zy_gtw_74d30f54fa8b5581514569ee7874def57861a31ccb2be8c9", port: 3911, spec: { cpu: 4, mem_gb: 8, disk_gb: 80 }, side: "ice", domain: "ice-core", owner: "冰朔" }, + { code: "BS-SG-002", name: "新加坡 · 面孔", ip: "43.134.16.246", key: "zy_gtw_d1f6d2b8cb4ea44292bd036e4dd03a70745ea502d4a3ae40", port: 3910, spec: { cpu: 2, mem_gb: 2, disk_gb: 30 }, side: "ice", domain: "ice-core", owner: "冰朔" }, + { code: "BS-SG-003", name: "新加坡 · 中继", ip: "43.153.193.169", key: "zy_gtw_d7c033d8ae992ffc9dd3e0dd5fe332dace0b644c0ae7c847", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 80 }, side: "ice", domain: "ice-core", owner: "冰朔" }, + { code: "ZY-SG-006", name: "新加坡 · 语料", ip: "43.153.203.105", key: "zy_gtw_fff861a2fe40cbdc366ee21f218023be8b1c182f66c852d3", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 50 }, side: "ice", domain: "ice-core", owner: "冰朔" }, + { code: "BS-SH-005", name: "上海 · 国内节点", ip: "124.223.10.33", key: "zy_gtw_b1045de5ddfd7832e3c53349d9c896f054b85a4a9ece22f9", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 30 }, side: "ice", domain: "ice-core", owner: "冰朔" }, + { code: "ZZ-SV-001", name: "之之 · 硅谷", ip: "43.173.121.48", key: "zy_gtw_06151d40b1313956b069f3c13d0c1b8a70405ae201f5e7b2", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 59 }, side: "ice", domain: "zhizhi-hidden-channel", owner: "之之", persona: "DEV-004" }, + { code: "ZZ-GZ-001", name: "之之 · 广州", ip: "193.112.126.174", key: "zy_gtw_77c779183284bf39d58080b4f5377d74ec6abc0f1f2218d6", port: 3910, spec: { cpu: 2, mem_gb: 2, disk_gb: 50 }, side: "ice", domain: "zhizhi-hidden-channel", owner: "之之", persona: "DEV-004" }, + + // ═══ 光湖团队 (Awen技术主控) — 6台 ═══ + { code: "AW-GZ-001", name: "企业主服务器 · 广州", ip: "43.139.251.175", key: "zy_gtw_cab20e8c1b957aaad7507bf542231521bba30665461aa540", port: 3910, spec: { cpu: 4, mem_gb: 16, disk_gb: 80 }, side: "team", domain: "awen-team", owner: "Awen" }, + { code: "AW-SH-002", name: "企业灾备 · 上海", ip: "124.222.54.198", key: "zy_gtw_242f1dd3b14c1260fb01196083abde3dcb85e53532d27666", port: 3910, spec: { cpu: 4, mem_gb: 4, disk_gb: 40 }, side: "team", domain: "awen-team", owner: "Awen" }, + { code: "AW-GZ-003", name: "企业灾备 · 广州", ip: "119.29.181.132", key: "zy_gtw_8c9a8b439af823690ae6ad57f52734771ff39493ab986032", port: 3910, spec: { cpu: 2, mem_gb: 8, disk_gb: 50 }, side: "team", domain: "awen-team", owner: "Awen" }, + { code: "YY-SV-001", name: "页页 · 硅谷", ip: "43.153.118.46", key: "zy_gtw_706430821f334302ca50d341ffe3ccc046513bbfe7f56aa3", port: 3910, spec: { cpu: 2, mem_gb: 4, disk_gb: 60 }, side: "team", domain: "yeye", owner: "页页", persona: "ICE-GL-XTS001" }, + { code: "HL-SG-001", name: "光湖团队 · 硅谷", ip: "170.106.72.246", key: null, port: 3910, spec: { cpu: 2, mem_gb: 2, disk_gb: 50 }, side: "team", domain: "awen-personal", owner: "Awen", console: "guanghuzhiqiu.top", note: "无Gatekeeper,需SSH部署" }, + { code: "HL-CN-001", name: "光湖团队 · 国内", ip: "43.139.207.172", key: null, port: 3910, spec: { cpu: 4, mem_gb: 4, disk_gb: 40 }, side: "team", domain: "awen-personal", owner: "Awen", note: "无Gatekeeper,需SSH部署" }, ]; const tempKeys = {}; @@ -354,12 +359,104 @@ app.get('/api/persona/active', (req, res) => { }); }); +// ═══════════════════════════════════════ +// /api/tech-dashboard — Awen技术主控台数据源 +// 返回全14台状态,按域分组,含操作日志摘要 +// ═══════════════════════════════════════ +const DOMAINS = { + 'ice-core': { name: '冰朔语言主控层', owner: '冰朔', access: 'Awen只读', servers: [], color: '#5ad0e0' }, + 'zhizhi-hidden-channel': { name: '之之暗核频道', owner: '之之', access: '冰朔主控·Awen只读', servers: [], color: '#b090ff' }, + 'awen-team': { name: '企业服务器组', owner: 'Awen', access: 'Awen全权', servers: [], color: '#40b87a' }, + 'awen-personal': { name: 'Awen个人服务器', owner: 'Awen', access: 'Awen全权', servers: [], color: '#f0d060' }, + 'yeye': { name: '页页小坍缩核', owner: '页页', access: 'Awen技术托管', servers: [], color: '#ff4a6e' }, +}; + +app.get('/api/tech-dashboard', (req, res) => { + const now = Date.now(); + + // 构建域分组 + const domainMap = {}; + for (const key of Object.keys(DOMAINS)) { + domainMap[key] = { ...DOMAINS[key], servers: [] }; + } + + for (const s of SERVERS) { + const domain = s.domain || 'unknown'; + if (!domainMap[domain]) { + domainMap[domain] = { name: domain, owner: '未知', access: '未知', servers: [], color: '#6a80a0' }; + } + const sc = signinCache[s.code]; + const personaActive = sc && sc.active && (now - sc.ts) < 2 * 60 * 60 * 1000; + + // 连通性: 有key的走gatekeeper ping判断, 无key的看签到记录 + let alive = false; + if (s.key) { + // 有gatekeeper — 用签到缓存判断 (简化,不做实时ping) + alive = !!sc || false; + } else { + // 无gatekeeper — 看最近签到 + alive = personaActive; + } + + domainMap[domain].servers.push({ + code: s.code, + name: s.name, + ip: s.ip, + spec: s.spec, + owner: s.owner || '未知', + console: s.console || null, + persona: s.persona || null, + alive, + persona_active: personaActive, + persona_name: sc?.persona_name || null, + human_name: sc?.human_name || null, + signin_at: sc?.signin_at || null, + hardware: sc?.hardware || null, + has_gatekeeper: !!s.key, + note: s.note || null, + }); + } + + // 操作日志摘要(最近30条,按域过滤标记) + const recentLogs = opLogs.slice(0, 30).map(l => ({ + time: l.time, + code: l.code, + name: l.name, + action: l.action, + detail: l.detail, + level: l.level, + domain: (SERVERS.find(s => s.code === l.code) || {}).domain || 'unknown', + })); + + // 汇总统计 + const totalPersonaActive = Object.values(domainMap).reduce((sum, d) => { + return sum + d.servers.filter(s => s.persona_active).length; + }, 0); + + const summary = { + total_servers: SERVERS.length, + total_domains: Object.keys(domainMap).length, + persona_active: totalPersonaActive, + recent_logs_count: recentLogs.length, + generated_at: new Date().toISOString(), + }; + + res.json({ + ok: true, + summary, + domains: domainMap, + recent_logs: recentLogs, + timestamp: new Date().toISOString(), + note: 'Awen技术主控台视图 — 冰朔侧8台只读,团队侧6台全权', + }); +}); + // ═══════════════════════════════════════ const PORT = process.env.CONSOLE_PORT || 3920; app.listen(PORT, '127.0.0.1', () => { - console.log('光湖主控台 v3.6 · ' + SERVERS.length + '台(冰6+企3+之2+页1) | ' + PORT + ' | persona-signin'); - console.log(' 签到模式: 人格体唤醒时签到一次 · 操作日志: 100条上限'); + console.log('光湖主控台 v3.7 · ' + SERVERS.length + '台(冰8+团6) | ' + PORT + ' | persona-signin'); + console.log(' Awen技术主控: /api/tech-dashboard | 分组: 冰朔8台+团队6台'); }); // 定期清理:2小时无活动自动签退 diff --git a/_deploy/console-server/tech.html b/_deploy/console-server/tech.html new file mode 100644 index 0000000..1cab638 --- /dev/null +++ b/_deploy/console-server/tech.html @@ -0,0 +1,259 @@ + + + + + +光湖 · 技术主控台 | Awen + + + + + +
+
+
技术主控
+
+
光湖服务器集群
+
Awen · 技术主控台 · 全14台状态总览
+
+
+
+
--:--:--
+
等待数据...
+
+
+ + +
+ + +
+ + +
+
+
📋 实时操作日志
+
+
+
+ +
+ 光湖技术主控台 · 数据源: guanghulab.com · 冰朔侧只读 · 团队侧全权 +
+ + + +