Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix(cloud): explain photo quota reservations with info tooltips

Timothy Yind0c4d5890161
diff --git a/apps/cloud/app/components/CloudPricing.vue b/apps/cloud/app/components/CloudPricing.vue
index dd3cce62..ad75f69e 100644
--- a/apps/cloud/app/components/CloudPricing.vue
+++ b/apps/cloud/app/components/CloudPricing.vue
@@ -739,8 +739,7 @@ async function submitCheckout(plan: any, mode?: string) {
v-for="key in BILLING_LIMITS"
:key="key"
>
- <span>{{ $t('cloud.billing.' + key) }}</span
- ><strong
+ <CloudQuotaLabel :quota="key" /><strong
><UIcon
v-if="key === 'byos'"
:name="
diff --git a/apps/cloud/app/components/CloudQuotaLabel.vue b/apps/cloud/app/components/CloudQuotaLabel.vue
new file mode 100644
index 00000000..1d027596
--- /dev/null
+++ b/apps/cloud/app/components/CloudQuotaLabel.vue
@@ -0,0 +1,24 @@
+<script setup lang="ts">
+defineProps<{ quota: string }>()
+</script>
+<template>
+ <span class="inline-flex items-center gap-1">
+ {{ $t('cloud.billing.' + quota) }}
+ <UTooltip
+ v-if="quota === 'photos'"
+ :text="$t('cloud.billing.photosQuotaHelp')"
+ :ui="{ content: 'max-w-xs h-auto whitespace-normal' }"
+ >
+ <button
+ type="button"
+ class="inline-flex shrink-0 items-center text-muted focus-visible:outline-2 focus-visible:outline-offset-2"
+ :aria-label="$t('cloud.billing.photosQuotaHelp')"
+ >
+ <UIcon
+ name="i-lucide-info"
+ class="size-3.5"
+ />
+ </button>
+ </UTooltip>
+ </span>
+</template>
diff --git a/apps/cloud/app/pages/account/plan.vue b/apps/cloud/app/pages/account/plan.vue
index f1f6ac0d..aa751793 100644
--- a/apps/cloud/app/pages/account/plan.vue
+++ b/apps/cloud/app/pages/account/plan.vue
@@ -208,7 +208,7 @@ const date = (time: number) => new Date(time).toLocaleString(locale.value)
:key="key"
class="cf-quota-card"
>
- <h3>{{ $t('cloud.billing.' + key) }}</h3>
+ <h3><CloudQuotaLabel :quota="key" /></h3>
<p v-if="used(key) === null">
<strong>{{
allowance(key, data.plan.limits[key], locale)
diff --git a/apps/cloud/app/pages/workspace.vue b/apps/cloud/app/pages/workspace.vue
index c2a68d05..828c0c2c 100644
--- a/apps/cloud/app/pages/workspace.vue
+++ b/apps/cloud/app/pages/workspace.vue
@@ -79,7 +79,8 @@ useSeoMeta({
data ? allowance(key, data.plan.limits[key], locale) : undefined
"
:progress="data ? progress(key) : undefined"
- />
+ ><template #label><CloudQuotaLabel :quota="key" /></template
+ ></CfUsageMeter>
</section>
<section
class="cf-workspace-sites"
diff --git a/apps/cloud/i18n/locales/en.json b/apps/cloud/i18n/locales/en.json
index 8574fa6a..8b3a94d7 100644
--- a/apps/cloud/i18n/locales/en.json
+++ b/apps/cloud/i18n/locales/en.json
@@ -663,7 +663,8 @@
"storageBytes": "Platform storage",
"fileBytes": "Maximum file size",
"sites": "Sites",
- "photos": "Photographs (including pending uploads)",
+ "photos": "Photographs",
+ "photosQuotaHelp": "Photo usage includes uploaded photographs and reserved slots for uploads that have been requested but are not yet complete. Reservations prevent concurrent uploads from exceeding your plan limit; they do not mean those uploads have completed.",
"customDomains": "Custom domains",
"byos": "Custom S3 storage",
"monthlyBytes": "Monthly uploads",
diff --git a/apps/cloud/i18n/locales/zh-Hans.json b/apps/cloud/i18n/locales/zh-Hans.json
index 57ba8471..1b69f8e0 100644
--- a/apps/cloud/i18n/locales/zh-Hans.json
+++ b/apps/cloud/i18n/locales/zh-Hans.json
@@ -663,7 +663,8 @@
"storageBytes": "平台存储",
"fileBytes": "单文件上限",
"sites": "站点数量",
- "photos": "照片数量(含待上传)",
+ "photos": "照片数量",
+ "photosQuotaHelp": "照片配额按已上传的照片与已申请上传但尚未完成的预留名额合计。预留名额用于防止并发上传超出套餐上限,不代表这些照片已上传完成。",
"customDomains": "自定义域名",
"byos": "自定义 S3 存储",
"monthlyBytes": "月度上传量",
diff --git a/packages/saas-ui/app/components/CfUsageMeter.vue b/packages/saas-ui/app/components/CfUsageMeter.vue
index 62dd03cb..59864b74 100644
--- a/packages/saas-ui/app/components/CfUsageMeter.vue
+++ b/packages/saas-ui/app/components/CfUsageMeter.vue
@@ -10,7 +10,8 @@ defineProps<{
<template>
<div class="cf-usage-meter">
<div class="cf-usage-heading">
- <span>{{ label }}</span
+ <span
+ ><slot name="label">{{ label }}</slot></span
><CfSkeleton
v-if="loading"
class="h-4 w-20"