From 360b1479897f7f344c6745fd9f07d36dc4dcf716 Mon Sep 17 00:00:00 2001 From: guerler Date: Fri, 28 Jun 2024 12:39:27 +0200 Subject: [PATCH] Disable storage dashboard for anon users --- client/src/components/Masthead/QuotaMeter.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/components/Masthead/QuotaMeter.vue b/client/src/components/Masthead/QuotaMeter.vue index 55833a9ab511..6658ea7c7097 100644 --- a/client/src/components/Masthead/QuotaMeter.vue +++ b/client/src/components/Masthead/QuotaMeter.vue @@ -8,7 +8,7 @@ import { useUserStore } from "@/stores/userStore"; import { bytesToString } from "@/utils/utils"; const { config } = useConfig(); -const { currentUser } = storeToRefs(useUserStore()); +const { currentUser, isAnonymous } = storeToRefs(useUserStore()); const hasQuota = computed(() => { const quotasEnabled = config.value.enable_quotas ?? false; @@ -30,6 +30,10 @@ const usage = computed(() => { return currentUser.value?.total_disk_usage ?? 0; }); +const quotaTitle = computed(() => + isAnonymous.value ? "Login to Access Storage Details" : "Storage and Usage Details" +); + const variant = computed(() => { if (!hasQuota.value || usage.value < 80) { return "success"; @@ -41,8 +45,8 @@ const variant = computed(() => {