From e7028ce64aa61ae791bbdc687ed5a566c291ce9d Mon Sep 17 00:00:00 2001 From: sua yoo Date: Tue, 21 May 2024 15:09:40 -0700 Subject: [PATCH] show quota status --- frontend/src/components/orgs-list.ts | 40 +++++++++++++++++++++++----- frontend/src/pages/home.ts | 8 +++--- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/orgs-list.ts b/frontend/src/components/orgs-list.ts index 1edfd29f..de8413de 100644 --- a/frontend/src/components/orgs-list.ts +++ b/frontend/src/components/orgs-list.ts @@ -12,12 +12,15 @@ import type { CurrentUser } from "@/types/user"; import { formatNumber } from "@/utils/localization"; import type { OrgData } from "@/utils/orgs"; +/** + * @fires update-quotas + */ @localized() @customElement("btrix-orgs-list") export class OrgsList extends TailwindElement { static styles = css` btrix-table { - grid-template-columns: [clickable-start] auto auto auto [clickable-end] min-content; + grid-template-columns: min-content [clickable-start] auto auto auto [clickable-end] min-content; } `; @property({ type: Object }) @@ -52,12 +55,15 @@ export class OrgsList extends TailwindElement { return html` - ${msg("Name")} - ${msg("Members")} + + ${msg("Status")} + + + ${msg("Name")} + + + ${msg("Members")} + ${msg("Bytes Stored")} @@ -246,6 +252,8 @@ export class OrgsList extends TailwindElement { this.dispatchEvent( new CustomEvent("update-quotas", { detail: this.currOrg }), ); + + void this.orgQuotaDialog?.hide(); } } @@ -272,6 +280,24 @@ export class OrgsList extends TailwindElement { ? "" : "opacity-50"} cursor-pointer select-none border-b bg-neutral-0 transition-colors first-of-type:rounded-t last-of-type:rounded-b last-of-type:border-none focus-within:bg-neutral-50 hover:bg-neutral-50" > + + ${org.storageQuotaReached || org.execMinutesQuotaReached + ? html` + + + + + ` + : html` + + + + + `} +
-
-

- ${msg("All Organizations")} -

+
+

${msg("All Organizations")}