2020-12-01 16:27:19 +00:00
|
|
|
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
|
2020-11-22 18:37:09 +00:00
|
|
|
// @ts-ignore
|
|
|
|
import PageStyle from "@patternfly/patternfly/components/Page/page.css";
|
|
|
|
// @ts-ignore
|
|
|
|
import GlobalsStyle from "@patternfly/patternfly/base/patternfly-globals.css";
|
2021-03-08 10:14:00 +00:00
|
|
|
import { configureSentry } from "../../api/Config";
|
|
|
|
import { Config } from "../../api";
|
|
|
|
import { ifDefined } from "lit-html/directives/if-defined";
|
2020-11-22 18:37:09 +00:00
|
|
|
|
2020-12-01 12:16:13 +00:00
|
|
|
export const DefaultConfig: Config = {
|
2021-03-08 10:14:00 +00:00
|
|
|
brandingLogo: " /static/dist/assets/icons/icon_left_brand.svg",
|
|
|
|
brandingTitle: "authentik",
|
2020-12-01 16:27:19 +00:00
|
|
|
|
2021-03-08 10:14:00 +00:00
|
|
|
errorReportingEnabled: false,
|
|
|
|
errorReportingEnvironment: "",
|
|
|
|
errorReportingSendPii: false,
|
2020-12-01 12:16:13 +00:00
|
|
|
};
|
|
|
|
|
2020-12-05 21:08:42 +00:00
|
|
|
@customElement("ak-sidebar-brand")
|
2020-11-22 18:37:09 +00:00
|
|
|
export class SidebarBrand extends LitElement {
|
2020-12-02 14:44:40 +00:00
|
|
|
@property({attribute: false})
|
2020-12-01 12:16:13 +00:00
|
|
|
config: Config = DefaultConfig;
|
2020-11-22 18:37:09 +00:00
|
|
|
|
2020-12-01 16:27:19 +00:00
|
|
|
static get styles(): CSSResult[] {
|
2020-11-22 18:37:09 +00:00
|
|
|
return [
|
|
|
|
GlobalsStyle,
|
|
|
|
PageStyle,
|
|
|
|
css`
|
2020-12-05 21:08:42 +00:00
|
|
|
:host {
|
2020-11-22 18:37:09 +00:00
|
|
|
display: flex;
|
2020-12-05 21:08:42 +00:00
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
height: 82px;
|
2020-11-22 18:37:09 +00:00
|
|
|
}
|
|
|
|
.pf-c-brand img {
|
2020-12-05 21:08:42 +00:00
|
|
|
width: 100%;
|
|
|
|
padding: 0 .5rem;
|
2020-12-14 18:26:02 +00:00
|
|
|
height: 42px;
|
2020-11-22 18:37:09 +00:00
|
|
|
}
|
|
|
|
`,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-12-05 21:08:42 +00:00
|
|
|
firstUpdated(): void {
|
2021-03-08 10:14:00 +00:00
|
|
|
configureSentry().then((c) => {this.config = c;});
|
2020-11-23 10:50:38 +00:00
|
|
|
}
|
|
|
|
|
2020-12-01 16:27:19 +00:00
|
|
|
render(): TemplateResult {
|
2020-12-01 12:16:13 +00:00
|
|
|
return html` <a href="#/" class="pf-c-page__header-brand-link">
|
2020-12-05 21:08:42 +00:00
|
|
|
<div class="pf-c-brand ak-brand">
|
2021-03-08 10:14:00 +00:00
|
|
|
<img src="${ifDefined(this.config.brandingLogo)}" alt="authentik icon" loading="lazy" />
|
2020-11-22 18:37:09 +00:00
|
|
|
</div>
|
|
|
|
</a>`;
|
|
|
|
}
|
|
|
|
}
|