From 2de9b13fced7273d1ce4f33f49dca2fe32e2d9f7 Mon Sep 17 00:00:00 2001 From: Vehbi Sinan Tunalioglu Date: Tue, 16 Apr 2024 10:37:24 +0800 Subject: [PATCH] feat(website): report errors on the overview component --- website/src/components/report/TabOverview.tsx | 57 ++++++++++++------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/website/src/components/report/TabOverview.tsx b/website/src/components/report/TabOverview.tsx index 8c0ca6b..a087800 100644 --- a/website/src/components/report/TabOverview.tsx +++ b/website/src/components/report/TabOverview.tsx @@ -9,14 +9,8 @@ export function TabOverview({ data }: { data: HostPatrolReport }) { const sshkeys = Object.values(buildSshKeysTable(data)); return ( -
+
-
- Showing summary of {data.hosts.length} host{data.hosts.length === 1 ? '' : 's'}, {data.knownSshKeys.length}{' '} - SSH public key{sshkeys.length === 1 ? '' : 's'} known, and total of {sshkeys.length} SSH public key - {sshkeys.length === 1 ? '' : 's'} seen. -
-
(x.isKnown ? 'Known SSH Keys' : 'Unknown SSH Keys'), sshkeys, { @@ -44,20 +38,41 @@ export function TabOverview({ data }: { data: HostPatrolReport }) {
- - This report is generated by{' '} - - hostpatrol v{data.meta.version} - {' '} - on{' '} - - {dayjs(data.meta.timestamp).format('LLLL')} - - . - +
+

+ {data.errors.length > 0 ? ( + + + {data.errors.length} error{data.errors.length === 1 ? '' : 's'} + {' '} + were encountered during patrol. + + ) : ( + No errors were encountered during the patrol. + )} +

+ + {data.errors.map((error, i) => ( +
+ {error.host} {error.message} +
+ ))} + +
+ This report is generated by{' '} + + hostpatrol v{data.meta.version} + {' '} + on{' '} + + {dayjs(data.meta.timestamp).format('LLLL')} + + . +
+
);