cleanup: 移除无交互的历史提交区段
This commit is contained in:
@@ -124,14 +124,7 @@
|
||||
{{ page.parsed?.message || '暂无提取数据' }}
|
||||
</div>
|
||||
|
||||
<!-- 历史记录 -->
|
||||
<div v-if="page.history?.length > 1" style="font-size:12px;color:#909399">
|
||||
历史提交:
|
||||
<span v-for="h in page.history" :key="h.id" style="margin-left:6px">
|
||||
{{ formatTime(h.createdAt) }}
|
||||
<el-tag size="small" :type="h.statusCode>=200&&h.statusCode<300?'success':'danger'">{{ h.statusCode }}</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
@@ -176,11 +169,9 @@ const pages = computed(() => {
|
||||
const key = r.url || '(无URL)'
|
||||
if (!map.has(key)) {
|
||||
map.set(key, { url: key, accessResultId: r.id, statusCode: r.statusCode, responseTimeMs: r.responseTimeMs,
|
||||
createdAt: r.createdAt, totalCount: 0, history: [], parsed: null })
|
||||
createdAt: r.createdAt, totalCount: 0, parsed: null })
|
||||
}
|
||||
const p = map.get(key)
|
||||
p.totalCount++
|
||||
if (p.history.length < 5) p.history.push(r)
|
||||
map.get(key).totalCount++
|
||||
}
|
||||
for (const [url, parsed] of Object.entries(pageParsed.value)) {
|
||||
if (map.has(url)) map.get(url).parsed = parsed
|
||||
@@ -289,7 +280,6 @@ const deleteResult = async (page) => {
|
||||
} catch { ElMessage.error('删除失败') }
|
||||
}
|
||||
|
||||
const formatTime = (t) => t ? t.substring(5,16) : '-'
|
||||
const statusTag = (code) => {
|
||||
if (code>=200&&code<300) return 'success'
|
||||
if (code>=300&&code<400) return 'warning'
|
||||
|
||||
Reference in New Issue
Block a user