From 7f0587842d1c0702b065a0849c57159782a94933 Mon Sep 17 00:00:00 2001 From: Parkreiner Date: Thu, 9 Nov 2023 20:20:33 +0000 Subject: [PATCH 1/3] chore: clean up DeploymentBannerView markup --- .../Dashboard/DeploymentBanner/DeploymentBannerView.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx b/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx index 847761dceda55..a8c478fb8d6cd 100644 --- a/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx +++ b/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx @@ -75,13 +75,14 @@ export interface DeploymentBannerViewProps { export const DeploymentBannerView: FC = (props) => { const { health, stats, fetchStats } = props; const theme = useTheme(); + const aggregatedMinutes = useMemo(() => { if (!stats) { return; } return dayjs(stats.collected_at).diff(stats.aggregated_from, "minutes"); }, [stats]); - const displayLatency = stats?.workspaces.connection_latency_ms.P50 || -1; + const [timeUntilRefresh, setTimeUntilRefresh] = useState(0); useEffect(() => { if (!stats || !fetchStats) { @@ -151,6 +152,8 @@ export const DeploymentBannerView: FC = (props) => { pointer-events: none; `; + const displayLatency = stats?.workspaces.connection_latency_ms.P50 || -1; + return (
= (props) => {
)} +
Workspaces
@@ -245,6 +249,7 @@ export const DeploymentBannerView: FC = (props) => { />
+
Transmission
@@ -279,6 +284,7 @@ export const DeploymentBannerView: FC = (props) => {
+
Active Connections
@@ -317,6 +323,7 @@ export const DeploymentBannerView: FC = (props) => {
+
Date: Thu, 9 Nov 2023 20:32:07 +0000 Subject: [PATCH 2/3] fix: remove extra scrollbar --- .../Dashboard/DeploymentBanner/DeploymentBannerView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx b/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx index a8c478fb8d6cd..89cd4b1da31fa 100644 --- a/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx +++ b/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx @@ -131,7 +131,7 @@ export const DeploymentBannerView: FC = (props) => { justify-content: center; background-color: ${unhealthy ? colors.red[10] : undefined}; padding: 0 12px; - height: ${bannerHeight}px; + height: calc(${bannerHeight}px - 1px); color: #fff; & svg { @@ -158,6 +158,7 @@ export const DeploymentBannerView: FC = (props) => {
Date: Thu, 9 Nov 2023 20:45:14 +0000 Subject: [PATCH 3/3] refactor: remove needless calc call --- .../Dashboard/DeploymentBanner/DeploymentBannerView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx b/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx index 89cd4b1da31fa..61f68cc5b0f0b 100644 --- a/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx +++ b/site/src/components/Dashboard/DeploymentBanner/DeploymentBannerView.tsx @@ -131,7 +131,7 @@ export const DeploymentBannerView: FC = (props) => { justify-content: center; background-color: ${unhealthy ? colors.red[10] : undefined}; padding: 0 12px; - height: calc(${bannerHeight}px - 1px); + height: 100%; color: #fff; & svg {