diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-11-08 17:44:26 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2024-01-16 10:25:03 +0100 |
commit | 129cd5e09c8bb38aa551ea1a8b6bf707d0066e76 (patch) | |
tree | c044fd2421a289d103f59982f2fc72c8dc5d4740 /apps | |
parent | 21042c3e0fbaa681f69652af7fe7e1efa5bf0eb2 (diff) | |
download | nextcloud-server-129cd5e09c8bb38aa551ea1a8b6bf707d0066e76.tar.gz nextcloud-server-129cd5e09c8bb38aa551ea1a8b6bf707d0066e76.zip |
feat(files): show quota warning on page load or if storage becomes full
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/NavigationQuota.vue | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files/src/components/NavigationQuota.vue b/apps/files/src/components/NavigationQuota.vue index 25bdcde1b45..30c6a65e6af 100644 --- a/apps/files/src/components/NavigationQuota.vue +++ b/apps/files/src/components/NavigationQuota.vue @@ -27,6 +27,7 @@ import { showError } from '@nextcloud/dialogs' import { subscribe } from '@nextcloud/event-bus' import { translate } from '@nextcloud/l10n' import axios from '@nextcloud/axios' + import ChartPie from 'vue-material-design-icons/ChartPie.vue' import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js' import NcProgressBar from '@nextcloud/vue/dist/Components/NcProgressBar.js' @@ -86,6 +87,13 @@ export default { subscribe('files:node:updated', this.throttleUpdateStorageStats) }, + mounted() { + // Warn the user if the available storage is 0 on page load + if (this.storageStats?.free === 0) { + this.showStorageFullWarning() + } + }, + methods: { // From user input debounceUpdateStorageStats: debounce(200, function(event) { @@ -113,6 +121,12 @@ export default { if (!response?.data?.data) { throw new Error('Invalid storage stats') } + + // Warn the user if the available storage changed from > 0 to 0 + if (this.storageStats?.free !== 0 && response.data.data?.free === 0) { + this.showStorageFullWarning() + } + this.storageStats = response.data.data } catch (error) { logger.error('Could not refresh storage stats', { error }) @@ -125,6 +139,10 @@ export default { } }, + showStorageFullWarning() { + showError(this.t('files', 'Your storage is full, files can not be updated or synced anymore!')) + }, + t: translate, }, } |