Skip to content

Commit ab5264b

Browse files
committed
dashboard: swap tooltips for popovers & change gifted execution minutes
color
1 parent 8249e18 commit ab5264b

File tree

2 files changed

+42
-38
lines changed

2 files changed

+42
-38
lines changed

frontend/src/components/ui/meter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export class MeterBar extends TailwindElement {
3838
if (this.value <= 0) {
3939
return;
4040
}
41-
return html`<sl-tooltip>
41+
return html`<btrix-popover placement="top">
4242
<div slot="content"><slot></slot></div>
4343
<div class="bar" style="width:${this.value}%"></div>
44-
</sl-tooltip>`;
44+
</btrix-popover>`;
4545
}
4646
}
4747

@@ -79,7 +79,7 @@ export class DividedMeterBar extends TailwindElement {
7979
`;
8080

8181
render() {
82-
return html`<sl-tooltip>
82+
return html`<btrix-popover placement="top">
8383
<div slot="content"><slot></slot></div>
8484
<div class="quotaBar" style="width:${this.quota}%">
8585
${when(this.value, () => {
@@ -91,7 +91,7 @@ export class DividedMeterBar extends TailwindElement {
9191
></div>`;
9292
})}
9393
</div>
94-
</sl-tooltip>`;
94+
</btrix-popover>`;
9595
}
9696
}
9797

frontend/src/pages/org/dashboard.ts

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -642,15 +642,15 @@ export class Dashboard extends BtrixElement {
642642
"",
643643
)})"
644644
>
645-
<div class="text-center">
646-
<div>${label}</div>
647-
<div class="text-xs opacity-80">
648-
${this.localize.bytes(value, {
649-
unitDisplay: "narrow",
650-
})}
651-
| ${this.renderPercentage(value / metrics.storageUsedBytes)}
652-
</div>
653-
</div>
645+
<header class="font-medium leading-none">${label}</header>
646+
<hr class="my-2" />
647+
<p>
648+
${this.localize.bytes(value, {
649+
unitDisplay: "narrow",
650+
})}
651+
<br />
652+
${this.renderPercentage(value / metrics.storageUsedBytes)}
653+
</p>
654654
</btrix-meter-bar>
655655
`;
656656
return html`
@@ -708,18 +708,21 @@ export class Dashboard extends BtrixElement {
708708
renderBar(misc, msg("Miscellaneous"), this.colors.misc),
709709
)}
710710
<div slot="available" class="flex-1">
711-
<sl-tooltip class="text-center">
711+
<btrix-popover placement="top" class="text-center">
712712
<div slot="content">
713-
<div>${msg("Available")}</div>
714-
<div class="text-xs opacity-80">
713+
<header class="font-medium leading-none">
714+
${msg("Available")}
715+
</header>
716+
<hr class="my-2" />
717+
<p>
715718
${this.renderPercentage(
716719
(metrics.storageQuotaBytes - metrics.storageUsedBytes) /
717720
metrics.storageQuotaBytes,
718721
)}
719-
</div>
722+
</p>
720723
</div>
721724
<div class="h-full w-full"></div>
722-
</sl-tooltip>
725+
</btrix-popover>
723726
</div>
724727
<span slot="valueLabel"
725728
>${this.localize.bytes(metrics.storageUsedBytes, {
@@ -849,28 +852,29 @@ export class Dashboard extends BtrixElement {
849852
return html` <btrix-divided-meter-bar
850853
value=${(used / quotaSecondsAllTypes) * 100}
851854
quota=${(quota / quotaSecondsAllTypes) * 100}
852-
style="--background-color:var(--sl-color-${color}-400); --quota-background-color:var(--sl-color-${color}-100)"
855+
style="--background-color:var(--sl-color-${color}-500); --quota-background-color:var(--sl-color-${color}-100)"
853856
>
854-
<div class="text-center">
855-
<div>${label}</div>
856-
<div class="text-xs opacity-80">
857-
${humanizeExecutionSeconds(used, { displaySeconds: true })} /
858-
${humanizeExecutionSeconds(quota, { displaySeconds: true })}
859-
</div>
860-
</div>
857+
<header class="font-medium leading-none">${label}</header>
858+
<hr class="my-2" />
859+
<p>
860+
${humanizeExecutionSeconds(used, { displaySeconds: true })}
861+
${msg("of")}
862+
<br />
863+
${humanizeExecutionSeconds(quota, { displaySeconds: true })}
864+
</p>
861865
</btrix-divided-meter-bar>`;
862866
} else {
863867
return html`<btrix-meter-bar
864868
value=${100}
865-
style="--background-color:var(--sl-color-${color}-400);"
869+
style="--background-color:var(--sl-color-${color}-500);"
866870
>
867-
<div class="text-center">
868-
<div>${label}</div>
869-
<div class="text-xs opacity-80">
870-
${humanizeExecutionSeconds(used, { displaySeconds: true })} |
871-
${this.renderPercentage(used / quota)}
872-
</div>
873-
</div>
871+
<header class="font-medium leading-none">${label}</header>
872+
<hr class="my-2" />
873+
<p>
874+
${humanizeExecutionSeconds(used, { displaySeconds: true })}
875+
<br />
876+
${this.renderPercentage(used / quota)}
877+
</p>
874878
</btrix-meter-bar>`;
875879
}
876880
};
@@ -919,7 +923,7 @@ export class Dashboard extends BtrixElement {
919923
usageSeconds > quotaSeconds ? quotaSeconds : usageSeconds,
920924
hasExtra ? quotaSeconds : quotaSecondsAllTypes,
921925
msg("Monthly Execution Time Used"),
922-
"green",
926+
"lime",
923927
hasExtra ? true : false,
924928
),
925929
)}
@@ -940,11 +944,11 @@ export class Dashboard extends BtrixElement {
940944
: usageSecondsExtra,
941945
quotaSecondsExtra,
942946
msg("Extra Execution Time Used"),
943-
"red",
947+
"violet",
944948
),
945949
)}
946950
<div slot="available" class="flex-1">
947-
<sl-tooltip class="text-center">
951+
<btrix-popover placement="top" class="text-center">
948952
<div slot="content">
949953
<div>${msg("Monthly Execution Time Remaining")}</div>
950954
<div class="text-xs opacity-80">
@@ -958,7 +962,7 @@ export class Dashboard extends BtrixElement {
958962
</div>
959963
</div>
960964
<div class="h-full w-full"></div>
961-
</sl-tooltip>
965+
</btrix-popover>
962966
</div>
963967
<span slot="valueLabel">
964968
${humanizeExecutionSeconds(usageSecondsAllTypes, {

0 commit comments

Comments
 (0)