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";
|
2020-12-16 22:02:43 +00:00
|
|
|
import { Config } from "../../api/Config";
|
2020-11-22 18:37:09 +00:00
|
|
|
|
2020-12-01 12:16:13 +00:00
|
|
|
export const DefaultConfig: Config = {
|
2020-12-05 21:08:42 +00:00
|
|
|
branding_logo: " /static/dist/assets/icons/icon_left_brand.svg",
|
|
|
|
branding_title: "authentik",
|
2020-12-01 16:27:19 +00:00
|
|
|
|
|
|
|
error_reporting_enabled: false,
|
|
|
|
error_reporting_environment: "",
|
|
|
|
error_reporting_send_pii: 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 {
|
2020-11-26 21:37:41 +00:00
|
|
|
Config.get().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">
|
|
|
|
<img src="${this.config.branding_logo}" alt="authentik icon" loading="lazy" />
|
2020-11-22 18:37:09 +00:00
|
|
|
</div>
|
|
|
|
</a>`;
|
|
|
|
}
|
|
|
|
}
|