diff --git a/web/pages/components/sidebar.html b/web/pages/components/sidebar.html
index 62bc82a..f1a78bc 100644
--- a/web/pages/components/sidebar.html
+++ b/web/pages/components/sidebar.html
@@ -23,7 +23,7 @@
-
+
我的模型
@@ -437,16 +437,16 @@
},
'my-models': {
title: '我的模型',
- api: 'my-models',
+ api: 'model-manage/trained-models',
+ dataPath: 'models', // 特殊处理:API返回的是 {data: {models: [...]}} 格式
hasCreate: false,
columns: [
{ title: '模型名称', key: 'name' },
- { title: '类型', key: 'type' },
- { title: '版本', key: 'version' },
- { title: '描述', key: 'description' },
+ { title: '训练方法', key: 'train_methods', render: (val) => val && val[0] ? val[0].name : '-' },
+ { title: '模型路径', key: 'path', render: (val) => `
${val}` },
{ title: '创建时间', key: 'create_time', render: (val) => val ? new Date(val).toLocaleString('zh-CN') : '-' }
],
- actions: ['deploy', 'eval', 'delete']
+ actions: ['view', 'delete']
},
'model-eval': {
title: '模型评测',
@@ -607,7 +607,8 @@
'detail': '详情',
'edit': '编辑',
'compare': '开始对话',
- 'chat': '对话'
+ 'chat': '对话',
+ 'view': '去推理'
};
// 训练进度缓存
@@ -966,7 +967,11 @@
} else if (config.isTools) {
container.innerHTML = renderToolsPage(config);
} else {
- const data = await fetchData(`${API_BASE}/${config.api}`);
+ let data = await fetchData(`${API_BASE}/${config.api}`);
+ // 如果配置了 dataPath,从返回数据中提取指定字段
+ if (config.dataPath && typeof data === 'object' && data !== null) {
+ data = data[config.dataPath] || [];
+ }
currentPageData = data; // 保存当前页面数据
container.innerHTML = renderTablePage(config, data);
@@ -1369,6 +1374,8 @@
onclick = `startCompare(${item.id})`;
} else if (action === 'logs' && config.api === 'fine-tune') {
onclick = `navigateToTrainingLog(${item.id})`;
+ } else if (action === 'view' && config.api === 'model-manage/trained-models') {
+ onclick = `viewTrainedModel('${item.name}', '${item.train_methods?.[0]?.name || '-'}', '${item.path || ''}')`;
} else {
onclick = `showMessage('提示', '${actionLabels[action] || action}功能开发中...', 'info')`;
}
@@ -3157,6 +3164,14 @@
document.body.style.overflow = '';
}
+ // 查看已训练模型详情
+ window.viewTrainedModel = function(name, method, path) {
+ const message = '
模型名称:' + name + '
' +
+ '
训练方法:' + method + '
' +
+ '
路径:' + path + '
';
+ showMessage('模型详情', message, 'info');
+ };
+
// 确认弹窗(两个按钮)- 使用 window 确保全局可访问
window.showConfirm = function(title, message, onConfirm, onCancel, type = 'info') {
const modal = document.getElementById('customModal');
diff --git a/web/pages/model-dimension-create.html b/web/pages/model-dimension-create.html
index 3ff51f6..b60d85a 100644
--- a/web/pages/model-dimension-create.html
+++ b/web/pages/model-dimension-create.html
@@ -5,17 +5,6 @@
添加评测维度 / 远光软件微调平台
-