Preserve publish record history
Frontend CI / Frontend (push) Successful in 3m15s
Backend CI / Backend (push) Successful in 14m44s

This commit is contained in:
2026-06-25 01:52:26 +08:00
parent 24a62fd52c
commit bdfe79c921
8 changed files with 162 additions and 52 deletions
@@ -112,6 +112,12 @@ const publishRecordColumns = computed<TableColumnsType<PublishRecord>>(() => [
key: 'published_at',
width: 168,
},
{
title: '错误信息',
dataIndex: 'error_message',
key: 'error_message',
width: 220,
},
{
title: t('media.records.link'),
dataIndex: 'external_article_url',
@@ -249,6 +255,18 @@ function shouldShowClientManageHint(record: PublishRecord): boolean {
)
}
function publishRecordError(record: PublishRecord): string {
return record.error_message?.trim() || ''
}
function publishRecordErrorPreview(record: PublishRecord): string {
const error = publishRecordError(record).replace(/\s+/g, ' ')
if (error.length <= 52) {
return error
}
return `${error.slice(0, 44)}...${error.slice(-5)}`
}
async function copyPublishLink(record: PublishRecord): Promise<void> {
const target = resolvePublishLink(record)
if (!target) {
@@ -399,6 +417,14 @@ async function copyPublishLink(record: PublishRecord): Promise<void> {
<template v-else-if="column.key === 'published_at'">
{{ formatDateTime(record.published_at) }}
</template>
<template v-else-if="column.key === 'error_message'">
<a-tooltip v-if="publishRecordError(record)" :title="publishRecordError(record)">
<span class="article-drawer__record-error">
{{ publishRecordErrorPreview(record) }}
</span>
</a-tooltip>
<span v-else class="article-drawer__record-empty">--</span>
</template>
<template v-else-if="column.key === 'external_article_url'">
<div v-if="resolvePublishLink(record)" class="article-drawer__record-link-row">
<a
@@ -567,6 +593,18 @@ async function copyPublishLink(record: PublishRecord): Promise<void> {
font-size: 12px;
}
.article-drawer__record-error {
display: inline-block;
max-width: 190px;
overflow: hidden;
color: #cf1322;
font-size: 12px;
line-height: 1.5;
text-overflow: ellipsis;
vertical-align: middle;
white-space: nowrap;
}
.article-drawer__record-link {
flex: 1;
min-width: 0;