feat(sourcemap): 隐藏文件路径,显示 Build ID,添加删除按钮,倒序排列
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
d05874bc15
当前提交
9413a5ea5c
@ -107,7 +107,7 @@ export interface BugCollectSourcemap {
|
|||||||
platform: string
|
platform: string
|
||||||
appVersion: string
|
appVersion: string
|
||||||
bundleName: string
|
bundleName: string
|
||||||
storageKey: string
|
buildId: string | null
|
||||||
uploadedAt: string
|
uploadedAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,5 +251,9 @@ export const bugCollectApi = {
|
|||||||
sourcemaps: {
|
sourcemaps: {
|
||||||
list: (appKey: string) =>
|
list: (appKey: string) =>
|
||||||
client.get<{ data: BugCollectSourcemap[] }>('/bugcollect/v1/sourcemaps', { params: { appKey } }),
|
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'),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,11 +39,30 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="appVersion" label="应用版本" width="120" />
|
<el-table-column prop="appVersion" label="应用版本" width="120" />
|
||||||
<el-table-column prop="bundleName" label="Bundle 名称" width="120" />
|
<el-table-column prop="bundleName" label="Bundle" width="120" />
|
||||||
<el-table-column prop="storageKey" label="文件路径" min-width="300" show-overflow-tooltip />
|
<el-table-column prop="buildId" label="Build ID" width="160" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span class="buildid-text">{{ row.buildId ?? '—' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="uploadedAt" label="上传时间" width="170">
|
<el-table-column prop="uploadedAt" label="上传时间" width="170">
|
||||||
<template #default="{ row }">{{ formatTime(row.uploadedAt) }}</template>
|
<template #default="{ row }">{{ formatTime(row.uploadedAt) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="80" fixed="right">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-popconfirm
|
||||||
|
title="确认删除该 Sourcemap?"
|
||||||
|
confirm-button-text="删除"
|
||||||
|
cancel-button-text="取消"
|
||||||
|
confirm-button-type="danger"
|
||||||
|
@confirm="handleDelete(row.id)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="danger" size="small" link>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<el-empty v-if="!loading && sourcemaps.length === 0" description="暂无 Sourcemap 文件" />
|
<el-empty v-if="!loading && sourcemaps.length === 0" description="暂无 Sourcemap 文件" />
|
||||||
@ -97,7 +116,7 @@ import { ref, onMounted, watch } from 'vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { bugCollectApi, type BugCollectSourcemap } from '@/api/bugcollect'
|
import { bugCollectApi, type BugCollectSourcemap } from '@/api/bugcollect'
|
||||||
import { useBugCollectApp } from '@/composables/useBugCollectApp'
|
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()
|
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'
|
return map[platform?.toLowerCase()] ?? 'info'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
if (!appKey.value || gateStatus.value !== 'enabled') return
|
if (!appKey.value || gateStatus.value !== 'enabled') return
|
||||||
loading.value = true
|
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() })
|
watch(gateStatus, (s) => { if (s === 'enabled') loadData() })
|
||||||
onMounted(loadData)
|
onMounted(loadData)
|
||||||
</script>
|
</script>
|
||||||
@ -140,6 +168,11 @@ onMounted(loadData)
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.buildid-text {
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
.usage-guide h4 {
|
.usage-guide h4 {
|
||||||
margin: 16px 0 8px;
|
margin: 16px 0 8px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户