web: cleanup messages implementation (#386)
* web: rebuild messages without template objects * web: show error message when ws connection fails * web: show error message when siteshell page not found * web: fix spinner size for loading * web: fix linting error
This commit is contained in:
@ -6,6 +6,8 @@ import SpinnerStyle from "@patternfly/patternfly/components/Spinner/spinner.css"
|
||||
// @ts-ignore
|
||||
import BackdropStyle from "@patternfly/patternfly/components/Backdrop/backdrop.css";
|
||||
import { SpinnerSize } from "../../elements/Spinner";
|
||||
import { showMessage } from "../../elements/messages/MessageContainer";
|
||||
import { gettext } from "django";
|
||||
|
||||
@customElement("ak-site-shell")
|
||||
export class SiteShell extends LitElement {
|
||||
@ -64,6 +66,10 @@ export class SiteShell extends LitElement {
|
||||
}
|
||||
console.debug(`authentik/site-shell: Request failed ${this._url}`);
|
||||
window.location.hash = "#/";
|
||||
showMessage({
|
||||
level_tag: "error",
|
||||
message: gettext(`Request failed: ${r.statusText}`),
|
||||
});
|
||||
throw new Error("Request failed");
|
||||
})
|
||||
.then((r) => r.text())
|
||||
@ -115,7 +121,7 @@ export class SiteShell extends LitElement {
|
||||
html`<div class="pf-c-backdrop">
|
||||
<div class="pf-l-bullseye">
|
||||
<div class="pf-l-bullseye__item">
|
||||
<ak-spinner size=${SpinnerSize.Large}></ak-spinner>
|
||||
<ak-spinner size=${SpinnerSize.XLarge}></ak-spinner>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
Reference in New Issue
Block a user