9 Commits

Author SHA1 Message Date
e2d35b6fa0 feat: 支持多图上传和智能解析产品参数
- 新增 /api/parse-images API 预览解析结果
- 智能添加支持多张图片上传和粘贴
- 支持一次解析出多个产品参数
- 所有类别(模型/GPU/CPU/动态分类)都支持图片解析
- 添加 vision_model 配置支持视觉模型
2026-04-27 18:29:06 +08:00
45190980a9 feat: 发布日期、热度、置顶、图片上传功能
- 新增发布日期(publish_date)、热度(views)、置顶(is_pinned)字段
- 后台管理表格显示新字段和置顶操作按钮
- 前端默认排序:置顶优先 → 发布日期最新
- 新增多种排序选项:发布日期、热度、名称等
- 新增图片上传API(支持多图上传)
- 后台管理表单添加图片上传组件(支持文件选择和粘贴)
- 数据创建时自动初始化新字段
2026-04-20 21:25:57 +08:00
627148a87f feat: 知识库数据添加显示开关功能
- knowledge API添加visible字段支持
- 前台过滤隐藏的知识条目(默认)
- 后台显示全部知识条目(all=1)
- 新增toggle knowledge visible API
- 知识库表格增加显示开关列
2026-04-11 02:32:10 +08:00
74be7688c9 feat: v1.2.0 新增网站配置管理功能
新功能:
- 后台管理新增'网站配置'菜单
- 支持配置:网站名称、副标题、备案号、联系邮箱、GitHub、页脚文字
- 前台页面自动读取配置显示
- 页脚支持备案号链接

配置存储在 data/config.json
2026-04-11 02:27:21 +08:00
7a2b1da9ff fix: 后台管理显示全部数据,包括隐藏的
- 分类API添加all=1参数
- 动态分类数据API添加all=1参数
- 动态分类表格增加显示开关列
- 所有表格的眼睛按钮添加title提示
- 隐藏数据用灰色背景/透明度区分
- showRawData支持动态分类数据
2026-04-11 02:12:55 +08:00
dfd7234fd6 fix: 修复模型排序错误,改名为大模型管理
- 修复智能添加创建的不完整数据导致排序错误
- 添加安全排序函数处理缺失字段
- 改名:模型管理 → 大模型管理
- 清理测试数据
2026-04-11 02:06:06 +08:00
22b1a78132 fix: 修复后台管理页面JS语法错误(getCategoryForm重复) 2026-04-11 02:00:20 +08:00
d28ad1a292 feat: v1.1.0 新增智能添加和展示开关功能
功能更新:
- 新增智能添加功能:粘贴文本自动解析为结构化数据
- 新增展示开关:各分类和产品支持显示/隐藏控制
- 保留原始数据:智能添加的产品保留raw_text字段
- 优化价格显示:支持多币种、价格区间、单位
- 修复图标问题:CPU图标改为ri-cpu-line
- 新增favicon:所有页面添加浏览器标签图标

技术改进:
- 新增大模型API集成(LLM Proxy)
- 新增smart-add API接口
- 新增visible字段和toggle API
- 优化前端表格显示
2026-04-11 01:54:28 +08:00
1b22718d5a fix: 所有页面导航栏统一动态加载类别
修复:各页面顶部导航栏添加 loadNav() 调用,确保所有页面显示一致的类别列表
2026-04-09 12:42:06 +08:00
15 changed files with 2112 additions and 215 deletions

969
app.py

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@
{
"id": "cpus",
"name": "CPU处理器",
"icon": "ri-memory-line",
"icon": "ri-cpu-line",
"color": "purple",
"description": "Intel、AMD等CPU处理器参数",
"order": 3
@@ -29,7 +29,8 @@
"icon": "ri-smartphone-line",
"color": "orange",
"description": "各品牌手机参数规格",
"order": 4
"order": 4,
"visible": false
},
{
"id": "laptops",
@@ -42,8 +43,8 @@
{
"id": "021dc76d36be",
"name": "汽车",
"icon": "ri-folder-line",
"color": "blue",
"icon": "ri-car-line",
"color": "red",
"order": 6,
"description": "汽车方面",
"created_at": "2026-04-09 10:09:01"

10
data/config.json Normal file
View File

@@ -0,0 +1,10 @@
{
"site_name": "ParamHub",
"site_subtitle": "参数百科",
"footer_text": "ParamHub - 模型与硬件参数速查平台",
"icp_number": "",
"copyright_year": "2026",
"contact_email": "wlq@tphai.com",
"github_url": "",
"updated_at": "2026-04-11 02:28:39"
}

View File

@@ -7,5 +7,28 @@
"category_id": "021dc76d36be",
"id": "3d20dbcd4bdd",
"created_at": "2026-04-09 10:09:56"
},
{
"name": "秦PLUS",
"brand": "比亚迪",
"price": 5.98,
"specs": {
"长宽高": "4780*1837*1515mm",
"轴距": "2718mm",
"前轮距": "1580mm",
"后轮距": "1590mm",
"轮胎规格": "225/60 R16",
"发动机": "1.5L 101马力 L4",
"最大功率": "74kW",
"最大扭矩": "126N·m",
"变速器": "E-CVT无级变速器",
"中控屏幕尺寸": "10.1英寸"
},
"description": "秦PLUS是一款外观设计极具现代感和运动气息的车型采用家族化设计语言配备大尺寸进气格栅和锐利LED大灯。车身线条流畅内饰简洁大气配备10.1英寸中控屏和语音识别系统。搭载1.5L发动机和E-CVT变速器提供平稳动力输出和低油耗。内部空间宽敞座椅舒适支持多种调节功能。",
"id": "b78fc7983a70",
"category_id": "021dc76d36be",
"created_at": "2026-04-11 02:03:45",
"visible": true,
"raw_text": "秦PLUS的外观设计极具现代感和运动气息前脸采用了家族化设计语言标志性的大尺寸进气格栅占据了前脸的大部分空间搭配锐利的LED大灯组营造出强烈的视觉冲击力。车身线条流畅腰线从车头贯穿至车尾增强了整车的运动感。车尾部分简洁大方的设计与前脸相呼应整体风格时尚而不失稳重。\n\n上海秦PLUS优惠促销最新报价5.98万!轻松开新车\n\n秦PLUS拥有4780*1837*1515mm的长宽高尺寸和2718mm的轴距赋予其宽敞的内部空间。车侧线条流畅且动感十足从前轮距1580mm到后轮距1590mm车轮布局合理增强了车辆的稳定性和操控性。配备的225/60 R16轮胎规格匹配独特风格的轮圈为车辆增添了一抹动感与时尚的气息。\n\n上海秦PLUS优惠促销最新报价5.98万!轻松开新车\n\n秦PLUS的内饰风格简洁大气给人以科技感和舒适感。中控台布局合理配备了10.1英寸的中控屏幕支持语音识别控制系统可轻松操作多媒体系统、导航、电话和空调等功能。方向盘采用皮质材料手感舒适支持手动上下和前后调节方便驾驶员调整到最佳驾驶姿势。座椅采用仿皮材质主驾驶座椅具备前后调节、靠背调节和高低调节功能而副驾驶座椅则支持前后调节和靠背调节确保了乘客的舒适度。后排座椅可以按比例放倒增加储物空间同时车内还配备了USB和Type-C接口方便乘客为电子设备充电。\n\n上海秦PLUS优惠促销最新报价5.98万!轻松开新车\n\n秦PLUS搭载了一台1.5L 101马力的L4发动机最大功率为74kW最大扭矩为126N·m。与之匹配的是E-CVT无级变速器这使得车辆在提供平稳的动力输出的同时还能有效降低油耗。\n\n汽车之家车主@天艺风云 表示外观设计是他当初选择秦PLUS的原因之一。他赞赏整体造型时尚大气龙脸设计搭配犀利的大灯辨识度极高。车身线条流畅溜背式造型增添了几分运动感。全新的“龙鳞辉熠”格栅精致又霸气每次停车都有人问这是什么车外观确实很吸引人。"
}
]

View File

@@ -1,14 +1,195 @@
[
{"id": "gpt4", "name": "GPT-4", "organization": "OpenAI", "parameters": 1760, "architecture": "Transformer", "context_length": 8192, "input_price": 0.03, "output_price": 0.06, "mmlu": 86.4, "humaneval": 67.0, "is_open_source": false, "license": "Proprietary", "description": "OpenAI最强大的多模态大模型", "created_at": "2024-01-01"},
{"id": "gpt4turbo", "name": "GPT-4 Turbo", "organization": "OpenAI", "parameters": 1760, "architecture": "Transformer", "context_length": 128000, "input_price": 0.01, "output_price": 0.03, "mmlu": 86.4, "humaneval": 67.0, "is_open_source": false, "license": "Proprietary", "description": "GPT-4增强版128K上下文", "created_at": "2024-01-01"},
{"id": "gpt35", "name": "GPT-3.5 Turbo", "organization": "OpenAI", "parameters": 175, "architecture": "Transformer", "context_length": 16385, "input_price": 0.0005, "output_price": 0.0015, "mmlu": 70.0, "humaneval": 48.1, "is_open_source": false, "license": "Proprietary", "description": "性价比高的通用模型", "created_at": "2024-01-01"},
{"id": "claude3opus", "name": "Claude 3 Opus", "organization": "Anthropic", "parameters": 400, "architecture": "Transformer", "context_length": 200000, "input_price": 0.015, "output_price": 0.075, "mmlu": 86.8, "humaneval": 84.9, "is_open_source": false, "license": "Proprietary", "description": "Anthropic最强模型200K上下文", "created_at": "2024-01-01"},
{"id": "claude3sonnet", "name": "Claude 3 Sonnet", "organization": "Anthropic", "parameters": 175, "architecture": "Transformer", "context_length": 200000, "input_price": 0.003, "output_price": 0.015, "mmlu": 79.0, "humaneval": 73.0, "is_open_source": false, "license": "Proprietary", "description": "平衡性能与成本", "created_at": "2024-01-01"},
{"id": "llama270b", "name": "Llama 2 70B", "organization": "Meta", "parameters": 70, "architecture": "Transformer", "context_length": 4096, "input_price": 0, "output_price": 0, "mmlu": 69.8, "humaneval": 29.9, "is_open_source": true, "license": "Llama 2 Community", "description": "Meta开源大模型70B参数", "created_at": "2024-01-01"},
{"id": "llama3", "name": "Llama 3 70B", "organization": "Meta", "parameters": 70, "architecture": "Transformer", "context_length": 8192, "input_price": 0, "output_price": 0, "mmlu": 82.0, "humaneval": 81.7, "is_open_source": true, "license": "Llama 3 Community", "description": "Meta最新开源模型性能接近GPT-4", "created_at": "2024-01-01"},
{"id": "mistral7b", "name": "Mistral 7B", "organization": "Mistral AI", "parameters": 7, "architecture": "Transformer", "context_length": 32768, "input_price": 0, "output_price": 0, "mmlu": 62.5, "humaneval": 26.8, "is_open_source": true, "license": "Apache 2.0", "description": "小巧高效的开源模型", "created_at": "2024-01-01"},
{"id": "mixtral8x7b", "name": "Mixtral 8x7B", "organization": "Mistral AI", "parameters": 47, "architecture": "MoE", "context_length": 32768, "input_price": 0, "output_price": 0, "mmlu": 70.6, "humaneval": 40.2, "is_open_source": true, "license": "Apache 2.0", "description": "MoE架构高效推理", "created_at": "2024-01-01"},
{"id": "qwen72b", "name": "Qwen 72B", "organization": "Alibaba", "parameters": 72, "architecture": "Transformer", "context_length": 32768, "input_price": 0, "output_price": 0, "mmlu": 83.1, "humaneval": 65.4, "is_open_source": true, "license": "Apache 2.0", "description": "阿里开源大模型,中文能力强", "created_at": "2024-01-01"},
{"id": "deepseekv3", "name": "DeepSeek V3", "organization": "DeepSeek", "parameters": 685, "architecture": "MoE", "context_length": 128000, "input_price": 0.00014, "output_price": 0.00028, "mmlu": 88.5, "humaneval": 86.2, "is_open_source": true, "license": "MIT", "description": "DeepSeek最新模型性价比极高", "created_at": "2024-01-01"},
{"id": "glm4", "name": "GLM-4", "organization": "Zhipu AI", "parameters": 130, "architecture": "Transformer", "context_length": 128000, "input_price": 0.014, "output_price": 0.014, "mmlu": 81.0, "humaneval": 70.0, "is_open_source": false, "license": "Proprietary", "description": "智谱AI大模型中文能力强", "created_at": "2024-01-01"}
{
"id": "gpt4",
"name": "GPT-4",
"organization": "OpenAI",
"parameters": 1760,
"architecture": "Transformer",
"context_length": 8192,
"input_price": 0.03,
"output_price": 0.06,
"mmlu": 86.4,
"humaneval": 67.0,
"is_open_source": false,
"license": "Proprietary",
"description": "OpenAI最强大的多模态大模型",
"created_at": "2024-01-01"
},
{
"id": "gpt4turbo",
"name": "GPT-4 Turbo",
"organization": "OpenAI",
"parameters": 1760,
"architecture": "Transformer",
"context_length": 128000,
"input_price": 0.01,
"output_price": 0.03,
"mmlu": 86.4,
"humaneval": 67.0,
"is_open_source": false,
"license": "Proprietary",
"description": "GPT-4增强版128K上下文",
"created_at": "2024-01-01"
},
{
"id": "gpt35",
"name": "GPT-3.5 Turbo",
"organization": "OpenAI",
"parameters": 175,
"architecture": "Transformer",
"context_length": 16385,
"input_price": 0.0005,
"output_price": 0.0015,
"mmlu": 70.0,
"humaneval": 48.1,
"is_open_source": false,
"license": "Proprietary",
"description": "性价比高的通用模型",
"created_at": "2024-01-01"
},
{
"id": "claude3opus",
"name": "Claude 3 Opus",
"organization": "Anthropic",
"parameters": 400,
"architecture": "Transformer",
"context_length": 200000,
"input_price": 0.015,
"output_price": 0.075,
"mmlu": 86.8,
"humaneval": 84.9,
"is_open_source": false,
"license": "Proprietary",
"description": "Anthropic最强模型200K上下文",
"created_at": "2024-01-01"
},
{
"id": "claude3sonnet",
"name": "Claude 3 Sonnet",
"organization": "Anthropic",
"parameters": 175,
"architecture": "Transformer",
"context_length": 200000,
"input_price": 0.003,
"output_price": 0.015,
"mmlu": 79.0,
"humaneval": 73.0,
"is_open_source": false,
"license": "Proprietary",
"description": "平衡性能与成本",
"created_at": "2024-01-01"
},
{
"id": "llama270b",
"name": "Llama 2 70B",
"organization": "Meta",
"parameters": 70,
"architecture": "Transformer",
"context_length": 4096,
"input_price": 0,
"output_price": 0,
"mmlu": 69.8,
"humaneval": 29.9,
"is_open_source": true,
"license": "Llama 2 Community",
"description": "Meta开源大模型70B参数",
"created_at": "2024-01-01"
},
{
"id": "llama3",
"name": "Llama 3 70B",
"organization": "Meta",
"parameters": 70,
"architecture": "Transformer",
"context_length": 8192,
"input_price": 0,
"output_price": 0,
"mmlu": 82.0,
"humaneval": 81.7,
"is_open_source": true,
"license": "Llama 3 Community",
"description": "Meta最新开源模型性能接近GPT-4",
"created_at": "2024-01-01"
},
{
"id": "mistral7b",
"name": "Mistral 7B",
"organization": "Mistral AI",
"parameters": 7,
"architecture": "Transformer",
"context_length": 32768,
"input_price": 0,
"output_price": 0,
"mmlu": 62.5,
"humaneval": 26.8,
"is_open_source": true,
"license": "Apache 2.0",
"description": "小巧高效的开源模型",
"created_at": "2024-01-01"
},
{
"id": "mixtral8x7b",
"name": "Mixtral 8x7B",
"organization": "Mistral AI",
"parameters": 47,
"architecture": "MoE",
"context_length": 32768,
"input_price": 0,
"output_price": 0,
"mmlu": 70.6,
"humaneval": 40.2,
"is_open_source": true,
"license": "Apache 2.0",
"description": "MoE架构高效推理",
"created_at": "2024-01-01"
},
{
"id": "qwen72b",
"name": "Qwen 72B",
"organization": "Alibaba",
"parameters": 72,
"architecture": "Transformer",
"context_length": 32768,
"input_price": 0,
"output_price": 0,
"mmlu": 83.1,
"humaneval": 65.4,
"is_open_source": true,
"license": "Apache 2.0",
"description": "阿里开源大模型,中文能力强",
"created_at": "2024-01-01"
},
{
"id": "deepseekv3",
"name": "DeepSeek V3",
"organization": "DeepSeek",
"parameters": 685,
"architecture": "MoE",
"context_length": 128000,
"input_price": 0.00014,
"output_price": 0.00028,
"mmlu": 88.5,
"humaneval": 86.2,
"is_open_source": true,
"license": "MIT",
"description": "DeepSeek最新模型性价比极高",
"created_at": "2024-01-01"
},
{
"id": "glm4",
"name": "GLM-4",
"organization": "Zhipu AI",
"parameters": 130,
"architecture": "Transformer",
"context_length": 128000,
"input_price": 0.014,
"output_price": 0.014,
"mmlu": 81.0,
"humaneval": 70.0,
"is_open_source": false,
"license": "Proprietary",
"description": "智谱AI大模型中文能力强",
"created_at": "2024-01-01",
"visible": true
}
]

14
static/favicon.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
<!-- 背景 -->
<rect x="2" y="2" width="28" height="28" rx="6" fill="#4f46e5"/>
<!-- 数据网格 -->
<rect x="6" y="6" width="8" height="8" rx="2" fill="white"/>
<rect x="18" y="6" width="8" height="8" rx="2" fill="white"/>
<rect x="6" y="18" width="8" height="8" rx="2" fill="white"/>
<rect x="18" y="18" width="8" height="8" rx="2" fill="white"/>
<!-- 连接线 -->
<line x1="14" y1="10" x2="18" y2="10" stroke="#4f46e5" stroke-width="2"/>
<line x1="10" y1="14" x2="10" y2="18" stroke="#4f46e5" stroke-width="2"/>
<line x1="22" y1="14" x2="22" y2="18" stroke="#4f46e5" stroke-width="2"/>
<line x1="14" y1="22" x2="18" y2="22" stroke="#4f46e5" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 757 B

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ category.name }} - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -50,9 +51,16 @@
class="w-full pl-12 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:border-indigo-400"
onkeyup="filterItems()">
</div>
<select id="sortSelect" onchange="sortItems()" class="px-4 py-2 border border-gray-200 rounded-lg focus:outline-none">
<select id="sortBy" onchange="loadItems()" class="px-4 py-2 border border-gray-200 rounded-lg focus:outline-none">
<option value="default">默认排序(置顶优先)</option>
<option value="publish_date">按发布日期</option>
<option value="views">按热度</option>
<option value="name">按名称</option>
<option value="created_at">按时间</option>
<option value="created_at">创建时间</option>
</select>
<select id="sortOrder" onchange="loadItems()" class="px-4 py-2 border border-gray-200 rounded-lg focus:outline-none">
<option value="desc">降序</option>
<option value="asc">升序</option>
</select>
</div>
</div>
@@ -115,7 +123,9 @@
// 加载数据
async function loadItems() {
const res = await fetch(`/api/items/${categoryId}`);
const sortBy = document.getElementById('sortBy').value;
const sortOrder = document.getElementById('sortOrder').value;
const res = await fetch(`/api/items/${categoryId}?sort=${sortBy}&order=${sortOrder}`);
allItems = await res.json();
document.getElementById('itemCount').textContent = allItems.length;
@@ -136,22 +146,28 @@
document.getElementById('itemsList').innerHTML = items.map(item => {
const fields = Object.entries(item)
.filter(([key, val]) => !['id', 'category_id', 'created_at', 'updated_at'].includes(key) && val)
.filter(([key, val]) => !['id', 'category_id', 'created_at', 'updated_at', 'visible', 'is_pinned', 'views', 'publish_date'].includes(key) && val)
.slice(0, 5)
.map(([key, val]) => `<span class="text-gray-500 text-sm">${key}: ${val}</span>`)
.join('<br>');
return `
<div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition group">
<div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition group ${item.is_pinned ? 'bg-yellow-50 border-yellow-300' : ''}">
<div class="flex items-start justify-between">
<div>
<h3 class="font-medium text-gray-800 group-hover:text-indigo-600">${item.name || item.title || '未命名'}</h3>
<h3 class="font-medium text-gray-800 group-hover:text-indigo-600 flex items-center gap-2">
${item.is_pinned ? '<i class="ri-pushpin-fill text-yellow-500" title="置顶"></i>' : ''}
${item.name || item.title || '未命名'}
</h3>
<div class="mt-2 space-y-1">
${fields}
</div>
</div>
<div class="text-xs text-gray-400">
${item.created_at ? item.created_at.split(' ')[0] : ''}
<div class="text-right">
<div class="text-xs text-gray-400">
${item.publish_date || (item.created_at ? item.created_at.split(' ')[0] : '')}
</div>
${item.views ? `<div class="text-xs text-gray-400 mt-1"><i class="ri-eye-line"></i> ${item.views}</div>` : ''}
</div>
</div>
</div>
@@ -175,19 +191,6 @@
renderItems(filtered);
}
// 排序
function sortItems() {
const sortBy = document.getElementById('sortSelect').value;
const sorted = [...allItems].sort((a, b) => {
if (sortBy === 'name') {
return (a.name || a.title || '').localeCompare(b.name || b.title || '');
} else {
return (b.created_at || '').localeCompare(a.created_at || '');
}
});
renderItems(sorted);
}
// 初始化
loadNav();
loadItems();

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>对比工具 - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -40,7 +41,7 @@
<i class="ri-cpu-line mr-2"></i>GPU对比
</button>
<button onclick="setCompareType('cpu')" id="btnCpu" class="px-4 py-2 bg-gray-200 text-gray-600 rounded-lg hover:bg-gray-300">
<i class="ri-memory-line mr-2"></i>CPU对比
<i class="ri-cpu-line mr-2"></i>CPU对比
</button>
</div>
</div>
@@ -230,6 +231,7 @@ let compareType = 'model';
}
// 初始化
loadNav();
setCompareType('model');
</script>
</body>

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CPU数据库 - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -24,7 +25,7 @@
<main class="max-w-7xl mx-auto px-4 py-8">
<div class="mb-6">
<h1 class="text-2xl font-bold text-gray-800 flex items-center gap-2">
<i class="ri-memory-line text-purple-600"></i>
<i class="ri-cpu-line text-purple-600"></i>
CPU数据库
</h1>
<p class="text-gray-500 mt-1">处理器规格参数一览</p>
@@ -208,6 +209,8 @@ async function loadCpus() {
if (e.target === this) closeModal();
});
// 初始化
loadNav();
loadCpus();
</script>
</body>

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GPU数据库 - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -215,6 +216,8 @@ async function loadGpus() {
if (e.target === this) closeModal();
});
// 初始化
loadNav();
loadGpus();
</script>
</body>

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ParamHub - 参数百科</title>
<title id="pageTitle">ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -13,8 +14,8 @@
<div class="max-w-7xl mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center gap-2">
<i class="ri-dashboard-3-line text-2xl text-indigo-600"></i>
<span class="text-xl font-bold text-gray-800">ParamHub</span>
<span class="text-sm text-gray-500">参数百科</span>
<span class="text-xl font-bold text-gray-800" id="navSiteName">ParamHub</span>
<span class="text-sm text-gray-500" id="navSiteSubtitle">参数百科</span>
</div>
<div class="flex gap-4 text-sm" id="navLinks">
<!-- 动态加载 -->
@@ -58,7 +59,7 @@
<!-- 热门模型 -->
<div class="bg-white rounded-xl shadow-sm p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center gap-2">
<i class="ri-flashlight-line text-indigo-600"></i>
<i class="ri-cpu-line text-indigo-600"></i>
热门模型
</h2>
<div id="latestModels" class="grid grid-cols-2 gap-4">
@@ -69,7 +70,7 @@
<!-- 页脚 -->
<footer class="bg-white border-t mt-8 py-6 text-center text-gray-500 text-sm">
ParamHub - 参数百科 | AI模型与硬件参数速查平台
<span id="footerText">ParamHub - 参数百科 | AI模型与硬件参数速查平台</span>
</footer>
<script>
@@ -120,13 +121,32 @@
// 加载分类和数据统计
async function loadData() {
// 并行加载分类统计
const [catRes, statsRes] = await Promise.all([
// 并行加载分类统计、配置
const [catRes, statsRes, configRes] = await Promise.all([
fetch('/api/categories'),
fetch('/api/stats')
fetch('/api/stats'),
fetch('/api/config')
]);
categories = await catRes.json();
const stats = await statsRes.json();
const config = await configRes.json();
// 更新网站名称等
if (config.site_name) {
document.getElementById('navSiteName').textContent = config.site_name;
}
if (config.site_subtitle) {
document.getElementById('navSiteSubtitle').textContent = config.site_subtitle;
}
if (config.site_name && config.site_subtitle) {
document.getElementById('pageTitle').textContent = `${config.site_name} - ${config.site_subtitle}`;
}
if (config.footer_text) {
document.getElementById('footerText').textContent = config.footer_text;
}
if (config.icp_number) {
document.getElementById('footerText').innerHTML += ` | <a href="https://beian.miit.gov.cn/" target="_blank" class="hover:text-gray-700">${config.icp_number}</a>`;
}
// 渲染导航栏
renderNavBar();
@@ -146,7 +166,7 @@
const statItems = [
{key: 'models_count', label: 'AI模型', icon: 'ri-robot-line', color: 'blue'},
{key: 'gpus_count', label: 'GPU显卡', icon: 'ri-cpu-line', color: 'green'},
{key: 'cpus_count', label: 'CPU处理器', icon: 'ri-memory-line', color: 'purple'},
{key: 'cpus_count', label: 'CPU处理器', icon: 'ri-cpu-line', color: 'purple'},
{key: 'knowledge_count', label: '知识条目', icon: 'ri-book-open-line', color: 'teal'}
];

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>知识库 - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -75,7 +76,7 @@
<!-- 显存计算 -->
<div class="bg-white rounded-xl shadow-sm p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center gap-2">
<i class="ri-memory-line text-orange-600"></i>
<i class="ri-cpu-line text-orange-600"></i>
如何计算显存需求?
</h2>
<p class="text-gray-600 leading-relaxed">
@@ -177,5 +178,43 @@
</table>
</div>
</main>
<script>
let categories = [];
// 加载导航栏
async function loadNav() {
const res = await fetch('/api/categories');
categories = await res.json();
const builtinPages = [
{name: '首页', href: '/'},
{name: '工具', href: '/tools'},
{name: '对比', href: '/compare'},
{name: '知识库', href: '/knowledge'}
];
const categoryPages = {
'ai-models': '/models',
'gpus': '/gpus',
'cpus': '/cpus'
};
let navHtml = '';
builtinPages.forEach(p => {
const isActive = window.location.pathname === p.href;
navHtml += `<a href="${p.href}" class="${isActive ? 'text-indigo-600 font-medium' : 'text-gray-600 hover:text-indigo-600'}">${p.name}</a>`;
});
categories.forEach(cat => {
const href = categoryPages[cat.id] || `/category/${cat.id}`;
navHtml += `<a href="${href}" class="text-gray-600 hover:text-indigo-600">${cat.name}</a>`;
});
document.getElementById('topNav').innerHTML = navHtml;
}
loadNav();
</script>
</body>
</html>

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>模型数据库 - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -41,14 +42,18 @@
oninput="loadModels()">
</div>
<select id="sortBy" class="px-4 py-2 border border-gray-200 rounded-lg" onchange="loadModels()">
<option value="default">默认排序(置顶优先)</option>
<option value="publish_date">按发布日期</option>
<option value="views">按热度</option>
<option value="name">按名称</option>
<option value="parameters">按参数量</option>
<option value="mmlu">按MMLU分数</option>
<option value="context_length">按上下文长度</option>
<option value="created_at">按创建时间</option>
</select>
<select id="sortOrder" class="px-4 py-2 border border-gray-200 rounded-lg" onchange="loadModels()">
<option value="asc">升序</option>
<option value="desc">降序</option>
<option value="asc">升序</option>
</select>
<select id="filterType" class="px-4 py-2 border border-gray-200 rounded-lg" onchange="loadModels()">
<option value="all">全部</option>
@@ -162,10 +167,15 @@
}
const html = models.map(m => `
<tr class="border-b hover:bg-gray-50 transition">
<tr class="border-b hover:bg-gray-50 transition ${m.is_pinned ? 'bg-yellow-50' : ''}">
<td class="px-4 py-3">
<div class="font-medium text-gray-800">${m.name}</div>
<div class="text-xs text-gray-500">${m.architecture || ''}</div>
<div class="flex items-center gap-2">
${m.is_pinned ? '<i class="ri-pushpin-fill text-yellow-500" title="置顶"></i>' : ''}
<div>
<div class="font-medium text-gray-800">${m.name}</div>
<div class="text-xs text-gray-500">${m.architecture || ''}</div>
</div>
</div>
</td>
<td class="px-4 py-3 text-gray-600">${m.organization}</td>
<td class="px-4 py-3">

View File

@@ -3,7 +3,8 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>实用工具 - ParamHub</title>
<title>ParamHub - 参数百科</title>
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
</head>
@@ -33,7 +34,7 @@
<!-- 显存计算器 -->
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4 flex items-center gap-2">
<i class="ri-memory-line text-green-600"></i>
<i class="ri-cpu-line text-green-600"></i>
显存计算器
</h2>
<p class="text-gray-500 mb-4">计算大模型所需的显存大小并推荐合适的GPU</p>
@@ -197,6 +198,9 @@ async function calculateVram() {
document.getElementById('vramResult').classList.remove('hidden');
}
// 初始化
loadNav();
</script>
</body>
</html>