mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
health check success (#1267)
* health check success Co-authored-by: Drew Ansbacher <drew@start9labs.com>
This commit is contained in:
@@ -15,11 +15,7 @@
|
|||||||
</ion-item>
|
</ion-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-template #connected>
|
<ng-template #connected>
|
||||||
<ion-item
|
<ion-item *ngFor="let health of checks">
|
||||||
*ngFor="let health of checks"
|
|
||||||
button
|
|
||||||
(click)="presentAlertDescription(health.key)"
|
|
||||||
>
|
|
||||||
<ng-container *ngIf="health.value?.result as result; else noResult">
|
<ng-container *ngIf="health.value?.result as result; else noResult">
|
||||||
<ion-spinner
|
<ion-spinner
|
||||||
*ngIf="isLoading(result)"
|
*ngIf="isLoading(result)"
|
||||||
@@ -59,6 +55,17 @@
|
|||||||
<span *ngIf="result === HealthResult.Loading">
|
<span *ngIf="result === HealthResult.Loading">
|
||||||
{{ $any(health.value).message }}
|
{{ $any(health.value).message }}
|
||||||
</span>
|
</span>
|
||||||
|
<span
|
||||||
|
*ngIf="
|
||||||
|
result === HealthResult.Success &&
|
||||||
|
pkg.manifest['health-checks'][health.key]['success-message']
|
||||||
|
"
|
||||||
|
>
|
||||||
|
:
|
||||||
|
{{
|
||||||
|
pkg.manifest['health-checks'][health.key]['success-message']
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</ion-text>
|
</ion-text>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
@@ -70,7 +77,9 @@
|
|||||||
slot="start"
|
slot="start"
|
||||||
></ion-spinner>
|
></ion-spinner>
|
||||||
<ion-label>
|
<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>
|
<p>Awaiting result...</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -30,26 +30,6 @@ export class AppShowHealthChecksComponent {
|
|||||||
return result !== HealthResult.Failure && result !== HealthResult.Loading
|
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() {
|
asIsOrder() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,23 +82,19 @@ export const mockPatchData: DataModel = {
|
|||||||
'health-checks': {
|
'health-checks': {
|
||||||
'chain-state': {
|
'chain-state': {
|
||||||
name: 'Chain State',
|
name: 'Chain State',
|
||||||
description: 'Checks the chainstate',
|
|
||||||
},
|
},
|
||||||
'ephemeral-health-check': {
|
'ephemeral-health-check': {
|
||||||
name: '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': {
|
'p2p-interface': {
|
||||||
name: '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': {
|
'rpc-interface': {
|
||||||
name: 'RPC Interface',
|
name: 'RPC Interface',
|
||||||
description: 'Checks the RPC Interface',
|
|
||||||
},
|
},
|
||||||
'unnecessary-health-check': {
|
'unnecessary-health-check': {
|
||||||
name: 'Unneccessary Health Check',
|
name: 'Unneccessary Health Check',
|
||||||
description: 'Is totally not necessary to do this health check.',
|
|
||||||
},
|
},
|
||||||
} as any,
|
} as any,
|
||||||
config: {
|
config: {
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export interface Manifest {
|
|||||||
main: ActionImpl
|
main: ActionImpl
|
||||||
'health-checks': Record<
|
'health-checks': Record<
|
||||||
string,
|
string,
|
||||||
ActionImpl & { name: string; description: string }
|
ActionImpl & { name: string; 'success-message': string | null }
|
||||||
>
|
>
|
||||||
config: ConfigActions | null
|
config: ConfigActions | null
|
||||||
volumes: Record<string, Volume>
|
volumes: Record<string, Volume>
|
||||||
|
|||||||
Reference in New Issue
Block a user