web: fix API browser error (#5402)

* web: fix API browser error

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix lint

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* update locale

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-04-28 12:21:46 +03:00
committed by GitHub
parent 6f67366dfa
commit cb0fa6beb9
13 changed files with 13065 additions and 12672 deletions

View File

@ -24,6 +24,19 @@ export function globalAK(): GlobalAuthentik {
ak.tenant = CurrentTenantFromJSON(ak.tenant);
ak.config = ConfigFromJSON(ak.config);
}
if (!ak) {
return {
config: ConfigFromJSON({
capabilities: [],
}),
tenant: CurrentTenantFromJSON({
ui_footer_links: [],
}),
versionFamily: "",
versionSubdomain: "",
build: "",
};
}
return ak;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
import { EVENT_THEME_CHANGE } from "@goauthentik/common/constants";
import { globalAK } from "@goauthentik/common/global";
import { first, getCookie } from "@goauthentik/common/utils";
import { Interface } from "@goauthentik/elements/Base";
import { DefaultTenant } from "@goauthentik/elements/sidebar/SidebarBrand";
@ -55,6 +56,10 @@ export class APIBrowser extends Interface {
);
}
async getTheme(): Promise<UiThemeEnum> {
return globalAK()?.tenant.uiTheme || UiThemeEnum.Automatic;
}
render(): TemplateResult {
return html`
<rapi-doc
@ -77,6 +82,7 @@ export class APIBrowser extends Interface {
show-header="false"
allow-spec-url-load="false"
allow-spec-file-load="false"
show-method-in-nav-bar="as-colored-text"
@before-try=${(
e: CustomEvent<{
request: {