fix: auto-clean orphan entities on purge; fix graph camera zoom; optimize system prompt
This commit is contained in:
65
ui/app.py
65
ui/app.py
@ -1,6 +1,6 @@
|
||||
import asyncio
|
||||
import sys
|
||||
import subprocess
|
||||
import threading
|
||||
import signal
|
||||
from pathlib import Path
|
||||
from textual.app import App, ComposeResult
|
||||
@ -31,7 +31,6 @@ class GraphMemoryApp(App):
|
||||
self._backend_server = backend_server
|
||||
self._backend_client = BackendClient(backend_server) if backend_server else None
|
||||
self._api_configured = False
|
||||
self._web_process: subprocess.Popen | None = None
|
||||
self._web_running = False
|
||||
self.login_user = None # 当前登录用户
|
||||
self.login_user_info = None # 当前登录用户信息
|
||||
@ -51,7 +50,7 @@ class GraphMemoryApp(App):
|
||||
api_config = settings_data.get("api_config", {})
|
||||
initial_config.api_key = api_config.get("api_key", "")
|
||||
initial_config.base_url = api_config.get("base_url", "https://api.deepseek.com")
|
||||
initial_config.model = api_config.get("model", "deepseek-chat")
|
||||
initial_config.model = api_config.get("model", "deepseek-v4-flash")
|
||||
|
||||
tool_limits = settings_data.get("tool_limits", {})
|
||||
initial_config.persona_update_max = tool_limits.get("persona_update_max", 1)
|
||||
@ -138,46 +137,14 @@ class GraphMemoryApp(App):
|
||||
history.add_message(welcome)
|
||||
|
||||
def _start_web_server(self, port: int = 4096) -> None:
|
||||
"""启动 Web 服务器子进程(支持打包和开发模式)"""
|
||||
if self._web_process and self._web_process.poll() is None:
|
||||
"""在当前进程通过线程启动 Web 服务(无需子进程)"""
|
||||
if self._web_running:
|
||||
self.notify("Web 服务已在运行", title="提示")
|
||||
return
|
||||
|
||||
def _find_web_binary() -> str:
|
||||
"""查找 Web 二进制或脚本路径"""
|
||||
# 1. PyInstaller 打包环境下查找同目录的 trulymem-web 二进制
|
||||
if getattr(sys, 'frozen', False):
|
||||
base = Path(sys._MEIPASS).parent
|
||||
for name in ['trulymem-web', 'trulymem-web.exe']:
|
||||
candidate = base / name
|
||||
if candidate.exists():
|
||||
return str(candidate)
|
||||
# 2. 开发模式:同目录下的 web_api.py
|
||||
web_script = Path(__file__).parent.parent / "web_api.py"
|
||||
if web_script.exists():
|
||||
return str(web_script)
|
||||
# 3. 打包环境回退:从 MEIPASS 读取 web_api.py 数据文件
|
||||
if getattr(sys, 'frozen', False):
|
||||
bundled = Path(sys._MEIPASS) / "web_api.py"
|
||||
if bundled.exists():
|
||||
return str(bundled)
|
||||
return ""
|
||||
|
||||
target = _find_web_binary()
|
||||
if not target:
|
||||
self.notify("找不到 Web 服务文件(web_api.py)", severity="error")
|
||||
return
|
||||
|
||||
try:
|
||||
if target.endswith('.py'):
|
||||
cmd = [sys.executable, target, "--port", str(port)]
|
||||
else:
|
||||
cmd = [target, "--port", str(port)]
|
||||
self._web_process = subprocess.Popen(
|
||||
cmd,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
from web_api import run_web_server
|
||||
run_web_server(port=port)
|
||||
self._web_running = True
|
||||
if self._backend_client:
|
||||
self._backend_client.report_web_status(True, port)
|
||||
@ -186,17 +153,13 @@ class GraphMemoryApp(App):
|
||||
self.notify(f"启动 Web 服务失败: {e}", severity="error")
|
||||
|
||||
def _stop_web_server(self) -> None:
|
||||
"""停止 Web 服务器子进程"""
|
||||
if self._web_process:
|
||||
"""停止 Web 服务线程"""
|
||||
if self._web_running:
|
||||
try:
|
||||
self._web_process.terminate()
|
||||
self._web_process.wait(timeout=5)
|
||||
except:
|
||||
try:
|
||||
self._web_process.kill()
|
||||
except:
|
||||
pass
|
||||
self._web_process = None
|
||||
from web_api import stop_web_server
|
||||
stop_web_server()
|
||||
except Exception:
|
||||
pass
|
||||
self._web_running = False
|
||||
if self._backend_client:
|
||||
self._backend_client.report_web_status(False, 0)
|
||||
@ -332,7 +295,7 @@ class GraphMemoryApp(App):
|
||||
api_config = {
|
||||
"api_key": config.api_key,
|
||||
"base_url": config.base_url,
|
||||
"model": getattr(config, 'model', 'deepseek-chat')
|
||||
"model": getattr(config, 'model', 'deepseek-v4-flash')
|
||||
}
|
||||
|
||||
tool_limits = {
|
||||
@ -378,7 +341,7 @@ class GraphMemoryApp(App):
|
||||
config_section.set_config(AppConfig(
|
||||
api_key=api_cfg.get("api_key", ""),
|
||||
base_url=api_cfg.get("base_url", "https://api.deepseek.com"),
|
||||
model=api_cfg.get("model", "deepseek-chat"),
|
||||
model=api_cfg.get("model", "deepseek-v4-flash"),
|
||||
persona_update_max=tool_lmts.get("persona_update_max", 1),
|
||||
task_update_max=tool_lmts.get("task_update_max", 5),
|
||||
memory_query_max=tool_lmts.get("memory_query_max", 20),
|
||||
|
||||
@ -11,7 +11,7 @@ from typing import Optional
|
||||
class AppConfig:
|
||||
"""应用配置"""
|
||||
api_key: str = ""
|
||||
model: str = "deepseek-chat"
|
||||
model: str = "deepseek-v4-flash"
|
||||
base_url: str = "https://api.deepseek.com"
|
||||
persona_update_max: int = 1
|
||||
task_update_max: int = 5
|
||||
@ -38,7 +38,7 @@ class AppConfig:
|
||||
|
||||
return cls(
|
||||
api_key=os.getenv("DEEPSEEK_API_KEY", ""),
|
||||
model=os.getenv("MODEL_NAME", "deepseek-chat"),
|
||||
model=os.getenv("MODEL_NAME", "deepseek-v4-flash"),
|
||||
base_url=os.getenv("DEEPSEEK_BASE_URL", "https://api.deepseek.com"),
|
||||
persona_update_max=int(os.getenv("PERSONA_UPDATE_MAX", 1)),
|
||||
task_update_max=int(os.getenv("TASK_UPDATE_MAX", 5)),
|
||||
@ -61,7 +61,7 @@ class AppConfig:
|
||||
|
||||
return cls(
|
||||
api_key=data.get("api_key", ""),
|
||||
model=data.get("model", "deepseek-chat"),
|
||||
model=data.get("model", "deepseek-v4-flash"),
|
||||
base_url=data.get("base_url", "https://api.deepseek.com"),
|
||||
persona_update_max=data.get("persona_update_max", 1),
|
||||
task_update_max=data.get("task_update_max", 5),
|
||||
|
||||
@ -35,7 +35,7 @@ class ConfigManager:
|
||||
|
||||
return AppConfig(
|
||||
api_key=data.get("api_key", ""),
|
||||
model=data.get("model", "deepseek-chat"),
|
||||
model=data.get("model", "deepseek-v4-flash"),
|
||||
base_url=data.get("base_url", "https://api.deepseek.com")
|
||||
)
|
||||
except Exception:
|
||||
|
||||
1645
ui/static/graph.html
Normal file
1645
ui/static/graph.html
Normal file
File diff suppressed because it is too large
Load Diff
1076
ui/static/index.html
Normal file
1076
ui/static/index.html
Normal file
File diff suppressed because it is too large
Load Diff
229
ui/templates/login.html
Normal file
229
ui/templates/login.html
Normal file
@ -0,0 +1,229 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登录 - TrulyMEM</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: 'Courier New', monospace;
|
||||
background: #0a0a1a;
|
||||
color: #ffffff;
|
||||
overflow: hidden;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background:
|
||||
radial-gradient(2px 2px at 20px 30px, #eee, transparent),
|
||||
radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
|
||||
radial-gradient(1px 1px at 90px 40px, #fff, transparent),
|
||||
radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
|
||||
radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
|
||||
background-repeat: repeat;
|
||||
background-size: 200px 100px;
|
||||
animation: twinkle 5s ease-in-out infinite alternate;
|
||||
z-index: 0;
|
||||
}
|
||||
@keyframes twinkle {
|
||||
0% { opacity: 0.5; }
|
||||
100% { opacity: 1; }
|
||||
}
|
||||
.login-container {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 400px;
|
||||
padding: 40px;
|
||||
background: rgba(10, 10, 26, 0.9);
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
box-shadow:
|
||||
0 0 20px rgba(68, 136, 255, 0.2),
|
||||
0 0 60px rgba(68, 136, 255, 0.1),
|
||||
inset 0 0 20px rgba(68, 136, 255, 0.05);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.login-title {
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
margin-bottom: 10px;
|
||||
color: #4488ff;
|
||||
text-shadow: 0 0 10px rgba(68, 136, 255, 0.5);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.login-subtitle {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #8888aa;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
color: #aaaacc;
|
||||
font-size: 14px;
|
||||
}
|
||||
.form-group input {
|
||||
width: 100%;
|
||||
padding: 12px 16px;
|
||||
background: rgba(20, 20, 40, 0.8);
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
border-radius: 6px;
|
||||
color: #ffffff;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.form-group input:focus {
|
||||
outline: none;
|
||||
border-color: #4488ff;
|
||||
box-shadow: 0 0 10px rgba(68, 136, 255, 0.3);
|
||||
}
|
||||
.form-group input::placeholder {
|
||||
color: #555577;
|
||||
}
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
background: linear-gradient(135deg, rgba(68, 136, 255, 0.3), rgba(68, 136, 255, 0.1));
|
||||
border: 1px solid rgba(68, 136, 255, 0.5);
|
||||
border-radius: 6px;
|
||||
color: #ffffff;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
position: relative;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.login-btn:hover {
|
||||
background: linear-gradient(135deg, rgba(68, 136, 255, 0.5), rgba(68, 136, 255, 0.3));
|
||||
box-shadow: 0 0 15px rgba(68, 136, 255, 0.4);
|
||||
}
|
||||
.login-btn:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.login-btn .spinner {
|
||||
display: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 2px solid rgba(255, 255, 255, 0.3);
|
||||
border-top-color: #ffffff;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.6s linear infinite;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.login-btn.loading .spinner {
|
||||
display: block;
|
||||
}
|
||||
.login-btn.loading span {
|
||||
visibility: hidden;
|
||||
}
|
||||
@keyframes spin {
|
||||
to { transform: translate(-50%, -50%) rotate(360deg); }
|
||||
}
|
||||
.error-message {
|
||||
display: none;
|
||||
margin-top: 15px;
|
||||
padding: 12px;
|
||||
background: rgba(255, 68, 68, 0.15);
|
||||
border: 1px solid rgba(255, 68, 68, 0.4);
|
||||
border-radius: 6px;
|
||||
color: #ff6b6b;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
}
|
||||
.error-message.show {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="login-container">
|
||||
<h1 class="login-title">记忆星图</h1>
|
||||
<p class="login-subtitle">TrulyMEM - 登录以继续</p>
|
||||
|
||||
<form id="loginForm">
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" id="username" name="username" placeholder="请输入用户名" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" id="password" name="password" placeholder="请输入密码" required>
|
||||
</div>
|
||||
<button type="submit" class="login-btn" id="loginBtn">
|
||||
<span>登 录</span>
|
||||
<div class="spinner"></div>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="error-message" id="errorMsg"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const loginForm = document.getElementById('loginForm');
|
||||
const loginBtn = document.getElementById('loginBtn');
|
||||
const errorMsg = document.getElementById('errorMsg');
|
||||
|
||||
loginForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const username = document.getElementById('username').value;
|
||||
const password = document.getElementById('password').value;
|
||||
|
||||
errorMsg.classList.remove('show');
|
||||
loginBtn.classList.add('loading');
|
||||
loginBtn.disabled = true;
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ username, password })
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
window.location.href = '/graph.html';
|
||||
} else {
|
||||
errorMsg.textContent = data.error || '登录失败';
|
||||
errorMsg.classList.add('show');
|
||||
}
|
||||
} catch (err) {
|
||||
errorMsg.textContent = '网络错误,请重试';
|
||||
errorMsg.classList.add('show');
|
||||
} finally {
|
||||
loginBtn.classList.remove('loading');
|
||||
loginBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
545
ui/templates/settings.html
Normal file
545
ui/templates/settings.html
Normal file
@ -0,0 +1,545 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>设置 - TrulyMEM</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: 'Courier New', monospace;
|
||||
background: #0a0a1a;
|
||||
color: #ffffff;
|
||||
min-height: 100vh;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
|
||||
background:
|
||||
radial-gradient(2px 2px at 20px 30px, #eee, transparent),
|
||||
radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
|
||||
radial-gradient(1px 1px at 90px 40px, #fff, transparent);
|
||||
background-repeat: repeat;
|
||||
background-size: 200px 100px;
|
||||
animation: twinkle 5s ease-in-out infinite alternate;
|
||||
z-index: 0;
|
||||
}
|
||||
@keyframes twinkle { 0% { opacity: 0.5; } 100% { opacity: 1; } }
|
||||
.settings-container {
|
||||
position: relative; z-index: 1; width: 480px; padding: 40px;
|
||||
background: rgba(10, 10, 26, 0.9);
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
box-shadow: 0 0 20px rgba(68, 136, 255, 0.2), 0 0 60px rgba(68, 136, 255, 0.1), inset 0 0 20px rgba(68, 136, 255, 0.05);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.settings-title {
|
||||
text-align: center; font-size: 26px; margin-bottom: 25px;
|
||||
color: #4488ff; text-shadow: 0 0 10px rgba(68, 136, 255, 0.5);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.section-title {
|
||||
font-size: 16px; color: #8888cc; margin: 20px 0 15px;
|
||||
border-bottom: 1px solid rgba(100, 100, 255, 0.2);
|
||||
padding-bottom: 6px; letter-spacing: 1px;
|
||||
}
|
||||
.form-group { margin-bottom: 16px; }
|
||||
.form-group label { display: block; margin-bottom: 6px; color: #aaaacc; font-size: 14px; }
|
||||
.form-group input {
|
||||
width: 100%; padding: 10px 14px;
|
||||
background: rgba(20, 20, 40, 0.8);
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
border-radius: 6px; color: #ffffff;
|
||||
font-family: 'Courier New', monospace; font-size: 14px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.form-group input:focus {
|
||||
outline: none; border-color: #4488ff; box-shadow: 0 0 10px rgba(68, 136, 255, 0.3);
|
||||
}
|
||||
.form-group input::placeholder { color: #555577; }
|
||||
.toggle-row {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
padding: 12px 0; border-bottom: 1px solid rgba(100, 100, 255, 0.1);
|
||||
}
|
||||
.toggle-label { color: #ccccee; font-size: 14px; }
|
||||
.toggle-desc { color: #7777aa; font-size: 12px; margin-top: 2px; }
|
||||
.toggle-switch {
|
||||
position: relative; width: 48px; height: 26px; cursor: pointer; flex-shrink: 0;
|
||||
}
|
||||
.toggle-switch input { display: none; }
|
||||
.toggle-slider {
|
||||
position: absolute; inset: 0;
|
||||
background: rgba(60, 60, 80, 0.8);
|
||||
border-radius: 13px; transition: all 0.3s;
|
||||
border: 1px solid rgba(100, 100, 255, 0.2);
|
||||
}
|
||||
.toggle-slider::after {
|
||||
content: ''; position: absolute; width: 20px; height: 20px;
|
||||
left: 2px; bottom: 2px; background: #6666aa;
|
||||
border-radius: 50%; transition: all 0.3s;
|
||||
}
|
||||
.toggle-switch input:checked + .toggle-slider {
|
||||
background: rgba(68, 136, 255, 0.4);
|
||||
border-color: rgba(68, 136, 255, 0.6);
|
||||
}
|
||||
.toggle-switch input:checked + .toggle-slider::after {
|
||||
left: 24px; background: #4488ff;
|
||||
}
|
||||
.btn {
|
||||
width: 100%; padding: 12px;
|
||||
background: linear-gradient(135deg, rgba(68, 136, 255, 0.3), rgba(68, 136, 255, 0.1));
|
||||
border: 1px solid rgba(68, 136, 255, 0.5);
|
||||
border-radius: 6px; color: #ffffff;
|
||||
font-family: 'Courier New', monospace; font-size: 14px;
|
||||
cursor: pointer; transition: all 0.3s; margin-top: 8px;
|
||||
}
|
||||
.btn:hover {
|
||||
background: linear-gradient(135deg, rgba(68, 136, 255, 0.5), rgba(68, 136, 255, 0.3));
|
||||
box-shadow: 0 0 15px rgba(68, 136, 255, 0.4);
|
||||
}
|
||||
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
|
||||
.back-link {
|
||||
display: block; text-align: center; margin-top: 20px; color: #6666aa;
|
||||
text-decoration: none; font-size: 13px; transition: color 0.3s;
|
||||
}
|
||||
.back-link:hover { color: #4488ff; }
|
||||
.success-msg, .error-msg {
|
||||
display: none; margin-top: 12px; padding: 10px;
|
||||
border-radius: 6px; font-size: 13px; text-align: center;
|
||||
}
|
||||
.success-msg { background: rgba(68, 255, 136, 0.15); border: 1px solid rgba(68, 255, 136, 0.4); color: #6bff9b; }
|
||||
.error-msg { background: rgba(255, 68, 68, 0.15); border: 1px solid rgba(255, 68, 68, 0.4); color: #ff6b6b; }
|
||||
.success-msg.show, .error-msg.show { display: block; }
|
||||
.tui-status {
|
||||
text-align: center; font-size: 12px; color: #666688; margin-top: 5px;
|
||||
}
|
||||
/* 用户管理样式 */
|
||||
.user-section { margin-top: 20px; }
|
||||
.user-table {
|
||||
width: 100%; border-collapse: collapse; margin-top: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.user-table th {
|
||||
text-align: left; padding: 8px; color: #8888cc;
|
||||
border-bottom: 1px solid rgba(100, 100, 255, 0.2);
|
||||
}
|
||||
.user-table td {
|
||||
padding: 8px; border-bottom: 1px solid rgba(100, 100, 255, 0.1);
|
||||
color: #ccccee;
|
||||
}
|
||||
.btn-small {
|
||||
padding: 4px 10px; font-size: 12px;
|
||||
background: rgba(255, 68, 68, 0.2);
|
||||
border: 1px solid rgba(255, 68, 68, 0.4);
|
||||
border-radius: 4px; color: #ff6b6b;
|
||||
cursor: pointer; transition: all 0.3s;
|
||||
}
|
||||
.btn-small:hover {
|
||||
background: rgba(255, 68, 68, 0.4);
|
||||
}
|
||||
.btn-small:disabled {
|
||||
opacity: 0.4; cursor: not-allowed;
|
||||
}
|
||||
.btn-add {
|
||||
margin-top: 10px; padding: 8px 16px;
|
||||
background: rgba(68, 136, 255, 0.2);
|
||||
border: 1px solid rgba(68, 136, 255, 0.4);
|
||||
border-radius: 6px; color: #4488ff;
|
||||
cursor: pointer; font-size: 13px; transition: all 0.3s;
|
||||
}
|
||||
.btn-add:hover {
|
||||
background: rgba(68, 136, 255, 0.4);
|
||||
}
|
||||
/* 弹窗样式 */
|
||||
.modal-overlay {
|
||||
display: none; position: fixed; top: 0; left: 0;
|
||||
width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 1000; align-items: center; justify-content: center;
|
||||
}
|
||||
.modal-overlay.show { display: flex; }
|
||||
.modal {
|
||||
background: rgba(10, 10, 26, 0.95);
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
border-radius: 12px; padding: 30px; width: 400px;
|
||||
}
|
||||
.modal-title {
|
||||
font-size: 18px; color: #4488ff; margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.modal .form-group { margin-bottom: 15px; }
|
||||
.modal .btn {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.modal .btn-cancel {
|
||||
background: rgba(100, 100, 100, 0.2);
|
||||
border-color: rgba(100, 100, 100, 0.4);
|
||||
margin-top: 10px;
|
||||
}
|
||||
.modal .btn-cancel:hover {
|
||||
background: rgba(100, 100, 100, 0.4);
|
||||
}
|
||||
.current-user {
|
||||
color: #4488ff; font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="settings-container">
|
||||
<h1 class="settings-title"><i class="fas fa-cog"></i> 设置</h1>
|
||||
|
||||
<!-- 修改密码 -->
|
||||
<div class="section-title"><i class="fas fa-key"></i> 修改密码</div>
|
||||
<form id="passwordForm">
|
||||
<div class="form-group">
|
||||
<label for="current_password">当前密码</label>
|
||||
<input type="password" id="current_password" placeholder="输入当前密码" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="new_password">新密码</label>
|
||||
<input type="password" id="new_password" placeholder="至少 6 位" required minlength="6">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="confirm_password">确认新密码</label>
|
||||
<input type="password" id="confirm_password" placeholder="再次输入新密码" required>
|
||||
</div>
|
||||
<button type="submit" class="btn" id="changePwdBtn">更 新 密 码</button>
|
||||
</form>
|
||||
|
||||
<!-- TUI 服务控制 -->
|
||||
<div class="section-title">🖥 TUI 终端服务</div>
|
||||
<div class="toggle-row">
|
||||
<div>
|
||||
<div class="toggle-label">启用终端 TUI 服务</div>
|
||||
<div class="toggle-desc">控制终端文本界面是否允许连接</div>
|
||||
</div>
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" id="enableTuiToggle">
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="tui-status" id="tuiStatus">状态加载中...</div>
|
||||
|
||||
<!-- 保存结果提示 -->
|
||||
<div class="success-msg" id="successMsg"></div>
|
||||
<div class="error-msg" id="errorMsg"></div>
|
||||
|
||||
<!-- 用户管理(仅管理员可见) -->
|
||||
<div id="adminSection" style="display:none;">
|
||||
<div class="section-title">👥 用户管理</div>
|
||||
<div class="user-section">
|
||||
<table class="user-table" id="userTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>角色</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="userTableBody">
|
||||
<!-- 用户列表将在这里动态生成 -->
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="btn-add" id="addUserBtn">+ 添加用户</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="/graph.html" class="back-link">← 返回星图</a>
|
||||
</div>
|
||||
|
||||
<!-- 添加用户弹窗 -->
|
||||
<div class="modal-overlay" id="addUserModal">
|
||||
<div class="modal">
|
||||
<div class="modal-title">添加用户</div>
|
||||
<form id="addUserForm">
|
||||
<div class="form-group">
|
||||
<label for="new_username">用户名</label>
|
||||
<input type="text" id="new_username" placeholder="输入新用户名" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="new_user_password">密码</label>
|
||||
<input type="password" id="new_user_password" placeholder="至少 6 位" required minlength="6">
|
||||
</div>
|
||||
<button type="submit" class="btn" id="confirmAddBtn">添加</button>
|
||||
<button type="button" class="btn btn-cancel" id="cancelAddBtn">取消</button>
|
||||
</form>
|
||||
<div class="success-msg" id="addUserSuccess"></div>
|
||||
<div class="error-msg" id="addUserError"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let currentUser = '';
|
||||
let isAdmin = false;
|
||||
|
||||
// 初始化:获取用户信息和配置
|
||||
async function init() {
|
||||
// 获取当前用户信息(含角色)
|
||||
try {
|
||||
const resp = await fetch('/api/userinfo');
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
currentUser = data.username;
|
||||
isAdmin = data.is_admin;
|
||||
|
||||
// 仅管理员显示用户管理区域
|
||||
if (isAdmin) {
|
||||
document.getElementById('adminSection').style.display = 'block';
|
||||
loadUsers();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('获取用户信息失败:', e);
|
||||
}
|
||||
|
||||
// 加载配置
|
||||
loadConfig();
|
||||
}
|
||||
|
||||
// 加载当前配置
|
||||
async function loadConfig() {
|
||||
try {
|
||||
const resp = await fetch('/api/settings/config');
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
document.getElementById('enableTuiToggle').checked = data.enable_tui !== false;
|
||||
document.getElementById('tuiStatus').textContent =
|
||||
data.enable_tui ? '✅ TUI 服务已启用' : '⏹️ TUI 服务已禁用';
|
||||
}
|
||||
} catch (e) {
|
||||
document.getElementById('tuiStatus').textContent = '⚠️ 无法加载配置';
|
||||
}
|
||||
}
|
||||
|
||||
// 加载用户列表
|
||||
async function loadUsers() {
|
||||
try {
|
||||
const resp = await fetch('/api/admin/users');
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
const tbody = document.getElementById('userTableBody');
|
||||
tbody.innerHTML = '';
|
||||
|
||||
data.users.forEach(user => {
|
||||
const tr = document.createElement('tr');
|
||||
const isCurrentUser = user.username === currentUser;
|
||||
const roleBadge = user.role === 'admin'
|
||||
? '<span style="color:#ffaa44;font-weight:bold;">管理员</span>'
|
||||
: '<span style="color:#8888cc;">用户</span>';
|
||||
tr.innerHTML = `
|
||||
<td class="${isCurrentUser ? 'current-user' : ''}">
|
||||
${user.username} ${isCurrentUser ? '(当前)' : ''}
|
||||
</td>
|
||||
<td>${roleBadge}</td>
|
||||
<td>${new Date(user.created_at).toLocaleString('zh-CN')}</td>
|
||||
<td>
|
||||
<button class="btn-small"
|
||||
onclick="deleteUser(${user.id}, '${user.username}')"
|
||||
${isCurrentUser ? 'disabled' : ''}>
|
||||
删除
|
||||
</button>
|
||||
</td>
|
||||
`;
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载用户列表失败:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
async function deleteUser(userId, username) {
|
||||
if (!confirm(`确定要删除用户 "${username}" 吗?`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const resp = await fetch(`/api/admin/users/${userId}`, {
|
||||
method: 'DELETE'
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
showSuccess('用户已删除');
|
||||
loadUsers();
|
||||
} else {
|
||||
showError(data.error || '删除失败');
|
||||
}
|
||||
} catch (e) {
|
||||
showError('网络错误');
|
||||
}
|
||||
}
|
||||
|
||||
// 显示添加用户弹窗
|
||||
document.getElementById('addUserBtn').addEventListener('click', () => {
|
||||
document.getElementById('addUserModal').classList.add('show');
|
||||
hideAddUserMessages();
|
||||
});
|
||||
|
||||
// 隐藏弹窗
|
||||
document.getElementById('cancelAddBtn').addEventListener('click', () => {
|
||||
document.getElementById('addUserModal').classList.remove('show');
|
||||
document.getElementById('addUserForm').reset();
|
||||
});
|
||||
|
||||
// 添加用户
|
||||
document.getElementById('addUserForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const username = document.getElementById('new_username').value.trim();
|
||||
const password = document.getElementById('new_user_password').value;
|
||||
|
||||
if (!username || !password) {
|
||||
showAddUserError('用户名和密码不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
if (password.length < 6) {
|
||||
showAddUserError('密码长度至少 6 位');
|
||||
return;
|
||||
}
|
||||
|
||||
const btn = document.getElementById('confirmAddBtn');
|
||||
btn.disabled = true;
|
||||
btn.textContent = '添加中...';
|
||||
hideAddUserMessages();
|
||||
|
||||
try {
|
||||
const resp = await fetch('/api/admin/users', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ username, password })
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
showAddUserSuccess('✅ 用户添加成功');
|
||||
setTimeout(() => {
|
||||
document.getElementById('addUserModal').classList.remove('show');
|
||||
document.getElementById('addUserForm').reset();
|
||||
loadUsers();
|
||||
}, 1500);
|
||||
} else {
|
||||
showAddUserError(data.error || '添加失败');
|
||||
}
|
||||
} catch (e) {
|
||||
showAddUserError('网络错误');
|
||||
} finally {
|
||||
btn.disabled = false;
|
||||
btn.textContent = '添加';
|
||||
}
|
||||
});
|
||||
|
||||
function showAddUserSuccess(msg) {
|
||||
const el = document.getElementById('addUserSuccess');
|
||||
el.textContent = msg;
|
||||
el.classList.add('show');
|
||||
document.getElementById('addUserError').classList.remove('show');
|
||||
}
|
||||
|
||||
function showAddUserError(msg) {
|
||||
const el = document.getElementById('addUserError');
|
||||
el.textContent = msg;
|
||||
el.classList.add('show');
|
||||
document.getElementById('addUserSuccess').classList.remove('show');
|
||||
}
|
||||
|
||||
function hideAddUserMessages() {
|
||||
document.getElementById('addUserSuccess').classList.remove('show');
|
||||
document.getElementById('addUserError').classList.remove('show');
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
// TUI 开关
|
||||
document.getElementById('enableTuiToggle').addEventListener('change', async function() {
|
||||
const enable = this.checked;
|
||||
document.getElementById('tuiStatus').textContent = '🔄 更新中...';
|
||||
try {
|
||||
const resp = await fetch('/api/settings/config', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ enable_tui: enable })
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
document.getElementById('tuiStatus').textContent =
|
||||
enable ? '✅ TUI 服务已启用' : '⏹️ TUI 服务已禁用';
|
||||
showSuccess('设置已保存');
|
||||
} else {
|
||||
document.getElementById('tuiStatus').textContent = '⚠️ 更新失败';
|
||||
this.checked = !enable;
|
||||
}
|
||||
} catch (e) {
|
||||
document.getElementById('tuiStatus').textContent = '⚠️ 网络错误';
|
||||
this.checked = !enable;
|
||||
}
|
||||
});
|
||||
|
||||
// 修改密码
|
||||
document.getElementById('passwordForm').addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const current = document.getElementById('current_password').value;
|
||||
const newPwd = document.getElementById('new_password').value;
|
||||
const confirm = document.getElementById('confirm_password').value;
|
||||
|
||||
if (newPwd !== confirm) {
|
||||
showError('两次密码输入不一致');
|
||||
return;
|
||||
}
|
||||
|
||||
const btn = document.getElementById('changePwdBtn');
|
||||
btn.disabled = true;
|
||||
btn.textContent = '更新中...';
|
||||
|
||||
hideMessages();
|
||||
|
||||
try {
|
||||
const resp = await fetch('/api/change-password', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
current_password: current,
|
||||
new_password: newPwd,
|
||||
confirm_password: confirm
|
||||
})
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
showSuccess('✅ 密码已更新');
|
||||
document.getElementById('current_password').value = '';
|
||||
document.getElementById('new_password').value = '';
|
||||
document.getElementById('confirm_password').value = '';
|
||||
} else {
|
||||
showError(data.error || '修改失败');
|
||||
}
|
||||
} catch (e) {
|
||||
showError('网络错误');
|
||||
} finally {
|
||||
btn.disabled = false;
|
||||
btn.textContent = '更 新 密 码';
|
||||
}
|
||||
});
|
||||
|
||||
function showSuccess(msg) {
|
||||
const el = document.getElementById('successMsg');
|
||||
el.textContent = msg;
|
||||
el.classList.add('show');
|
||||
document.getElementById('errorMsg').classList.remove('show');
|
||||
setTimeout(() => el.classList.remove('show'), 3000);
|
||||
}
|
||||
|
||||
function showError(msg) {
|
||||
const el = document.getElementById('errorMsg');
|
||||
el.textContent = msg;
|
||||
el.classList.add('show');
|
||||
document.getElementById('successMsg').classList.remove('show');
|
||||
}
|
||||
|
||||
function hideMessages() {
|
||||
document.getElementById('successMsg').classList.remove('show');
|
||||
document.getElementById('errorMsg').classList.remove('show');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
171
ui/templates/setup.html
Normal file
171
ui/templates/setup.html
Normal file
@ -0,0 +1,171 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>首次设置 - TrulyMEM</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body {
|
||||
font-family: 'Courier New', monospace;
|
||||
background: #0a0a1a;
|
||||
color: #ffffff;
|
||||
overflow: hidden;
|
||||
width: 100vw; height: 100vh;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
|
||||
background:
|
||||
radial-gradient(2px 2px at 20px 30px, #eee, transparent),
|
||||
radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
|
||||
radial-gradient(1px 1px at 90px 40px, #fff, transparent),
|
||||
radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
|
||||
radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
|
||||
background-repeat: repeat;
|
||||
background-size: 200px 100px;
|
||||
animation: twinkle 5s ease-in-out infinite alternate;
|
||||
z-index: 0;
|
||||
}
|
||||
@keyframes twinkle { 0% { opacity: 0.5; } 100% { opacity: 1; } }
|
||||
.setup-container {
|
||||
position: relative; z-index: 1; width: 420px; padding: 40px;
|
||||
background: rgba(10, 10, 26, 0.9);
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
box-shadow: 0 0 20px rgba(68, 136, 255, 0.2), 0 0 60px rgba(68, 136, 255, 0.1), inset 0 0 20px rgba(68, 136, 255, 0.05);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.setup-title {
|
||||
text-align: center; font-size: 26px; margin-bottom: 8px;
|
||||
color: #4488ff; text-shadow: 0 0 10px rgba(68, 136, 255, 0.5);
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
.setup-subtitle {
|
||||
text-align: center; font-size: 14px; color: #8888aa; margin-bottom: 8px;
|
||||
}
|
||||
.setup-hint {
|
||||
text-align: center; font-size: 12px; color: #666688; margin-bottom: 25px;
|
||||
}
|
||||
.form-group { margin-bottom: 18px; }
|
||||
.form-group label { display: block; margin-bottom: 6px; color: #aaaacc; font-size: 14px; }
|
||||
.form-group input {
|
||||
width: 100%; padding: 12px 16px;
|
||||
background: rgba(20, 20, 40, 0.8);
|
||||
border: 1px solid rgba(100, 100, 255, 0.3);
|
||||
border-radius: 6px; color: #ffffff;
|
||||
font-family: 'Courier New', monospace; font-size: 14px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.form-group input:focus {
|
||||
outline: none; border-color: #4488ff; box-shadow: 0 0 10px rgba(68, 136, 255, 0.3);
|
||||
}
|
||||
.form-group input::placeholder { color: #555577; }
|
||||
.setup-btn {
|
||||
width: 100%; padding: 14px;
|
||||
background: linear-gradient(135deg, rgba(68, 136, 255, 0.3), rgba(68, 136, 255, 0.1));
|
||||
border: 1px solid rgba(68, 136, 255, 0.5);
|
||||
border-radius: 6px; color: #ffffff;
|
||||
font-family: 'Courier New', monospace; font-size: 16px;
|
||||
cursor: pointer; transition: all 0.3s;
|
||||
letter-spacing: 1px; margin-top: 5px;
|
||||
}
|
||||
.setup-btn:hover {
|
||||
background: linear-gradient(135deg, rgba(68, 136, 255, 0.5), rgba(68, 136, 255, 0.3));
|
||||
box-shadow: 0 0 15px rgba(68, 136, 255, 0.4);
|
||||
}
|
||||
.setup-btn:disabled { opacity: 0.6; cursor: not-allowed; }
|
||||
.setup-btn .spinner {
|
||||
display: none; width: 16px; height: 16px;
|
||||
border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
|
||||
border-radius: 50%; animation: spin 0.6s linear infinite;
|
||||
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
|
||||
}
|
||||
.setup-btn.loading .spinner { display: block; }
|
||||
.setup-btn.loading span { visibility: hidden; }
|
||||
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
|
||||
.error-message {
|
||||
display: none; margin-top: 12px; padding: 10px;
|
||||
background: rgba(255, 68, 68, 0.15);
|
||||
border: 1px solid rgba(255, 68, 68, 0.4);
|
||||
border-radius: 6px; color: #ff6b6b; font-size: 13px; text-align: center;
|
||||
}
|
||||
.error-message.show { display: block; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="setup-container">
|
||||
<h1 class="setup-title">🚀 首次设置</h1>
|
||||
<p class="setup-subtitle">TrulyMEM Web 管理界面</p>
|
||||
<p class="setup-hint">创建管理员账户,用于登录 Web 管理界面</p>
|
||||
|
||||
<form id="setupForm">
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" id="username" name="username" placeholder="设置管理员用户名" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" id="password" name="password" placeholder="至少 6 位密码" required minlength="6">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="confirm">确认密码</label>
|
||||
<input type="password" id="confirm" name="confirm_password" placeholder="再次输入密码" required>
|
||||
</div>
|
||||
<button type="submit" class="setup-btn" id="setupBtn">
|
||||
<span>创 建 账 户</span>
|
||||
<div class="spinner"></div>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="error-message" id="errorMsg"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const setupForm = document.getElementById('setupForm');
|
||||
const setupBtn = document.getElementById('setupBtn');
|
||||
const errorMsg = document.getElementById('errorMsg');
|
||||
|
||||
setupForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const username = document.getElementById('username').value;
|
||||
const password = document.getElementById('password').value;
|
||||
const confirm = document.getElementById('confirm').value;
|
||||
|
||||
if (password !== confirm) {
|
||||
errorMsg.textContent = '两次密码输入不一致';
|
||||
errorMsg.classList.add('show');
|
||||
return;
|
||||
}
|
||||
|
||||
errorMsg.classList.remove('show');
|
||||
setupBtn.classList.add('loading');
|
||||
setupBtn.disabled = true;
|
||||
|
||||
try {
|
||||
const resp = await fetch('/api/setup', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ username, password, confirm_password: confirm })
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (data.success) {
|
||||
window.location.href = '/graph.html';
|
||||
} else {
|
||||
errorMsg.textContent = data.error || '创建失败';
|
||||
errorMsg.classList.add('show');
|
||||
}
|
||||
} catch (err) {
|
||||
errorMsg.textContent = '网络错误,请重试';
|
||||
errorMsg.classList.add('show');
|
||||
} finally {
|
||||
setupBtn.classList.remove('loading');
|
||||
setupBtn.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -42,7 +42,7 @@ class ConfigSection(Vertical):
|
||||
|
||||
yield Input(
|
||||
value=self._config.model,
|
||||
placeholder="deepseek-chat",
|
||||
placeholder="deepseek-v4-flash",
|
||||
id="model-input"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user