From 5ada1439c5f00f160da20e49e1f19b83ece911c7 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Wed, 10 Jan 2024 17:35:17 +0000 Subject: [PATCH 1/3] fix(site): WorkspaceProxyPage: show wsproxy errors in context --- site/src/pages/HealthPage/WorkspaceProxyPage.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/site/src/pages/HealthPage/WorkspaceProxyPage.tsx b/site/src/pages/HealthPage/WorkspaceProxyPage.tsx index eec68104e5c4c..434fabfed473d 100644 --- a/site/src/pages/HealthPage/WorkspaceProxyPage.tsx +++ b/site/src/pages/HealthPage/WorkspaceProxyPage.tsx @@ -39,6 +39,9 @@ export const WorkspaceProxyPage = () => {
+ {workspace_proxy.error ? ( + {workspace_proxy.error} + ) : null} {workspace_proxy.warnings.map((warning) => { return ( @@ -48,6 +51,7 @@ export const WorkspaceProxyPage = () => { })} {regions.map((region) => { + const errors = region.status?.report?.errors ?? []; const warnings = region.status?.report?.warnings ?? []; return ( @@ -138,14 +142,17 @@ export const WorkspaceProxyPage = () => { color: theme.palette.text.secondary, }} > - {warnings.length > 0 ? ( + {warnings.length === 0 && errors.length === 0 ? ( + OK + ) : (
+ {errors.map((error, i) => ( + {error} + ))} {warnings.map((warning, i) => ( {warning} ))}
- ) : ( - No warnings )} {createDayString(region.updated_at)} From 5c5e65837aea250e6b49a1ffdced1319ec43ac2d Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Thu, 11 Jan 2024 09:52:30 +0000 Subject: [PATCH 2/3] apply suggestions from PR --- site/src/pages/HealthPage/WorkspaceProxyPage.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/site/src/pages/HealthPage/WorkspaceProxyPage.tsx b/site/src/pages/HealthPage/WorkspaceProxyPage.tsx index 434fabfed473d..3d6797ab68243 100644 --- a/site/src/pages/HealthPage/WorkspaceProxyPage.tsx +++ b/site/src/pages/HealthPage/WorkspaceProxyPage.tsx @@ -39,9 +39,9 @@ export const WorkspaceProxyPage = () => {
- {workspace_proxy.error ? ( + {workspace_proxy.error && ( {workspace_proxy.error} - ) : null} + )} {workspace_proxy.warnings.map((warning) => { return ( @@ -146,11 +146,8 @@ export const WorkspaceProxyPage = () => { OK ) : (
- {errors.map((error, i) => ( - {error} - ))} - {warnings.map((warning, i) => ( - {warning} + {[...errors, ...warnings].map((msg, i) => ( + {msg} ))}
)} From 207e728a6ba808f89eacf87c67cdbe156034bbeb Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Thu, 11 Jan 2024 10:27:17 +0000 Subject: [PATCH 3/3] improve unregistered proxy status --- site/src/pages/HealthPage/WorkspaceProxyPage.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/site/src/pages/HealthPage/WorkspaceProxyPage.tsx b/site/src/pages/HealthPage/WorkspaceProxyPage.tsx index 3d6797ab68243..a60175410ee40 100644 --- a/site/src/pages/HealthPage/WorkspaceProxyPage.tsx +++ b/site/src/pages/HealthPage/WorkspaceProxyPage.tsx @@ -142,12 +142,21 @@ export const WorkspaceProxyPage = () => { color: theme.palette.text.secondary, }} > - {warnings.length === 0 && errors.length === 0 ? ( + {region.status?.status === "unregistered" ? ( + Has not connected yet + ) : warnings.length === 0 && errors.length === 0 ? ( OK ) : (
{[...errors, ...warnings].map((msg, i) => ( - {msg} + + {msg} + ))}
)}