diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index d41926de..dd3e3a3f 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -95,7 +95,7 @@ jobs: name: 漏洞扫描 (govulncheck) runs-on: ubuntu-latest # 存量可达漏洞已清零: 升级 grpc / x/text / excelize / quic-go / etcd 等依赖并将 go 版本钉到 - # 1.25.12(修复 crypto/tls ECH 漏洞 GO-2026-5856)后, govulncheck 对"可达"漏洞报告为空。 + # 1.25.13(覆盖 crypto/tls 等 stdlib 补丁 + etcd server ≥3.5.33)后, govulncheck 对"可达"漏洞报告为空。 # govulncheck 只报告调用链真正触及的漏洞, 误报极低; 故转为硬门禁, # 与本仓库 golangci-lint / ruff / mypy / safety / bandit 的"存量先反馈、清零后转门禁"一致。 steps: diff --git a/apps/cognida-web/src/api/audit/index.ts b/apps/cognida-web/src/api/audit/index.ts index b76b7be4..5c07f3bf 100644 --- a/apps/cognida-web/src/api/audit/index.ts +++ b/apps/cognida-web/src/api/audit/index.ts @@ -18,6 +18,8 @@ export interface AuditLog { RequestID: string | null DurationMs: number | null CreatedAt: string + /** 该 request_id 在 trace_spans 是否有调用链,无则前端不展示跳转按钮 */ + HasTrace?: boolean } export interface AuditLogPage { diff --git a/apps/cognida-web/src/api/datasource/index.ts b/apps/cognida-web/src/api/datasource/index.ts index 0f409691..97a5f266 100644 --- a/apps/cognida-web/src/api/datasource/index.ts +++ b/apps/cognida-web/src/api/datasource/index.ts @@ -96,9 +96,17 @@ export interface TestDatasourceResult { message?: string } +/** 表清单条目(与后端 TableInfo 对齐) */ +export interface DatasourceTableInfo { + name: string + comment?: string + /** information_schema 估算行数 */ + rows?: number +} + /** 表列表响应 */ export interface DatasourceTablesResponse { - tables: string[] + tables: DatasourceTableInfo[] } /** 表结构详情(列信息等,后端可按需扩展) */ @@ -119,9 +127,16 @@ export interface DatasourceTableDetail { export const datasourceApi = { /** - * 分页获取数据源列表 + * 分页获取数据源列表。 + * 可选筛选:name(名称模糊)、type(mysql|postgres)、database(库名模糊)。 */ - list(params?: { page?: number; page_size?: number }) { + list(params?: { + page?: number + page_size?: number + name?: string + type?: DatasourceType | '' + database?: string + }) { return http.get('/datasources', { params }) }, diff --git a/apps/cognida-web/src/api/evaluation/index.ts b/apps/cognida-web/src/api/evaluation/index.ts index 67ba5870..51c870c0 100644 --- a/apps/cognida-web/src/api/evaluation/index.ts +++ b/apps/cognida-web/src/api/evaluation/index.ts @@ -39,9 +39,18 @@ export const evaluationApi = { }, /** - * 列出测评任务 - */ - list(params?: { page?: number; page_size?: number }) { + * 列出测评任务。 + * 可选筛选:status(running/failed…)、task_id、dataset_id、dataset_name、type。 + */ + list(params?: { + page?: number + page_size?: number + status?: string + type?: string + task_id?: string + dataset_id?: string + dataset_name?: string + }) { return http.get('/evaluation/tasks', { params }) }, @@ -89,7 +98,7 @@ export const evaluationApi = { /** * 列出数据集 */ - listDatasets(params?: { type?: string }) { + listDatasets(params?: { type?: string; name?: string; id?: string }) { return http.get<{ datasets: DatasetInfo[] }>('/evaluation/datasets', { params }) }, diff --git a/apps/cognida-web/src/components/ui/UiTable.vue b/apps/cognida-web/src/components/ui/UiTable.vue index 2a1f8334..05d1e01b 100644 --- a/apps/cognida-web/src/components/ui/UiTable.vue +++ b/apps/cognida-web/src/components/ui/UiTable.vue @@ -71,8 +71,8 @@
@@ -202,6 +202,11 @@ function formatCellValue(row: any, column: Column) { } function handleRowClick(row: any, index: number) { + // 拖选/长按选中文字时,mouseup 也会触发 click;有选区则不当作行点击,避免误开详情。 + const sel = window.getSelection() + if (sel && !sel.isCollapsed && sel.toString().trim()) { + return + } emit('row-click', row, index) } diff --git a/apps/cognida-web/src/types/evaluation.ts b/apps/cognida-web/src/types/evaluation.ts index 07641291..094743b2 100644 --- a/apps/cognida-web/src/types/evaluation.ts +++ b/apps/cognida-web/src/types/evaluation.ts @@ -113,6 +113,8 @@ export interface EvaluationTask { id?: string task_id: string dataset_id: string + /** 数据集显示名称(列表接口按 dataset_id 解析) */ + dataset_name?: string type: string status: EvaluationStatus total_count: number @@ -139,6 +141,8 @@ export interface EvaluationTaskDetail extends EvaluationTask { export interface EvaluationDetail { task_id: string dataset_id: string + /** 数据集显示名称(后端按 dataset_id 解析,缺失时可能为空) */ + dataset_name?: string type: string status: EvaluationStatus qa_results: any[] diff --git a/apps/cognida-web/src/utils/request.ts b/apps/cognida-web/src/utils/request.ts index 65552eb4..a2a6171b 100644 --- a/apps/cognida-web/src/utils/request.ts +++ b/apps/cognida-web/src/utils/request.ts @@ -119,7 +119,8 @@ service.interceptors.response.use( // 处理404错误 if (error.response?.status === 404) { - ElMessage.error('请求的资源不存在') + const payload = error.response.data as { message?: string } | undefined + ElMessage.error(payload?.message || '请求的资源不存在') return Promise.reject(error) } diff --git a/apps/cognida-web/src/views/audit/AuditLogList.vue b/apps/cognida-web/src/views/audit/AuditLogList.vue index b9d29c9c..0a8ef230 100644 --- a/apps/cognida-web/src/views/audit/AuditLogList.vue +++ b/apps/cognida-web/src/views/audit/AuditLogList.vue @@ -85,16 +85,17 @@ {{ formatTime(row.CreatedAt) }}