mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(import): show conversion guidance for batch failures
Show one localized conversion guide in the batch result when any failed file has an unrecognized format. Batch errors are stored separately from the single-file error state, so they previously missed the guidance.
This commit is contained in:
1 parent
11aa6a37c4
commit
5f5df9647b
1 file changed
+18
@@ -99,6 +99,9 @@ function showImportOutcome(result: ImportResult) {
|
||||
|
||||
const importError = ref<string | null>(null)
|
||||
const isUnrecognizedFormat = computed(() => importError.value === 'error.unrecognized_format')
|
||||
const hasUnrecognizedBatchFormat = computed(() =>
|
||||
batchImportResult.value?.files.some((file) => file.status === 'failed' && file.error === 'error.unrecognized_format')
|
||||
)
|
||||
const hasImportLog = ref(false)
|
||||
const importDiagnostics = ref<{
|
||||
logFile: string | null
|
||||
@@ -1075,6 +1078,21 @@ const getMergeFileProgressText = (file: MergeFileInfo) =>
|
||||
</template>
|
||||
</FileListItem>
|
||||
</div>
|
||||
<div v-if="hasUnrecognizedBatchFormat" class="mt-4 space-y-2">
|
||||
<p class="text-xs leading-relaxed text-gray-500 dark:text-gray-400">
|
||||
{{ t('home.import.errors.unrecognizedFormatHint') }}
|
||||
</p>
|
||||
<UButton
|
||||
:href="conversionGuideUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
size="xs"
|
||||
variant="soft"
|
||||
icon="i-heroicons-arrow-top-right-on-square"
|
||||
>
|
||||
{{ t('home.import.viewConversionGuide') }}
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 默认导入区域(非批量状态) -->
|
||||
|
||||
Reference in new issue
Block a user