web/admin: make version clickable for stable releases (#6626)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
b08ca98d18
commit
72dd758160
|
@ -12,7 +12,6 @@ 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> {
|
||||||
headerLink = "https://goauthentik.io/docs/releases";
|
|
||||||
icon = "pf-icon pf-icon-bundle";
|
icon = "pf-icon pf-icon-bundle";
|
||||||
|
|
||||||
getPrimaryValue(): Promise<Version> {
|
getPrimaryValue(): Promise<Version> {
|
||||||
|
@ -43,16 +42,12 @@ export class VersionStatusCard extends AdminStatusCard<Version> {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderValue(): TemplateResult {
|
renderValue(): TemplateResult {
|
||||||
|
let text = this.value?.versionCurrent;
|
||||||
|
let link = "https://goauthentik.io/docs/releases/${this.value?.versionCurrent}";
|
||||||
if (this.value?.buildHash) {
|
if (this.value?.buildHash) {
|
||||||
return html`
|
text = this.value.buildHash?.substring(0, 7);
|
||||||
<a
|
link = "https://github.com/goauthentik/authentik/commit/${this.value.buildHash}";
|
||||||
href="https://github.com/goauthentik/authentik/commit/${this.value.buildHash}"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
${this.value.buildHash?.substring(0, 7)}
|
|
||||||
</a>
|
|
||||||
`;
|
|
||||||
}
|
}
|
||||||
return html`${this.value?.versionCurrent}`;
|
return html`<a href=${link} target="_blank"> ${text} </a>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue