Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: remove group storage capacity from profile page #2798

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 1 addition & 42 deletions frontend/pages/user/profile/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<p>{{ $t('profile.account-summary-description') }}</p>
</div>
<v-row tag="section">
<v-col cols="12" sm="12" md="6">
<v-col cols="12" sm="12" md="12">
<v-card outlined>
<v-card-title class="headline pb-0"> {{ $t('profile.group-statistics') }} </v-card-title>
<v-card-text class="py-0">
Expand All @@ -75,22 +75,6 @@
</v-card-text>
</v-card>
</v-col>
<v-col cols="12" sm="12" md="6" class="d-flex align-strart">
<v-card outlined>
<v-card-title class="headline pb-0"> {{ $t('profile.storage-capacity') }} </v-card-title>
<v-card-text class="py-0">
{{ $t('profile.storage-capacity-description') }}
<strong> {{ $t('general.this-feature-is-currently-inactive') }}</strong>
</v-card-text>
<v-card-text>
<v-progress-linear :value="storageUsedPercentage" color="accent" class="rounded" height="30">
<template #default>
<strong> {{ storageText }} </strong>
</template>
</v-progress-linear>
</v-card-text>
</v-card>
</v-col>
</v-row>
</section>
<v-divider class="my-7"></v-divider>
Expand Down Expand Up @@ -344,33 +328,8 @@ export default defineComponent({
return statsTo.value[key] ?? "unknown";
}

const storage = useAsync(async () => {
const { data } = await api.groups.storage();

if (data) {
return data;
}
}, useAsyncKey());

const storageUsedPercentage = computed(() => {
if (!storage.value) {
return 0;
}

return (storage.value?.usedStorageBytes / storage.value?.totalStorageBytes) * 100 ?? 0;
});

const storageText = computed(() => {
if (!storage.value) {
return "Loading...";
}
return `${storage.value.usedStorageStr} / ${storage.value.totalStorageStr}`;
});

return {
groupSlug,
storageText,
storageUsedPercentage,
getStatsTitle,
getStatsIcon,
getStatsTo,
Expand Down
Loading