Preserve publish record history
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user