diff --git a/tenant-platform/src/api/bugcollect.ts b/tenant-platform/src/api/bugcollect.ts index 1731ef0..54ea3e9 100644 --- a/tenant-platform/src/api/bugcollect.ts +++ b/tenant-platform/src/api/bugcollect.ts @@ -107,7 +107,7 @@ export interface BugCollectSourcemap { platform: string appVersion: string bundleName: string - storageKey: string + buildId: string | null uploadedAt: string } @@ -251,5 +251,9 @@ export const bugCollectApi = { sourcemaps: { list: (appKey: string) => client.get<{ data: BugCollectSourcemap[] }>('/bugcollect/v1/sourcemaps', { params: { appKey } }), + delete: (id: number) => + client.delete(`/bugcollect/v1/sourcemaps/${id}`), + pruneAll: () => + client.post<{ data: string }>('/bugcollect/v1/sourcemaps/prune-all'), }, } diff --git a/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue b/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue index a666935..053258d 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue @@ -39,11 +39,30 @@ - - + + + + + + + @@ -97,7 +116,7 @@ import { ref, onMounted, watch } from 'vue' import { ElMessage } from 'element-plus' import { bugCollectApi, type BugCollectSourcemap } from '@/api/bugcollect' import { useBugCollectApp } from '@/composables/useBugCollectApp' -import { levelTag, statusTag, statusLabel, formatTime } from '@/utils/bugCollect' +import { formatTime } from '@/utils/bugCollect' const { apps, loadingApps, appKey, setApp, gateStatus, applyDialogVisible, applyReason, applyLoading, submitActivation } = useBugCollectApp() @@ -113,7 +132,6 @@ function platformTagType(platform: string): '' | 'success' | 'warning' | 'info' return map[platform?.toLowerCase()] ?? 'info' } - async function loadData() { if (!appKey.value || gateStatus.value !== 'enabled') return loading.value = true @@ -128,6 +146,16 @@ async function loadData() { } } +async function handleDelete(id: number) { + try { + await bugCollectApi.sourcemaps.delete(id) + ElMessage.success('已删除') + sourcemaps.value = sourcemaps.value.filter(s => s.id !== id) + } catch { + ElMessage.error('删除失败') + } +} + watch(gateStatus, (s) => { if (s === 'enabled') loadData() }) onMounted(loadData) @@ -140,6 +168,11 @@ onMounted(loadData) justify-content: space-between; align-items: center; } +.buildid-text { + font-family: monospace; + font-size: 12px; + color: #606266; +} .usage-guide h4 { margin: 16px 0 8px; font-size: 14px;