Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
fix: update preview action label
Timothy Yin7acebd3b61d7
diff --git a/app/pages/dashboard/photos.vue b/app/pages/dashboard/photos.vueindex a1dcdfe1..4798c685 100644--- a/app/pages/dashboard/photos.vue+++ b/app/pages/dashboard/photos.vue@@ -1251,37 +1251,6 @@ const handleEditSubmit = async (event: FormSubmitEvent<EditFormState>) => {await saveMetadataChanges()}-// LivePhoto 相关操作-const handleViewLivePhoto = async (photoId: string) => {- try {- const livePhotoInfo = await $fetch(`/api/photos/${photoId}/livephoto`)-- if (livePhotoInfo.isLivePhoto && livePhotoInfo.livePhotoVideoUrl) {- // 设置模态框数据- selectedLivePhoto.value = {- id: livePhotoInfo.id,- title: livePhotoInfo.title,- originalUrl: livePhotoInfo.originalUrl || '',- videoUrl: livePhotoInfo.livePhotoVideoUrl,- }- isLivePhotoModalOpen.value = true- } else {- toast.add({- title: $t('dashboard.photos.messages.livePhotoNotFound'),- description: '',- color: 'warning',- })- }- } catch (error) {- console.error('获取 LivePhoto 信息失败:', error)- toast.add({- title: $t('dashboard.photos.messages.error'),- description: $t('dashboard.photos.messages.livePhotoLoadError'),- color: 'error',- })- }-}-const handleReverseGeocodeRequest = async (photo: Photo) => {if (!photo?.id) {return@@ -1427,11 +1396,10 @@ const getRowActions = (photo: Photo) => {},},{- label: $t('dashboard.photos.actions.viewLivePhoto'),- icon: 'tabler:live-photo',- disabled: !photo.isLivePhoto,+ label: $t('dashboard.photos.actions.previewPhoto'),+ icon: 'tabler:photo',onSelect() {- handleViewLivePhoto(photo.id)+ openImagePreview(photo)},},],@@ -1446,15 +1414,6 @@ const getRowActions = (photo: Photo) => {]}-// LivePhoto Modal-const isLivePhotoModalOpen = ref(false)-const selectedLivePhoto = ref<{- id: string- title: string | null- originalUrl: string- videoUrl: string-} | null>(null)-// 图片预览弹窗const isImagePreviewOpen = ref(false)const previewingPhoto = ref<Photo | null>(null)@@ -1808,10 +1767,10 @@ onUnmounted(() => {<!-- 文件上传入口 --><div- class="relative overflow-hidden rounded-3xl border border-neutral-200/80 bg-gradient-to-br from-white via-white to-neutral-50 shadow-sm transition dark:border-neutral-800/70 dark:from-neutral-900 dark:via-neutral-900/80 dark:to-neutral-900"+ class="relative overflow-hidden rounded-3xl border border-neutral-200/80 bg-linear-to-br from-white via-white to-neutral-50 shadow-sm transition dark:border-neutral-800/70 dark:from-neutral-900 dark:via-neutral-900/80 dark:to-neutral-900"><div- class="pointer-events-none absolute -left-32 top-[-6rem] h-[18rem] w-[18rem] rounded-full bg-primary-400/20 blur-3xl dark:bg-primary-500/20"+ class="pointer-events-none absolute -left-32 -top-24 h-72 w-[18rem] rounded-full bg-primary-400/20 blur-3xl dark:bg-primary-500/20"/><div class="relative flex flex-col gap-6 p-5 sm:p-8"><div@@ -2123,20 +2082,29 @@ onUnmounted(() => {<!-- 列可见性按钮 --><UDropdownMenu- :items="table?.tableApi?.getAllColumns()- .filter((column: any) => column.getCanHide())- .map((column: any) => ({- label: columnNameMap[column.id] || column.id,- type: 'checkbox' as const,- checked: column.getIsVisible(),- disabled: !column.getCanHide() || (column.id === 'thumbnailUrl' || column.id === 'id' || column.id === 'actions'),- onUpdateChecked(checked: boolean) {- table?.tableApi?.getColumn(column.id)?.toggleVisibility(!!checked)- },- onSelect(e: Event) {- e.preventDefault()- }- }))"+ :items="+ table?.tableApi+ ?.getAllColumns()+ .filter((column: any) => column.getCanHide())+ .map((column: any) => ({+ label: columnNameMap[column.id] || column.id,+ type: 'checkbox' as const,+ checked: column.getIsVisible(),+ disabled:+ !column.getCanHide() ||+ column.id === 'thumbnailUrl' ||+ column.id === 'id' ||+ column.id === 'actions',+ onUpdateChecked(checked: boolean) {+ table?.tableApi+ ?.getColumn(column.id)+ ?.toggleVisibility(!!checked)+ },+ onSelect(e: Event) {+ e.preventDefault()+ },+ }))+ ":content="{ align: 'end' }"><UButton@@ -2147,7 +2115,9 @@ onUnmounted(() => {icon="tabler:columns-3":title="$t('dashboard.photos.table.columnVisibility.description')">- <span class="hidden sm:inline">{{ $t('dashboard.photos.table.columnVisibility.button') }}</span>+ <span class="hidden sm:inline">{{+ $t('dashboard.photos.table.columnVisibility.button')+ }}</span></UButton></UDropdownMenu></div>@@ -2170,8 +2140,7 @@ onUnmounted(() => {stickyclass="h-[calc(100vh-25rem)] sm:h-[calc(100vh-24.5rem)]":ui="{- separator:- 'bg-(--ui-color-neutral-200) dark:bg-(--ui-color-neutral-700)',+ separator: 'bg-neutral-200 dark:bg-neutral-700',}"><template #actions-cell="{ row }">@@ -2466,104 +2435,6 @@ onUnmounted(() => {</template></UModal>- <!-- LivePhoto 预览模态框 -->- <UModal v-model:open="isLivePhotoModalOpen">- <template #content>- <div class="p-6">- <div class="flex items-center justify-between mb-4">- <h3 class="text-lg font-semibold">- {{- $t('dashboard.photos.livePhotoModal.title', {- title: selectedLivePhoto?.title || 'Untitled',- })- }}- </h3>- <UButton- variant="ghost"- color="neutral"- size="sm"- icon="tabler:x"- @click="isLivePhotoModalOpen = false"- />- </div>-- <div- v-if="selectedLivePhoto"- class="space-y-4"- >- <!-- 静态图片预览 -->- <div class="space-y-2">- <h4 class="font-medium text-sm text-gray-600 dark:text-gray-400">- {{ $t('dashboard.photos.livePhotoModal.staticImage') }}- </h4>- <div- class="bg-gray-100 dark:bg-gray-800 rounded-lg p-4 flex justify-center"- >- <img- :src="selectedLivePhoto.originalUrl"- :alt="selectedLivePhoto.title || 'Live Photo'"- class="max-h-64 object-contain rounded"- />- </div>- </div>-- <!-- 视频预览 -->- <div class="space-y-2">- <h4 class="font-medium text-sm text-gray-600 dark:text-gray-400">- {{ $t('dashboard.photos.livePhotoModal.livePhotoVideo') }}- </h4>- <div- class="bg-gray-100 dark:bg-gray-800 rounded-lg p-4 flex justify-center"- >- <video- :src="selectedLivePhoto.videoUrl"- controls- autoplay- loop- muted- class="max-h-64 object-contain rounded"- >- {{ $t('dashboard.photos.livePhotoModal.notSupported') }}- </video>- </div>- </div>-- <!-- 操作按钮 -->- <div class="flex justify-end gap-2 pt-4 border-t">- <UButton- variant="ghost"- color="neutral"- icon="tabler:external-link"- @click="- () => {- if (selectedLivePhoto)- openInNewTab(selectedLivePhoto.videoUrl)- }- "- >- {{ $t('dashboard.photos.livePhotoModal.buttons.openVideo') }}- </UButton>- <UButton- variant="soft"- color="info"- icon="tabler:download"- @click="- () => {- if (selectedLivePhoto)- openInNewTab(selectedLivePhoto.videoUrl)- }- "- >- {{- $t('dashboard.photos.livePhotoModal.buttons.downloadVideo')- }}- </UButton>- </div>- </div>- </div>- </template>- </UModal>-<!-- 图片预览模态框 --><UModalv-model:open="isImagePreviewOpen"diff --git a/i18n/locales/en.json b/i18n/locales/en.jsonindex b2143ea1..e4c35c2c 100644--- a/i18n/locales/en.json+++ b/i18n/locales/en.json@@ -116,7 +116,7 @@"noPhotosTip": "Nno photos yet, upload some now!"},"livePhoto": "Live Photo",- "indexPanelCountCity":"and more other cities",+ "indexPanelCountCity": "and more other cities","album": {"noImage": "Empty Album","emptyAlbumTip": "Add photos to get started",@@ -164,14 +164,14 @@"add": "React","change": "Reacted","count": "no reactions | {count} reaction | {count} reactions",- "like":"like",- "love":"love",- "amazing":"amazing",- "funny":"funny",- "wow":"wow",- "sad":"sad",- "fire":"fire",- "sparkle":"sparkle"+ "like": "like",+ "love": "love",+ "amazing": "amazing",+ "funny": "funny",+ "wow": "wow",+ "sad": "sad",+ "fire": "fire",+ "sparkle": "sparkle"},"photoload": {"loadError": "Image loading failed",@@ -531,10 +531,10 @@},"actions": {"reprocess": "Reprocess",- "viewLivePhoto": "Live Photo Preview","refreshLocation": "Re-fetch City","delete": "Delete",- "editMetadata": "Edit Metadata"+ "editMetadata": "Edit Metadata",+ "previewPhoto": "Photo Preview"},"selection": {"selected": "{count} / {total} rows selected",diff --git a/i18n/locales/ja.json b/i18n/locales/ja.jsonindex cb301dfa..b2348f35 100644--- a/i18n/locales/ja.json+++ b/i18n/locales/ja.json@@ -474,10 +474,10 @@},"actions": {"reprocess": "再処理",- "viewLivePhoto": "ライブフォトプレビュー","refreshLocation": "都市情報を再取得","delete": "削除",- "editMetadata": "メタデータを編集"+ "editMetadata": "メタデータを編集",+ "previewPhoto": "プレビュー写真"},"selection": {"selected": "{count} / {total}行選択済み",diff --git a/i18n/locales/zh-Hans.json b/i18n/locales/zh-Hans.jsonindex a34b2b2e..f7f10c39 100644--- a/i18n/locales/zh-Hans.json+++ b/i18n/locales/zh-Hans.json@@ -119,7 +119,7 @@"totalPhotosWithRange": "{range}, 共 @:plural.photo","noPhotosTip": "还没有照片,快去上传一些吧!"},- "indexPanelCountCity":"等 {count} 个城市",+ "indexPanelCountCity": "等 {count} 个城市","album": {"noImage": "空相簿","emptyAlbumTip": "添加照片开始吧",@@ -161,22 +161,22 @@"add": "表态","change": "已表态","count": "无表态 | {count} 个表态 | {count} 个表态",- "like":"点赞",- "love":"爱心",- "amazing":"花痴",- "funny":"笑哭了",- "wow":"吃惊",- "sad":"哭",- "fire":"火焰",- "sparkle":"星星"+ "like": "点赞",+ "love": "爱心",+ "amazing": "花痴",+ "funny": "笑哭了",+ "wow": "吃惊",+ "sad": "哭",+ "fire": "火焰",+ "sparkle": "星星"},"photoload": {- "loadError":"图片加载失败",- "loading":"正在加载图片",- "converting":"正在转换中...",- "loadingWebGL":"正在加载 WebGL...",- "loadingHEIC":"HEIC 图片加载中...",- "loadingTexture":"正在构建纹理"+ "loadError": "图片加载失败",+ "loading": "正在加载图片",+ "converting": "正在转换中...",+ "loadingWebGL": "正在加载 WebGL...",+ "loadingHEIC": "HEIC 图片加载中...",+ "loadingTexture": "正在构建纹理"}},"exif": {@@ -531,10 +531,10 @@},"actions": {"reprocess": "重新处理",- "viewLivePhoto": "实况预览","refreshLocation": "重新获取城市","delete": "删除",- "editMetadata": "编辑信息"+ "editMetadata": "编辑信息",+ "previewPhoto": "预览照片"},"selection": {"selected": "{count} / {total} 行已选择",diff --git a/i18n/locales/zh-Hant-HK.json b/i18n/locales/zh-Hant-HK.jsonindex d9753177..070f46b6 100644--- a/i18n/locales/zh-Hant-HK.json+++ b/i18n/locales/zh-Hant-HK.json@@ -474,10 +474,10 @@},"actions": {"reprocess": "重新處理",- "viewLivePhoto": "實況相片預覽","refreshLocation": "重新取得城市","delete": "刪除",- "editMetadata": "編輯資訊"+ "editMetadata": "編輯資訊",+ "previewPhoto": "相片預覽"},"selection": {"selected": "已選擇 {count} / {total} 列",diff --git a/i18n/locales/zh-Hant-TW.json b/i18n/locales/zh-Hant-TW.jsonindex 5809e7c1..5eab7a49 100644--- a/i18n/locales/zh-Hant-TW.json+++ b/i18n/locales/zh-Hant-TW.json@@ -474,10 +474,10 @@},"actions": {"reprocess": "重新處理",- "viewLivePhoto": "原況照片預覽","refreshLocation": "重新取得城市","delete": "刪除",- "editMetadata": "編輯資訊"+ "editMetadata": "編輯資訊",+ "previewPhoto": "照片預覽"},"selection": {"selected": "已選擇 {count} / {total} 列",