feat: ParamHub参数百科Python版
功能: - 模型数据库 (12个模型) - GPU数据库 (10个GPU) - CPU数据库 (8个CPU) - 显存计算器 - 对比工具 - 知识库
This commit is contained in:
193
templates/gpus.html
Normal file
193
templates/gpus.html
Normal file
@@ -0,0 +1,193 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>GPU数据库 - ParamHub</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen">
|
||||
<!-- 导航栏 -->
|
||||
<nav class="bg-white shadow-sm sticky top-0 z-50">
|
||||
<div class="max-w-7xl mx-auto px-4 py-3 flex justify-between items-center">
|
||||
<a href="/" 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>
|
||||
</a>
|
||||
<div class="flex gap-6 text-sm">
|
||||
<a href="/" class="text-gray-600 hover:text-indigo-600">首页</a>
|
||||
<a href="/models" class="text-gray-600 hover:text-indigo-600">模型</a>
|
||||
<a href="/gpus" class="text-indigo-600 font-medium">GPU</a>
|
||||
<a href="/cpus" class="text-gray-600 hover:text-indigo-600">CPU</a>
|
||||
<a href="/tools" class="text-gray-600 hover:text-indigo-600">工具</a>
|
||||
<a href="/compare" class="text-gray-600 hover:text-indigo-600">对比</a>
|
||||
<a href="/knowledge" class="text-gray-600 hover:text-indigo-600">知识库</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<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-cpu-line text-green-600"></i>
|
||||
GPU数据库
|
||||
</h1>
|
||||
<p class="text-gray-500 mt-1">显卡规格参数一览</p>
|
||||
</div>
|
||||
|
||||
<!-- 搜索 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-4 mb-6">
|
||||
<div class="relative">
|
||||
<i class="ri-search-line absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
|
||||
<input type="text" id="searchInput" placeholder="搜索GPU名称或厂商..."
|
||||
class="w-full pl-10 pr-4 py-2 border border-gray-200 rounded-lg focus:outline-none focus:border-green-400"
|
||||
oninput="loadGpus()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- GPU列表 -->
|
||||
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
|
||||
<table class="w-full">
|
||||
<thead class="bg-gray-50 border-b">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">GPU名称</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">厂商</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">架构</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">显存</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">CUDA核心</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">FP16性能</th>
|
||||
<th class="px-4 py-3 text-left text-sm font-medium text-gray-600">价格</th>
|
||||
<th class="px-4 py-3 text-center text-sm font-medium text-gray-600">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="gpusTable">
|
||||
<tr><td colspan="8" class="text-center text-gray-400 py-8">加载中...</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<div id="detailModal" class="fixed inset-0 bg-black/50 z-50 hidden flex items-center justify-center">
|
||||
<div class="bg-white rounded-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-auto">
|
||||
<div class="p-6 border-b flex justify-between items-center">
|
||||
<h2 class="text-xl font-bold text-gray-800" id="modalTitle">GPU详情</h2>
|
||||
<button onclick="closeModal()" class="text-gray-400 hover:text-gray-600">
|
||||
<i class="ri-close-line text-2xl"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div id="modalContent" class="p-6"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function loadGpus() {
|
||||
const keyword = document.getElementById('searchInput').value.trim();
|
||||
let url = '/api/gpus';
|
||||
if (keyword) url += `?q=${encodeURIComponent(keyword)}`;
|
||||
|
||||
const res = await fetch(url);
|
||||
const gpus = await res.json();
|
||||
|
||||
if (gpus.length === 0) {
|
||||
document.getElementById('gpusTable').innerHTML = `
|
||||
<tr><td colspan="8" class="text-center text-gray-400 py-8">暂无数据</td></tr>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
const html = gpus.map(g => `
|
||||
<tr class="border-b hover:bg-gray-50 transition">
|
||||
<td class="px-4 py-3">
|
||||
<div class="font-medium text-gray-800">${g.name}</div>
|
||||
<div class="text-xs text-gray-500">${g.release_year || ''}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-600">${g.manufacturer}</td>
|
||||
<td class="px-4 py-3 text-gray-600">${g.architecture}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="px-2 py-1 bg-green-100 text-green-700 rounded text-sm">${g.memory_gb}GB</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-gray-600">${g.cuda_cores || '-'}</td>
|
||||
<td class="px-4 py-3 text-gray-600">${g.fp16_tflops || '-'} TF</td>
|
||||
<td class="px-4 py-3 text-gray-600">$${g.price_usd || '-'}</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<button onclick="showDetail('${g.id}')" class="text-green-600 hover:text-green-800 text-sm">
|
||||
<i class="ri-eye-line mr-1"></i>详情
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
`).join('');
|
||||
|
||||
document.getElementById('gpusTable').innerHTML = html;
|
||||
}
|
||||
|
||||
async function showDetail(id) {
|
||||
const res = await fetch(`/api/gpus/${id}`);
|
||||
const gpu = await res.json();
|
||||
|
||||
document.getElementById('modalTitle').textContent = gpu.name;
|
||||
document.getElementById('modalContent').innerHTML = `
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">厂商</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.manufacturer}</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">架构</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.architecture}</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">显存</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.memory_gb}GB</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">显存带宽</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.memory_bandwidth_gbs || '-'} GB/s</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">CUDA核心</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.cuda_cores || '-'}</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">Tensor核心</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.tensor_cores || '-'}</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">FP32性能</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.fp32_tflops || '-'} TFLOPS</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">FP16性能</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.fp16_tflops || '-'} TFLOPS</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">INT8性能</div>
|
||||
<div class="font-medium text-gray-800 mt-1">${gpu.int8_perf_tops || '-'} TOPS</div>
|
||||
</div>
|
||||
<div class="p-4 bg-gray-50 rounded-lg">
|
||||
<div class="text-sm text-gray-500">价格</div>
|
||||
<div class="font-medium text-gray-800 mt-1">$${gpu.price_usd || '-'}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4 p-4 bg-green-50 rounded-lg">
|
||||
<div class="text-sm text-green-600">简介</div>
|
||||
<div class="text-gray-800 mt-1">${gpu.description || '暂无描述'}</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.getElementById('detailModal').classList.remove('hidden');
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('detailModal').classList.add('hidden');
|
||||
}
|
||||
|
||||
document.getElementById('detailModal').addEventListener('click', function(e) {
|
||||
if (e.target === this) closeModal();
|
||||
});
|
||||
|
||||
loadGpus();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user