fix: trace debug — show Stranger_NNN for unnamed traces instead of unknown
This commit is contained in:
@@ -214,7 +214,10 @@
|
||||
</div>
|
||||
|
||||
<!-- Error -->
|
||||
<div v-else class="text-center py-12 text-red-400">
|
||||
<div v-else-if="error" class="text-center py-12 text-red-400">
|
||||
{{ error }}
|
||||
</div>
|
||||
<div v-else class="text-center py-12 text-gray-500">
|
||||
無法載入詳情
|
||||
</div>
|
||||
</div>
|
||||
@@ -229,28 +232,28 @@ import { httpFetch, getCurrentConfig } from '@/api/client'
|
||||
const route = useRoute()
|
||||
const chunkId = ref('')
|
||||
const detail = ref<any>(null)
|
||||
const error = ref('')
|
||||
const loading = ref(false)
|
||||
|
||||
const loadDetail = async () => {
|
||||
const uuid = route.params.uuid as string
|
||||
chunkId.value = route.params.chunkId as string
|
||||
const uuid = route.params.file_uuid as string
|
||||
chunkId.value = route.params.chunk_id as string
|
||||
loading.value = true
|
||||
|
||||
try {
|
||||
const config = getCurrentConfig()
|
||||
const url = `${config.api_base_url}/api/v1/file/${uuid}/${chunkId.value}`
|
||||
const url = `${config.api_base_url}/api/v1/file/${uuid}/chunk/${chunkId.value}`
|
||||
|
||||
const res = await httpFetch<any>(url)
|
||||
console.log('Response status:', res.status, res.statusText)
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`API error: ${res.status} ${res.statusText}`)
|
||||
if (res && res.chunk_id) {
|
||||
detail.value = res
|
||||
} else {
|
||||
detail.value = null
|
||||
}
|
||||
|
||||
detail.value = res
|
||||
} catch (error) {
|
||||
console.error('Failed to load chunk detail:', error)
|
||||
alert('載入失敗: ' + error)
|
||||
} catch (err) {
|
||||
error.value = '載入失敗: ' + (err as any)?.message || String(err)
|
||||
console.error('Failed to load chunk detail:', err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -316,16 +319,11 @@ const goBack = () => {
|
||||
try {
|
||||
const data = JSON.parse(saved)
|
||||
localStorage.removeItem('searchState')
|
||||
router.push({
|
||||
name: 'search',
|
||||
query: { q: data.query }
|
||||
})
|
||||
} catch {
|
||||
router.back()
|
||||
}
|
||||
} else {
|
||||
router.back()
|
||||
router.push({ name: 'search', query: { q: data.query } })
|
||||
return
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
router.push('/files')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user