From 2859ac35ce47846e57614b920130c00d31d51b0d Mon Sep 17 00:00:00 2001 From: Vehbi Sinan Tunalioglu Date: Sun, 31 Mar 2024 18:32:21 +0800 Subject: [PATCH] feat(website): adopt host's hostname and timezone --- .../src/components/report/ShowHostDetails.tsx | 20 ++++++++----- .../src/components/report/TabulateHosts.tsx | 28 ++++++++++++++++++- website/src/lib/data.ts | 4 +++ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/website/src/components/report/ShowHostDetails.tsx b/website/src/components/report/ShowHostDetails.tsx index f827df7..b5b1f57 100644 --- a/website/src/components/report/ShowHostDetails.tsx +++ b/website/src/components/report/ShowHostDetails.tsx @@ -9,7 +9,7 @@ import { KVBox } from '../helpers'; export function ShowHostDetails({ host }: { host: LhpHostReport }) { return (
-

+

{host.host.name} {host.host.url && ( @@ -19,12 +19,18 @@ export function ShowHostDetails({ host }: { host: LhpHostReport }) { )}
-
- {(host.host.tags || []).map((x) => ( - - {x} - - ))} +
+
+ {host.hostname} on {host.timezone} +
+ +
+ {(host.host.tags || []).map((x) => ( + + {x} + + ))} +

diff --git a/website/src/components/report/TabulateHosts.tsx b/website/src/components/report/TabulateHosts.tsx index 37d9d83..b4c9c86 100644 --- a/website/src/components/report/TabulateHosts.tsx +++ b/website/src/components/report/TabulateHosts.tsx @@ -40,6 +40,28 @@ export function TabulateHosts({
+
+ +
+
+ Name Hostname + Timezone Cloud Distribution Arch @@ -353,6 +377,8 @@ export function TabulateHosts({ )}
+ {host.hostname} + {host.timezone.split(' ', 1)[0] || 'UNKNOWN'} {host.cloud.name} {host.cloud.hostRegion && {host.cloud.hostRegion}} diff --git a/website/src/lib/data.ts b/website/src/lib/data.ts index eb818d9..e8b07b7 100644 --- a/website/src/lib/data.ts +++ b/website/src/lib/data.ts @@ -144,6 +144,7 @@ export const LHP_PATROL_REPORT_SCHEMA = { required: ['name'], type: 'object', }, + hostname: { $comment: 'Hostname of the host.', type: 'string' }, kernel: { $comment: 'Kernel information.\nKernel Information\nKernel', properties: { @@ -167,6 +168,7 @@ export const LHP_PATROL_REPORT_SCHEMA = { items: { type: 'string' }, type: 'array', }, + timezone: { $comment: 'Timezone of the host.', type: 'string' }, }, required: [ 'systemdTimers', @@ -177,6 +179,8 @@ export const LHP_PATROL_REPORT_SCHEMA = { 'kernel', 'hardware', 'cloud', + 'timezone', + 'hostname', 'host', ], type: 'object',