diff --git a/app/components/ClearStorageModal.vue b/app/components/ClearStorageModal.vue
new file mode 100644
index 0000000..0d88a0f
--- /dev/null
+++ b/app/components/ClearStorageModal.vue
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+ {{ t('storage.clearStorageScope') }}
+
+
+
+
+
+ {{ t('storage.clearStorageInstruction') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/HlsDownloadModal.vue b/app/components/HlsDownloadModal.vue
new file mode 100644
index 0000000..44226df
--- /dev/null
+++ b/app/components/HlsDownloadModal.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+ {{ t('library.video.downloadMp4Confirm') }}
+
+
+ {{ t('library.video.downloadMp4Working') }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/MediaSessionCard.vue b/app/components/MediaSessionCard.vue
index 8a924ae..62054e4 100644
--- a/app/components/MediaSessionCard.vue
+++ b/app/components/MediaSessionCard.vue
@@ -17,6 +17,7 @@ const emit = defineEmits<{
const { formatFileSize } = useFileSize()
const { t, locale } = useI18n()
+const transcodeFailureLabel = useTranscodeFailureLabel()
const { copyFormat } = useUploadPreferences(props.kind)
const copyFormatItems = computed(() => [
@@ -102,22 +103,11 @@ const presetLabel = computed(() => {
-
![]()
-
-
-
+ />
{
color="error"
variant="subtle"
size="xs"
- class="shrink-0"
+ class="max-w-48 shrink-0 truncate"
+ :title="transcodeFailureLabel(item.transcodeError)"
>
- {{ t('library.transcodeFailed') }}
+ {{ transcodeFailureLabel(item.transcodeError) }}
()
const { formatFileSize } = useFileSize()
const { t, locale } = useI18n()
+const transcodeFailureLabel = useTranscodeFailureLabel()
/** 转码完成后按 HLS 播放列表展示 */
const displayName = computed(() => {
@@ -37,34 +39,15 @@ const uploadedLabel = computed(() => {
return props.item.uploadedAt
}
})
-
-const thumbFailed = ref(false)
-
-watch(() => props.item.thumbUrl, () => {
- thumbFailed.value = false
-})
-
![]()
-
-
-
+ />
@@ -162,6 +147,15 @@ watch(() => props.item.thumbUrl, () => {
rel="noopener"
:aria-label="t('files.download')"
/>
+
([])
const total = ref(0)
@@ -27,6 +28,8 @@ const deleteTargetKeys = ref([])
const deleting = ref(false)
const previewOpen = ref(false)
const previewItem = ref(null)
+const downloadOpen = ref(false)
+const downloadItem = ref(null)
const currentBackend = ref('all')
const currentSource = ref('all')
@@ -66,7 +69,7 @@ function videoLink(item: FileItem): string {
}
function thumbLink(item: FileItem): string {
- return withToken(item.thumbUrl)
+ return withToken(item.thumbUrl) || '/video-placeholder.svg'
}
function downloadUrl(item: FileItem): string {
@@ -264,6 +267,13 @@ function openPreview(item: FileItem) {
previewOpen.value = true
}
+function requestDownload(item: FileItem | null) {
+ if (!item?.hlsUrl) return
+ previewOpen.value = false
+ downloadItem.value = item
+ downloadOpen.value = true
+}
+
onMounted(() => {
void loadBackendOptions()
})
@@ -514,6 +524,7 @@ defineExpose({ refresh })
:selected="selectedKeys.has(item.key)"
@update:selected="toggleSelected(item.key, $event)"
@play="openPreview(item)"
+ @download="requestDownload(item)"
@delete="requestDelete(item)"
/>
@@ -577,17 +588,9 @@ defineExpose({ refresh })
:aria-label="t('library.play')"
@click="openPreview(item)"
>
-
![]()
-
- {{ t('library.transcodeFailed') }}
+ {{ transcodeFailureLabel(item.transcodeError) }}
@@ -695,6 +699,15 @@ defineExpose({ refresh })
rel="noopener"
:aria-label="t('files.download')"
/>
+
+
+
diff --git a/app/components/VideoPreviewModal.vue b/app/components/VideoPreviewModal.vue
index bcd7f30..a090855 100644
--- a/app/components/VideoPreviewModal.vue
+++ b/app/components/VideoPreviewModal.vue
@@ -20,11 +20,13 @@ const props = withDefaults(defineProps<{
const emit = defineEmits<{
'update:open': [value: boolean]
'delete': []
+ 'download': []
}>()
const toast = useToast()
const { formatFileSize } = useFileSize()
const { t, locale } = useI18n()
+const transcodeFailureLabel = useTranscodeFailureLabel()
const { copyFormat } = useUploadPreferences('video')
const videoEl = ref(null)
@@ -80,7 +82,7 @@ const transcodeLabel = computed(() => {
case 'done':
return t('library.video.transcodeDone')
case 'failed':
- return t('library.transcodeFailed')
+ return transcodeFailureLabel(item.transcodeError)
default:
return t('library.video.transcodeNone')
}
@@ -498,6 +500,15 @@ function downloadOriginal() {
size="sm"
@click="downloadOriginal"
/>
+
+const props = defineProps<{
+ src?: string
+ alt: string
+}>()
+
+const failed = ref(false)
+
+watch(() => props.src, () => {
+ failed.value = false
+})
+
+
+
+
+
+
diff --git a/app/components/api/ApiDebugger.vue b/app/components/api/ApiDebugger.vue
index 6dbd49f..3c54635 100644
--- a/app/components/api/ApiDebugger.vue
+++ b/app/components/api/ApiDebugger.vue
@@ -65,8 +65,14 @@ function resetForm() {
if (!isDebugParam(param)) continue
if (param.type === 'file') {
files[param.name] = null
+ } else if (param.name === 'kind') {
+ values[param.name] = props.endpoint.category === 'video' ? 'video' : 'file'
} else if (param.name === 'keys') {
- values[param.name] = '["images/2026/08/example.webp"]'
+ values[param.name] = props.endpoint.category === 'video'
+ ? '["videos/2026/10/example.mp4"]'
+ : props.endpoint.category === 'file'
+ ? '["files/2026/10/example.pdf"]'
+ : '["images/2026/08/example.webp"]'
} else if (param.name === 'token' && props.token) {
values[param.name] = props.token
} else {
@@ -84,6 +90,12 @@ function fileLabel(name: string) {
return fileValues.value[name]?.name ?? t('api.debug.noFileSelected')
}
+function fileAccept() {
+ if (props.endpoint.category === 'video') return 'video/*'
+ if (props.endpoint.category === 'file') return undefined
+ return 'image/*'
+}
+
function triggerFilePick(name: string) {
fileInputRefs.value[name]?.click()
}
@@ -101,8 +113,8 @@ function isParamFilled(param: ApiDocParam) {
if (!value) return false
if (param.location === 'body' && param.name === 'keys') {
try {
- const parsed = JSON.parse(value) as { keys?: unknown }
- return Array.isArray(parsed.keys) && parsed.keys.length > 0
+ const parsed = JSON.parse(value) as unknown
+ return Array.isArray(parsed) && parsed.length > 0
} catch {
return false
}
@@ -159,7 +171,14 @@ async function sendRequest() {
} else if (debugBodyParams.value.some(p => p.location === 'body')) {
headers['Content-Type'] = 'application/json'
try {
- body = JSON.stringify(JSON.parse(paramValues.value.keys || '{}'))
+ const payload: Record = {}
+ for (const param of debugBodyParams.value) {
+ if (param.location !== 'body') continue
+ const value = paramValues.value[param.name]?.trim()
+ if (!value) continue
+ payload[param.name] = param.name === 'keys' ? JSON.parse(value) : value
+ }
+ body = JSON.stringify(payload)
} catch {
toast.add({ title: t('api.debug.invalidJson'), color: 'error' })
sending.value = false
@@ -297,7 +316,7 @@ const responseScrollable = computed(() => responseBody.value.split('\n').length
diff --git a/app/components/api/ApiSidebar.vue b/app/components/api/ApiSidebar.vue
index f759bb2..876189e 100644
--- a/app/components/api/ApiSidebar.vue
+++ b/app/components/api/ApiSidebar.vue
@@ -20,9 +20,18 @@ const docsUrl = computed(() =>
const categories: { key: ApiDocCategory, labelKey: string }[] = [
{ key: 'image', labelKey: 'api.categories.image' },
+ { key: 'video', labelKey: 'api.categories.video' },
+ { key: 'file', labelKey: 'api.categories.file' },
{ key: 'extension', labelKey: 'api.categories.extension' },
{ key: 'system', labelKey: 'api.categories.system' }
]
+const openCategories = ref>(
+ new Set(
+ categories
+ .filter(category => category.key !== 'video' && category.key !== 'file')
+ .map(category => category.key)
+ )
+)
const filteredEndpoints = computed(() => {
const q = search.value.trim().toLowerCase()
@@ -38,6 +47,17 @@ function endpointsForCategory(category: ApiDocCategory) {
return filteredEndpoints.value.filter(endpoint => endpoint.category === category)
}
+function isCategoryOpen(category: ApiDocCategory) {
+ return openCategories.value.has(category)
+}
+
+function toggleCategory(category: ApiDocCategory) {
+ const next = new Set(openCategories.value)
+ if (next.has(category)) next.delete(category)
+ else next.add(category)
+ openCategories.value = next
+}
+
function onSelect(id: string) {
emit('select', id)
}
@@ -59,6 +79,15 @@ onMounted(() => {
window.addEventListener('keydown', onGlobalKeydown)
onUnmounted(() => window.removeEventListener('keydown', onGlobalKeydown))
})
+
+watch(search, (value) => {
+ if (!value.trim()) return
+ const next = new Set(openCategories.value)
+ for (const category of categories) {
+ if (endpointsForCategory(category.key).length) next.add(category.key)
+ }
+ openCategories.value = next
+})
@@ -89,13 +118,24 @@ onMounted(() => {
:key="category.key"
class="mb-4"
>
-
+ {{ t(category.labelKey) }}
+
+
+
- {{ t(category.labelKey) }}
-
-