1. 模型对比列表调通

This commit is contained in:
2026-01-20 22:24:11 +08:00
parent 41d53fc10f
commit 86e1fc4c18
4 changed files with 180 additions and 37 deletions

View File

@@ -166,9 +166,9 @@
<i class="fa fa-line-chart w-5 text-center"></i>
<span class="ml-2">模型评测</span>
</a>
<a href="#" data-page="model-deploy" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
<a href="#" data-page="model-compare" class="nav-link flex items-center px-4 py-2.5 hover:bg-[#001529]/20 transition-colors">
<i class="fa fa-server w-5 text-center"></i>
<span class="ml-2">模型部署</span>
<span class="ml-2">模型对比</span>
</a>
<!-- 第二分区:资源管理 -->
@@ -290,19 +290,25 @@
],
actions: ['report', 'delete']
},
'model-deploy': {
'model-compare': {
title: '模型对比',
api: 'model-deploy',
api: 'model-compare',
hasCreate: true,
createText: '新建对比',
columns: [
{ title: '服务名称', key: 'model_name' },
{ title: '端点', key: 'endpoint' },
{ title: '实例', key: 'instance' },
{ title: '对比名称', key: 'model_name' },
{ title: '描述', key: 'description', render: (val) => val || '-' },
{ title: '模型列表', key: 'models', render: (val) => {
if (!val) return '-';
try {
const models = typeof val === 'string' ? JSON.parse(val) : val;
return models.length + '个模型';
} catch { return '-'; }
}},
{ title: '状态', key: 'status', render: (val) => `<span class="px-2 py-1 rounded text-xs ${val === 'running' ? 'bg-green-100 text-green-700' : val === 'stopped' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'}">${val}</span>` },
{ title: '创建时间', key: 'create_time', render: (val) => val ? new Date(val).toLocaleString('zh-CN') : '-' }
],
actions: ['stop', 'scale', 'delete']
actions: ['delete']
},
'dataset-manage': {
title: '数据集管理',
@@ -1364,8 +1370,8 @@
window.location.href = 'model-eval-create.html';
} else if (apiType === 'dataset-manage') {
window.location.href = 'dataset-create.html';
} else if (apiType === 'model-deploy') {
window.location.href = 'model-deploy-create.html';
} else if (apiType === 'model-compare') {
window.location.href = 'model-compare-create.html';
} else {
showMessage('提示', '该功能开发中...', 'info');
}