From 02358139c24bd00f6ce2044e243aebae423f776f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 11 Aug 2026 17:25:53 +0800 Subject: [PATCH] feat: login popup + theme toggle + superuser admin/admin123 + session config --- conf/config.json | 3 + wwwroot/api/get_user_info.dspy | 9 ++ wwwroot/index.html | 183 +++++++++++++++++++++++++++++---- 3 files changed, 174 insertions(+), 21 deletions(-) create mode 100644 wwwroot/api/get_user_info.dspy diff --git a/conf/config.json b/conf/config.json index 21a65f5..23f1772 100644 --- a/conf/config.json +++ b/conf/config.json @@ -36,6 +36,9 @@ [".wss", "ws"] ], "indexes": ["index.ui", "index.html"], + "session": { + "secret": "pccs_session_secret_key_2024" + }, "statics": [ ["/bricks/", "/d/pccs/wwwroot/bricks/"], ["/imgs/", "/d/pccs/wwwroot/imgs/"] diff --git a/wwwroot/api/get_user_info.dspy b/wwwroot/api/get_user_info.dspy new file mode 100644 index 0000000..0174d9e --- /dev/null +++ b/wwwroot/api/get_user_info.dspy @@ -0,0 +1,9 @@ +# 返回当前登录用户信息 +from aiohttp_session import get_session + +async def handler(request): + session = await get_session(request) + user = session.get('user') + if user: + return {'username': user.get('username', ''), 'userid': user.get('id', '')} + return {} diff --git a/wwwroot/index.html b/wwwroot/index.html index c4a70b3..ddf6c21 100644 --- a/wwwroot/index.html +++ b/wwwroot/index.html @@ -1,53 +1,115 @@ - + PCCS 算力中心集群系统
算力中心集群系统
- - - + + + + +
+ + + +
@@ -63,5 +125,84 @@ body{font-family:system-ui;background:#f8fafc;color:#1e293b;min-height:100vh;dis
+ +