Refreshed display of check results after all checks are complete.

This commit is contained in:
Andy Butland
2025-01-27 14:59:20 +01:00
committed by Jacob Overgaard
parent d90002247d
commit 151e0a89fb
3 changed files with 13 additions and 5 deletions

View File

@@ -20,9 +20,9 @@ export class UmbHealthCheckDashboardContext {
this.host = host;
}
checkAll() {
async checkAll() {
for (const [label, api] of this.apis.entries()) {
api?.checkGroup?.(label);
await api?.checkGroup?.(label);
}
}

View File

@@ -54,7 +54,7 @@ export class UmbDashboardHealthCheckGroupElement extends UmbLitElement {
private async _buttonHandler() {
this._buttonState = 'waiting';
this._api?.checkGroup(this.groupName);
await this._api?.checkGroup(this.groupName);
this._buttonState = 'success';
}

View File

@@ -23,7 +23,9 @@ export class UmbDashboardHealthCheckOverviewElement extends UmbLitElement {
}
private async _onHealthCheckHandler() {
this._healthCheckDashboardContext?.checkAll();
this._buttonState = 'waiting';
await this._healthCheckDashboardContext?.checkAll();
this._buttonState = 'success';
}
override render() {
@@ -41,7 +43,13 @@ export class UmbDashboardHealthCheckOverviewElement extends UmbLitElement {
</uui-button>
</div>
<div class="grid">
<umb-extension-slot type="healthCheck" default-element="umb-health-check-group-box-overview">
${
// As well as the visual presentation, this amend to the rendering based on button state is necessary
// in order to trigger an update after the checks are complete (this.requestUpdate() doesn't suffice).
this._buttonState !== 'waiting'
? html`<umb-extension-slot type="healthCheck" default-element="umb-health-check-group-box-overview">`
: html`<uui-loader></uui-loader>`}
</umb-extension-slot>
</div>
</uui-box>