Skip to content

Commit

Permalink
feat(website): list enabled systemd services and timers found on host
Browse files Browse the repository at this point in the history
  • Loading branch information
vst committed Mar 26, 2024
1 parent 8b38703 commit ea980cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions website/src/components/app/-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ export function TabulateHosts({ hosts, onHostSelect }: { hosts: LhpData[]; onHos
<TableColumn key="sshkeys" align="end">
SSH Keys
</TableColumn>
<TableColumn key="systemd" align="end">
Systemd
</TableColumn>
<TableColumn key="tags">Tags</TableColumn>
</TableHeader>
<TableBody items={hosts}>
Expand Down Expand Up @@ -175,6 +178,9 @@ export function TabulateHosts({ hosts, onHostSelect }: { hosts: LhpData[]; onHos
: `${host.dockerContainers.filter((x) => x.running).length} / ${host.dockerContainers.length}`}
</TableCell>
<TableCell>{host.sshAuthorizedKeys.length}</TableCell>
<TableCell>
{host.systemdServices.length} / {host.systemdTimers.length}
</TableCell>
<TableCell className="space-x-1">
{(host.host.tags || []).map((x) => (
<Chip key={x} size="sm" color="primary" variant="flat" radius="sm">
Expand Down Expand Up @@ -319,6 +325,12 @@ export function HostDetails({ host }: { host: LhpData }) {
</CardBody>
</Card>
</div>

<div className="grid grid-cols-1 gap-4 p-4 lg:grid-cols-2">
<KVBox title="Systemd Services" kvs={host.systemdServices.map((x) => ({ key: x, value: '✅' }))} />

<KVBox title="Systemd Timers" kvs={host.systemdTimers.map((x) => ({ key: x, value: '✅' }))} />
</div>
</div>
);
}
14 changes: 13 additions & 1 deletion website/src/components/app/-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,20 @@ export const LHP_PATROL_REPORT_SCHEMA = {
items: { type: 'string' },
type: 'array',
},
systemdServices: { $comment: 'List of systemd services found on host.', items: { type: 'string' }, type: 'array' },
systemdTimers: { $comment: 'List of systemd timers found on host.', items: { type: 'string' }, type: 'array' },
},
required: ['sshAuthorizedKeys', 'dockerContainers', 'distribution', 'kernel', 'hardware', 'cloud', 'host'],
required: [
'systemdTimers',
'systemdServices',
'sshAuthorizedKeys',
'dockerContainers',
'distribution',
'kernel',
'hardware',
'cloud',
'host',
],
type: 'object',
} as const satisfies JSONSchema;

Expand Down

0 comments on commit ea980cd

Please sign in to comment.