Skip to content

Commit

Permalink
Merge pull request #6 from ether/add_health_problems
Browse files Browse the repository at this point in the history
Add information about server health like database failures and websocket support
  • Loading branch information
Gared authored Jun 23, 2024
2 parents 54824c5 + 5642f2e commit 3fa1ea2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/pages/instances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export const Instances = () => {

if (!filteredInstances) return <LoadingSpinner/>

const dbFailures = instance?.scan.db_reads_failed + instance?.scan.db_writes_failed

Check failure on line 51 in src/pages/instances.tsx

View workflow job for this annotation

GitHub Actions / deploy

'instance.scan.db_reads_failed' is possibly 'undefined'.

Check failure on line 51 in src/pages/instances.tsx

View workflow job for this annotation

GitHub Actions / deploy

'instance.scan.db_writes_failed' is possibly 'undefined'.

return (
<div className="m-5 flex flex-col h-screen"><h1 className="text-4xl font-bold mb-5">Scanned instances</h1>
<p>
Expand Down Expand Up @@ -160,6 +162,19 @@ export const Instances = () => {
</CardContent>
</CardHeader>
</Card>
<div className="col-span-2">
<Card>
<CardHeader>
<CardTitle>Health</CardTitle>
</CardHeader>
<CardContent>
<ul className="list-disc ml-5">
{ instance?.scan.websocket_available && <li>Websocket supported: {instance?.scan.websocket_available ? <span>Yes</span> : <span className="text-red-700">No</span>}</li> }
<li>DB failures: {dbFailures}</li>
</ul>
</CardContent>
</Card>
</div>
<div className="col-span-2">
<Card>
<CardHeader>
Expand Down
5 changes: 4 additions & 1 deletion src/types/InstancesResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ type ScanResult = {
api_version: string,
version: string,
scan_time: string,
plugins: string[]
plugins: string[],
websocket_available: boolean,
db_reads_failed: number,
db_writes_failed: number,
}

0 comments on commit 3fa1ea2

Please sign in to comment.