Skip to content

Commit

Permalink
feat(website): adopt new host spec field on host details page
Browse files Browse the repository at this point in the history
  • Loading branch information
vst committed Apr 8, 2024
1 parent 141ed01 commit b6996b0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions website/src/components/report/ShowHostDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ export function ShowHostDetails({ host }: { host: LhpHostReport }) {
🔗
</Link>
)}
{host.host.id && (
<Chip
onClick={() => {
navigator.clipboard.writeText(host.host.id || '');
toast('External host identifier is copied to clipboard.');
}}
>
<span className="cursor-pointer">{host.host.id}</span>
</Chip>
)}
</div>

<div className="align-items flex flex-row items-center space-x-4">
Expand Down Expand Up @@ -139,6 +149,14 @@ export function ShowHostDetails({ host }: { host: LhpHostReport }) {

<KVBox title="Systemd Timers" kvs={host.systemdTimers.map((x) => ({ key: x, value: '✅' }))} />
</div>

<Card radius="sm" shadow="sm">
<CardHeader className="text-lg font-bold">Extra Host Data</CardHeader>

<CardBody>
<pre>{host.host.data ? JSON.stringify(host.host.data || '#N/A', null, 2) : '#N/A'}</pre>
</CardBody>
</Card>
</div>
);
}
2 changes: 2 additions & 0 deletions website/src/lib/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export const LHP_PATROL_REPORT_SCHEMA = {
host: {
$comment: 'Host descriptor.\nHost Descriptor\nHost',
properties: {
data: { $comment: 'Arbitrary data for the host.' },
id: { $comment: 'External identifier of the host.', type: 'string' },
name: { $comment: 'Name of the host.', type: 'string' },
ssh: {
$comment: 'SSH configuration.\nSSH Configuration\nSshConfig',
Expand Down

0 comments on commit b6996b0

Please sign in to comment.