health check success (#1267)

* health check success

Co-authored-by: Drew Ansbacher <drew@start9labs.com>
This commit is contained in:
Drew Ansbacher
2022-02-24 12:55:30 -07:00
committed by GitHub
parent 16de45e4fd
commit 3f26f20e85
4 changed files with 17 additions and 32 deletions

View File

@@ -15,11 +15,7 @@
</ion-item>
</ng-container>
<ng-template #connected>
<ion-item
*ngFor="let health of checks"
button
(click)="presentAlertDescription(health.key)"
>
<ion-item *ngFor="let health of checks">
<ng-container *ngIf="health.value?.result as result; else noResult">
<ion-spinner
*ngIf="isLoading(result)"
@@ -59,6 +55,17 @@
<span *ngIf="result === HealthResult.Loading">
{{ $any(health.value).message }}
</span>
<span
*ngIf="
result === HealthResult.Success &&
pkg.manifest['health-checks'][health.key]['success-message']
"
>
:
{{
pkg.manifest['health-checks'][health.key]['success-message']
}}
</span>
</p>
</ion-text>
</ion-label>
@@ -70,7 +77,9 @@
slot="start"
></ion-spinner>
<ion-label>
<h2 class="bold">{{ pkg.manifest['health-checks'][health.key].name }}</h2>
<h2 class="bold">
{{ pkg.manifest['health-checks'][health.key].name }}
</h2>
<p>Awaiting result...</p>
</ion-label>
</ng-template>

View File

@@ -30,26 +30,6 @@ export class AppShowHealthChecksComponent {
return result !== HealthResult.Failure && result !== HealthResult.Loading
}
async presentAlertDescription(id: string) {
const health = this.pkg.manifest['health-checks'][id]
const alert = await this.alertCtrl.create({
header: 'Health Check',
subHeader: health.name,
message: health.description,
buttons: [
{
text: `OK`,
handler: () => {
alert.dismiss()
},
cssClass: 'enter-click',
},
],
})
await alert.present()
}
asIsOrder() {
return 0
}

View File

@@ -82,23 +82,19 @@ export const mockPatchData: DataModel = {
'health-checks': {
'chain-state': {
name: 'Chain State',
description: 'Checks the chainstate',
},
'ephemeral-health-check': {
name: 'Ephemeral Health Check',
description: `Checks to see if your new user registrations are on. If they are but you're not expecting any new user signups, you should disable this in Config, as anyone who knows your onion URL can create accounts on your server.`,
},
'p2p-interface': {
name: 'P2P Interface',
description: `Checks to see if your new user registrations are on. If they are but you're not expecting any new user signups, you should disable this in Config, as anyone who knows your onion URL can create accounts on your server.`,
'success-message': 'the health check ran succesfully',
},
'rpc-interface': {
name: 'RPC Interface',
description: 'Checks the RPC Interface',
},
'unnecessary-health-check': {
name: 'Unneccessary Health Check',
description: 'Is totally not necessary to do this health check.',
},
} as any,
config: {

View File

@@ -128,7 +128,7 @@ export interface Manifest {
main: ActionImpl
'health-checks': Record<
string,
ActionImpl & { name: string; description: string }
ActionImpl & { name: string; 'success-message': string | null }
>
config: ConfigActions | null
volumes: Record<string, Volume>