web/admin: set card headers and icons in card class

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-09-24 17:45:23 +02:00
parent bba21d2b85
commit d0241e8063
4 changed files with 12 additions and 17 deletions

View File

@ -168,30 +168,17 @@ export class AdminOverviewPage extends AKElement {
<div <div
class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container" class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container"
> >
<ak-admin-status-system <ak-admin-status-system> </ak-admin-status-system>
icon="pf-icon pf-icon-server"
header=${t`System status`}
>
</ak-admin-status-system>
</div> </div>
<div <div
class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container" class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container"
> >
<ak-admin-status-version <ak-admin-status-version> </ak-admin-status-version>
icon="pf-icon pf-icon-bundle"
header=${t`Version`}
headerLink="https://github.com/goauthentik/authentik/releases"
>
</ak-admin-status-version>
</div> </div>
<div <div
class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container" class="pf-l-grid__item pf-m-6-col pf-m-4-col-on-md pf-m-4-col-on-xl card-container"
> >
<ak-admin-status-card-workers <ak-admin-status-card-workers> </ak-admin-status-card-workers>
icon="pf-icon pf-icon-server"
header=${t`Workers`}
>
</ak-admin-status-card-workers>
</div> </div>
<div class="pf-l-grid__item pf-m-12-col row-divider"> <div class="pf-l-grid__item pf-m-12-col row-divider">
<hr /> <hr />

View File

@ -15,7 +15,8 @@ import { AdminApi, OutpostsApi, System } from "@goauthentik/api";
export class SystemStatusCard extends AdminStatusCard<System> { export class SystemStatusCard extends AdminStatusCard<System> {
now?: Date; now?: Date;
header = t`OK`; header = t`System status`;
icon = "pf-icon pf-icon-server";
async getPrimaryValue(): Promise<System> { async getPrimaryValue(): Promise<System> {
this.now = new Date(); this.now = new Date();

View File

@ -13,6 +13,10 @@ import { AdminApi, Version } from "@goauthentik/api";
@customElement("ak-admin-status-version") @customElement("ak-admin-status-version")
export class VersionStatusCard extends AdminStatusCard<Version> { export class VersionStatusCard extends AdminStatusCard<Version> {
header = t`Version`;
headerLink = "https://goauthentik.io/docs/releases";
icon = "pf-icon pf-icon-bundle";
getPrimaryValue(): Promise<Version> { getPrimaryValue(): Promise<Version> {
return new AdminApi(DEFAULT_CONFIG).adminVersionRetrieve(); return new AdminApi(DEFAULT_CONFIG).adminVersionRetrieve();
} }

View File

@ -13,6 +13,9 @@ import { AdminApi } from "@goauthentik/api";
@customElement("ak-admin-status-card-workers") @customElement("ak-admin-status-card-workers")
export class WorkersStatusCard extends AdminStatusCard<number> { export class WorkersStatusCard extends AdminStatusCard<number> {
header = t`Workers`;
icon = "pf-icon pf-icon-server";
getPrimaryValue(): Promise<number> { getPrimaryValue(): Promise<number> {
return new AdminApi(DEFAULT_CONFIG).adminWorkersRetrieve().then((workers) => { return new AdminApi(DEFAULT_CONFIG).adminWorkersRetrieve().then((workers) => {
return workers.count; return workers.count;