Files
llama-cmd-gen/static/admin.html
T
hz4th_coder a407032b4d feat: llama.cpp 命令生成器 v1.0.0
- 支持多版本 llama.cpp 参数 (b6310, b10068)
- GPU 模式 / GPU+CPU 模式
- 多 GPU 支持 (最多4张)
- 实时显存/内存估算
- 自然语言解析生成命令
- 参数分级显示 (重要/隐藏)
- 仅输出非默认值参数
- 后台管理 (GPU/版本/参数 CRUD)
- 模型预设 (7B-70B)
2026-07-19 18:08:36 +08:00

156 lines
6.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>llama.cpp 命令生成器 - 后台管理</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div id="admin-app">
<header>
<h1>⚙️ 后台管理</h1>
<div class="header-right">
<a href="/" class="admin-link">← 返回主界面</a>
</div>
</header>
<!-- Tabs -->
<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="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>
<!-- 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>
<script src="/js/admin.js"></script>
</body>
</html>