web/elements: add ak-label for status to replace simple icons

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-09 16:59:45 +02:00
parent 34b8a97ae9
commit c887139367
9 changed files with 207 additions and 143 deletions

View File

@ -18,6 +18,7 @@ import { OutpostsApi, ServiceConnection } from "authentik-api";
import { DEFAULT_CONFIG } from "../../api/Config";
import "../../elements/forms/ProxyForm";
import { ifDefined } from "lit-html/directives/if-defined";
import { PFColor } from "../../elements/Label";
@customElement("ak-outpost-service-connection-list")
export class OutpostServiceConnectionListPage extends TablePage<ServiceConnection> {
@ -66,9 +67,9 @@ export class OutpostServiceConnectionListPage extends TablePage<ServiceConnectio
uuid: item.pk || ""
}).then((state) => {
if (state.healthy) {
return html`<i class="fas fa-check pf-m-success"></i>&nbsp;${state.version}`;
return html`<ak-label color=${PFColor.Green} text=${ifDefined(state.version)}></ak-label>`;
}
return html`<i class="fas fa-times pf-m-danger"></i>&nbsp;${t`Unhealthy`}`;
return html`<ak-label color=${PFColor.Red} text=${t`Unhealthy`}></ak-label>`;
}), html`<ak-spinner></ak-spinner>`)}`,
html`
<ak-forms-modal>