1. 模型选择改为两步式:先搜索选择基模型,再选择量化版本 - 自动选中默认量化版本(Q4_K_M),后台可配置 - 模型新增 base_model 字段,按基模型分组 - 后台模型管理增加基模型字段 2. 参数搜索改为全局搜索 - 搜索时跨所有分类显示匹配参数 - 隐藏分类标签页,显示匹配数量 3. 自然语言支持 LLM 接口 - 后台可配置 LLM API (URL/Key/Model/System Prompt) - 启用后优先调用 LLM 解析,失败自动回退正则解析 - 兼容 OpenAI API 格式
158 lines
8.5 KiB
HTML
158 lines
8.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>后台管理</title>
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<div id="admin-app">
|
|
<!-- Login Screen -->
|
|
<div id="login-screen" class="login-screen">
|
|
<div class="login-box">
|
|
<h2>🔒 后台管理登录</h2>
|
|
<input type="password" id="login-password" placeholder="请输入密码" onkeydown="if(event.key==='Enter')doLogin()">
|
|
<button onclick="doLogin()" class="btn-primary">登录</button>
|
|
<div id="login-error" class="login-error"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Admin Content (hidden until login) -->
|
|
<div id="admin-content" class="hidden">
|
|
<header>
|
|
<h1>⚙️ 后台管理</h1>
|
|
<div class="header-right">
|
|
<a href="/" class="admin-link">← 返回主界面</a>
|
|
<button onclick="doLogout()" class="btn-logout">退出登录</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="admin-tabs">
|
|
<button class="admin-tab active" data-tab="gpus" onclick="adminSwitchTab('gpus')">GPU 管理</button>
|
|
<button class="admin-tab" data-tab="versions" onclick="adminSwitchTab('versions')">版本管理</button>
|
|
<button class="admin-tab" data-tab="params" onclick="adminSwitchTab('params')">参数管理</button>
|
|
<button class="admin-tab" data-tab="models" onclick="adminSwitchTab('models')">模型管理</button>
|
|
<button class="admin-tab" data-tab="settings" onclick="adminSwitchTab('settings')">系统设置</button>
|
|
</div>
|
|
|
|
<!-- GPU Management -->
|
|
<section class="admin-section active" id="admin-gpus">
|
|
<h2>GPU 管理</h2>
|
|
<div class="admin-add-form">
|
|
<h3>添加新 GPU</h3>
|
|
<div class="form-row">
|
|
<input type="text" id="gpu-name" placeholder="GPU名称 (如: RTX 5090)">
|
|
<input type="number" id="gpu-vram" placeholder="显存MB" min="0">
|
|
<input type="text" id="gpu-cc" placeholder="计算能力 (如: 12.0)">
|
|
<input type="text" id="gpu-desc" placeholder="描述">
|
|
<input type="number" id="gpu-order" placeholder="排序" value="0">
|
|
<button onclick="addGpu()" class="btn-primary">添加</button>
|
|
</div>
|
|
</div>
|
|
<table class="admin-table">
|
|
<thead><tr><th>ID</th><th>名称</th><th>显存(MB)</th><th>计算能力</th><th>描述</th><th>排序</th><th>操作</th></tr></thead>
|
|
<tbody id="gpu-table-body"></tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- Version Management -->
|
|
<section class="admin-section" id="admin-versions">
|
|
<h2>llama.cpp 版本管理</h2>
|
|
<div class="admin-add-form">
|
|
<h3>添加新版本</h3>
|
|
<div class="form-row">
|
|
<input type="text" id="ver-tag" placeholder="版本标签 (如: b12000)">
|
|
<input type="text" id="ver-desc" placeholder="描述">
|
|
<input type="date" id="ver-date">
|
|
<input type="number" id="ver-order" placeholder="排序" value="0">
|
|
<button onclick="addVersion()" class="btn-primary">添加</button>
|
|
</div>
|
|
</div>
|
|
<table class="admin-table">
|
|
<thead><tr><th>ID</th><th>版本</th><th>描述</th><th>发布日期</th><th>活跃</th><th>排序</th><th>操作</th></tr></thead>
|
|
<tbody id="version-table-body"></tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- Parameter Management -->
|
|
<section class="admin-section" id="admin-params">
|
|
<h2>参数管理</h2>
|
|
<div class="control-group">
|
|
<label>选择版本</label>
|
|
<select id="admin-param-version" onchange="loadAdminParams()"></select>
|
|
</div>
|
|
<div class="admin-add-form">
|
|
<h3>添加新参数</h3>
|
|
<div class="form-grid">
|
|
<input type="text" id="param-key" placeholder="参数键 (如: ctx_size)">
|
|
<input type="text" id="param-short" placeholder="短标志 (如: -c)">
|
|
<input type="text" id="param-long" placeholder="长标志 (如: --ctx-size)">
|
|
<input type="text" id="param-desc" placeholder="描述">
|
|
<select id="param-category">
|
|
<option value="common">通用</option><option value="sampling">采样</option>
|
|
<option value="server">服务器</option><option value="model_source">模型来源</option>
|
|
<option value="lora">LoRA</option><option value="logging">日志</option>
|
|
<option value="advanced">高级</option>
|
|
</select>
|
|
<select id="param-type">
|
|
<option value="string">字符串</option><option value="number">数字</option>
|
|
<option value="boolean">布尔</option><option value="select">下拉选择</option>
|
|
</select>
|
|
<input type="text" id="param-default" placeholder="默认值">
|
|
<input type="text" id="param-options" placeholder="选项 (逗号分隔, 仅select类型)">
|
|
<input type="number" id="param-min" placeholder="最小值" step="any">
|
|
<input type="number" id="param-max" placeholder="最大值" step="any">
|
|
<input type="number" id="param-step" placeholder="步长" step="any">
|
|
<input type="text" id="param-unit" placeholder="单位">
|
|
<input type="number" id="param-important" placeholder="重要" min="0" max="1" value="0">
|
|
<input type="number" id="param-vram" placeholder="影响显存" min="0" max="1" value="0">
|
|
<input type="number" id="param-order" placeholder="排序" value="0">
|
|
<button onclick="addParam()" class="btn-primary">添加参数</button>
|
|
</div>
|
|
</div>
|
|
<table class="admin-table">
|
|
<thead><tr><th>ID</th><th>键</th><th>标志</th><th>描述</th><th>分类</th><th>类型</th><th>默认值</th><th>重要</th><th>影响显存</th><th>操作</th></tr></thead>
|
|
<tbody id="param-table-body"></tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- Model Management -->
|
|
<section class="admin-section" id="admin-models">
|
|
<h2>模型管理</h2>
|
|
<div class="admin-add-form">
|
|
<h3>添加新模型</h3>
|
|
<div class="form-grid">
|
|
<input type="text" id="model-basemodel" placeholder="基模型 (如: Llama-3-8B-Instruct)">
|
|
<input type="text" id="model-name" placeholder="完整名称 (含量化)">
|
|
<input type="number" id="model-size" placeholder="大小(GB)" step="0.1">
|
|
<input type="number" id="model-layers" placeholder="层数">
|
|
<input type="number" id="model-embd" placeholder="嵌入维度">
|
|
<input type="number" id="model-kv" placeholder="KV Heads">
|
|
<input type="number" id="model-hdim" placeholder="Head Dim">
|
|
<input type="number" id="model-heads" placeholder="Attention Heads">
|
|
<input type="text" id="model-quant" placeholder="量化 (如: Q4_K_M)">
|
|
<input type="text" id="model-desc" placeholder="描述">
|
|
<input type="number" id="model-order" placeholder="排序" value="0">
|
|
<button onclick="addModel()" class="btn-primary">添加模型</button>
|
|
</div>
|
|
</div>
|
|
<table class="admin-table">
|
|
<thead><tr><th>ID</th><th>基模型</th><th>名称</th><th>大小(GB)</th><th>层数</th><th>EMBD</th><th>KV</th><th>HD</th><th>Heads</th><th>量化</th><th>排序</th><th>操作</th></tr></thead>
|
|
<tbody id="model-table-body"></tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<!-- Settings -->
|
|
<section class="admin-section" id="admin-settings">
|
|
<h2>系统设置</h2>
|
|
<div class="settings-form" id="settings-form"></div>
|
|
<button onclick="saveSettings()" class="btn-primary">💾 保存设置</button>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/js/admin.js"></script>
|
|
</body>
|
|
</html>
|