feat(publish): unify image fetch failure message across adapters
Deployment Config CI / Deployment Config (push) Successful in 30s
Desktop Client Build / Resolve Build Metadata (push) Successful in 17s
Frontend CI / Frontend (push) Successful in 3m35s
Backend CI / Backend (push) Successful in 16m50s
Desktop Client Build / Build Desktop Client (push) Successful in 24m2s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 30s
Deployment Config CI / Deployment Config (push) Successful in 30s
Desktop Client Build / Resolve Build Metadata (push) Successful in 17s
Frontend CI / Frontend (push) Successful in 3m35s
Backend CI / Backend (push) Successful in 16m50s
Desktop Client Build / Build Desktop Client (push) Successful in 24m2s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 30s
Consolidate per-platform cover/image fetch failure prompts into a single PUBLISH_IMAGE_FETCH_FAILED_MESSAGE constant shared by baijiahao, bilibili, dongchedi, qiehao, smzdm, and zol adapters, and generalize the normalizer to match any *_image_fetch_failed / *_cover_fetch_failed code. Also split desktop publish list loading into initial vs manual-refresh states so the refresh button no longer blanks the table, and fix admin-web active-task detection to cover all pending statuses.
This commit is contained in:
@@ -79,7 +79,7 @@ function platformShortName(platform: string): string {
|
||||
function statusLabel(status: DesktopTaskInfo['status']): string {
|
||||
const map: Record<DesktopTaskInfo['status'], string> = {
|
||||
queued: '等待发布',
|
||||
in_progress: '正在发送',
|
||||
in_progress: '正在发布',
|
||||
succeeded: '发送成功',
|
||||
failed: '发送失败',
|
||||
unknown: '发送失败',
|
||||
@@ -324,7 +324,8 @@ const taskPage = ref<DesktopPublishTaskListResponse | null>(null)
|
||||
const currentPage = ref(1)
|
||||
const searchTitle = ref('')
|
||||
const appliedTitle = ref('')
|
||||
const loading = ref(false)
|
||||
const initialLoading = ref(false)
|
||||
const refreshing = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
const consolePendingTaskId = ref<string | null>(null)
|
||||
const copiedErrorTaskId = ref<string | null>(null)
|
||||
@@ -347,8 +348,17 @@ function notifyActionError(description: string) {
|
||||
})
|
||||
}
|
||||
|
||||
async function refreshTasks(page = currentPage.value) {
|
||||
loading.value = true
|
||||
async function refreshTasks(
|
||||
page = currentPage.value,
|
||||
options: { initial?: boolean; manual?: boolean } = {},
|
||||
) {
|
||||
const showInitialLoading = Boolean(options.initial && taskPage.value === null)
|
||||
if (showInitialLoading) {
|
||||
initialLoading.value = true
|
||||
}
|
||||
if (options.manual) {
|
||||
refreshing.value = true
|
||||
}
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
@@ -361,7 +371,7 @@ async function refreshTasks(page = currentPage.value) {
|
||||
const lastPage = response.total > 0 ? Math.ceil(response.total / PAGE_SIZE) : 1
|
||||
if (response.total > 0 && page > lastPage) {
|
||||
currentPage.value = lastPage
|
||||
await refreshTasks(lastPage)
|
||||
await refreshTasks(lastPage, options)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -374,10 +384,19 @@ async function refreshTasks(page = currentPage.value) {
|
||||
stopActiveTaskPolling()
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
if (showInitialLoading) {
|
||||
initialLoading.value = false
|
||||
}
|
||||
if (options.manual) {
|
||||
refreshing.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function refreshTasksManually() {
|
||||
void refreshTasks(currentPage.value, { manual: true })
|
||||
}
|
||||
|
||||
function startActiveTaskPolling() {
|
||||
if (refreshTimer) {
|
||||
return
|
||||
@@ -554,7 +573,7 @@ watch(searchTitle, (value) => {
|
||||
|
||||
onMounted(() => {
|
||||
bindPublishLeaseListener()
|
||||
void refreshTasks()
|
||||
void refreshTasks(currentPage.value, { initial: true })
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -661,8 +680,8 @@ const tableScroll = { x: 1080 } as const
|
||||
type="primary"
|
||||
ghost
|
||||
class="modern-btn"
|
||||
:loading="loading"
|
||||
@click="refreshTasks()"
|
||||
:loading="refreshing"
|
||||
@click="refreshTasksManually"
|
||||
>
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
刷新状态
|
||||
@@ -722,7 +741,7 @@ const tableScroll = { x: 1080 } as const
|
||||
:columns="tableColumns"
|
||||
:data-source="publishTasks"
|
||||
:pagination="false"
|
||||
:loading="loading"
|
||||
:loading="initialLoading"
|
||||
:scroll="tableScroll"
|
||||
:row-class-name="rowClassName"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user