diff --git a/client/src/components/User/DiskUsage/DiskUsageSummary.vue b/client/src/components/User/DiskUsage/DiskUsageSummary.vue index 213225582f5e..a8d6c7fbfc50 100644 --- a/client/src/components/User/DiskUsage/DiskUsageSummary.vue +++ b/client/src/components/User/DiskUsage/DiskUsageSummary.vue @@ -7,7 +7,12 @@ {{ errorMessage }}
- +
+ + + + +

You're using {{ getTotalDiskUsage(user) }} of disk space.

@@ -20,15 +25,19 @@ diff --git a/client/src/components/User/DiskUsage/Quota/QuotaUsageProvider.js b/client/src/components/User/DiskUsage/Quota/QuotaUsageProvider.js new file mode 100644 index 000000000000..a794b00291aa --- /dev/null +++ b/client/src/components/User/DiskUsage/Quota/QuotaUsageProvider.js @@ -0,0 +1,24 @@ +import axios from "axios"; +import { SingleQueryProvider } from "components/providers/SingleQueryProvider"; +import { getAppRoot } from "onload/loadConfig"; +import { rethrowSimple } from "utils/simple-error"; +import { QuotaUsage } from "./model"; + +// TODO: replace this with the proper provider and API call after +// https://github.com/galaxyproject/galaxy/pull/10977 is available + +/** + * Fetches the disk usage by the user across all ObjectStores. + * @returns {Array} + */ +async function fetchQuotaUsage() { + const url = `${getAppRoot()}api/users/current`; + try { + const { data } = await axios.get(url); + return [new QuotaUsage(data)]; + } catch (e) { + rethrowSimple(e); + } +} + +export const QuotaUsageProvider = SingleQueryProvider(fetchQuotaUsage); diff --git a/client/src/components/User/DiskUsage/Quota/QuotaUsageSummary.vue b/client/src/components/User/DiskUsage/Quota/QuotaUsageSummary.vue index 638693c5ae7f..8bc00f8a60ed 100644 --- a/client/src/components/User/DiskUsage/Quota/QuotaUsageSummary.vue +++ b/client/src/components/User/DiskUsage/Quota/QuotaUsageSummary.vue @@ -1,18 +1,16 @@ @@ -20,43 +18,31 @@