root: fix formatting

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-06 00:11:24 +02:00
parent 8044818a4d
commit 2d5094fdf7
11 changed files with 99 additions and 61 deletions

View File

@ -18,7 +18,10 @@ class Migration(migrations.Migration):
),
),
migrations.AlterModelOptions(
name='authenticatedsession',
options={'verbose_name': 'Authenticated Session', 'verbose_name_plural': 'Authenticated Sessions'},
name="authenticatedsession",
options={
"verbose_name": "Authenticated Session",
"verbose_name_plural": "Authenticated Sessions",
},
),
]

View File

@ -12,7 +12,12 @@ import PFContent from "@patternfly/patternfly/components/Content/content.css";
import AKGlobal from "../authentik.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFButton from "@patternfly/patternfly/components/Button/button.css";
import { EVENT_API_DRAWER_TOGGLE, EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_SIDEBAR_TOGGLE, TITLE_DEFAULT } from "../constants";
import {
EVENT_API_DRAWER_TOGGLE,
EVENT_NOTIFICATION_DRAWER_TOGGLE,
EVENT_SIDEBAR_TOGGLE,
TITLE_DEFAULT,
} from "../constants";
import { DEFAULT_CONFIG, tenant } from "../api/Config";
import { EventsApi } from "../../api/dist";
@ -154,7 +159,6 @@ export class PageHeader extends LitElement {
}}
>
<i class="fas fa-bell"></i>
</button>
`;
</button> `;
}
}

View File

@ -5,7 +5,6 @@ import { MessageLevel } from "../messages/Message";
@customElement("ak-action-button")
export class ActionButton extends SpinnerButton {
@property({ attribute: false })
// eslint-disable-next-line @typescript-eslint/no-explicit-any
apiRequest: () => Promise<any> = () => {

View File

@ -16,7 +16,6 @@ import { ERROR_CLASS, PRIMARY_CLASS, PROGRESS_CLASS, SUCCESS_CLASS } from "../..
@customElement("ak-spinner-button")
export class SpinnerButton extends LitElement {
@property({ type: Boolean })
isRunning = false;

View File

@ -1,5 +1,13 @@
import { Middleware, ResponseContext } from "authentik-api";
import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFNotificationDrawer from "@patternfly/patternfly/components/NotificationDrawer/notification-drawer.css";
import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css";
@ -16,7 +24,6 @@ export interface RequestInfo {
}
export class APIMiddleware implements Middleware {
post?(context: ResponseContext): Promise<Response | void> {
const request: RequestInfo = {
method: (context.init.method || "GET").toUpperCase(),
@ -32,17 +39,22 @@ export class APIMiddleware implements Middleware {
);
return Promise.resolve(context.response);
}
}
@customElement("ak-api-drawer")
export class APIDrawer extends LitElement {
@property({attribute: false})
@property({ attribute: false })
requests: RequestInfo[] = [];
static get styles(): CSSResult[] {
return [PFBase, PFNotificationDrawer, PFButton, PFContent, PFDropdown, AKGlobal, css`
return [
PFBase,
PFNotificationDrawer,
PFButton,
PFContent,
PFDropdown,
AKGlobal,
css`
.pf-c-notification-drawer__header {
height: 114px;
align-items: center;
@ -56,7 +68,8 @@ export class APIDrawer extends LitElement {
white-space: pre-wrap;
font-family: monospace;
}
`];
`,
];
}
constructor() {
@ -73,9 +86,13 @@ export class APIDrawer extends LitElement {
renderItem(item: RequestInfo): TemplateResult {
return html`<li class="pf-c-notification-drawer__list-item pf-m-read">
<div class="pf-c-notification-drawer__list-item-header">
<h2 class="pf-c-notification-drawer__list-item-header-title">${item.method}: ${item.status}</h2>
<h2 class="pf-c-notification-drawer__list-item-header-title">
${item.method}: ${item.status}
</h2>
</div>
<a class="pf-c-notification-drawer__list-item-description" href=${item.path}>${item.path}</a>
<a class="pf-c-notification-drawer__list-item-description" href=${item.path}
>${item.path}</a
>
</li>`;
}

View File

@ -24,7 +24,12 @@ import "../elements/messages/MessageContainer";
import "../elements/notifications/NotificationDrawer";
import "../elements/sidebar/Sidebar";
import { until } from "lit-html/directives/until";
import { EVENT_API_DRAWER_TOGGLE, EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_SIDEBAR_TOGGLE, VERSION } from "../constants";
import {
EVENT_API_DRAWER_TOGGLE,
EVENT_NOTIFICATION_DRAWER_TOGGLE,
EVENT_SIDEBAR_TOGGLE,
VERSION,
} from "../constants";
import { AdminApi } from "authentik-api";
import { DEFAULT_CONFIG } from "../api/Config";
import { WebsocketClient } from "../common/ws";
@ -106,8 +111,16 @@ export class AdminInterface extends LitElement {
</main>
</div>
</div>
${this.notificationOpen ? html`<ak-notification-drawer class="pf-c-drawer__panel pf-m-width-33"></ak-notification-drawer>` : html``}
${this.apiDrawerOpen ? html`<ak-api-drawer class="pf-c-drawer__panel pf-m-width-33"></ak-api-drawer>` : html``}
${this.notificationOpen
? html`<ak-notification-drawer
class="pf-c-drawer__panel pf-m-width-33"
></ak-notification-drawer>`
: html``}
${this.apiDrawerOpen
? html`<ak-api-drawer
class="pf-c-drawer__panel pf-m-width-33"
></ak-api-drawer>`
: html``}
</div>
</div>
</div>

View File

@ -39,16 +39,7 @@ export class ApplicationViewPage extends LitElement {
application!: Application;
static get styles(): CSSResult[] {
return [
PFBase,
PFPage,
PFContent,
PFButton,
PFDescriptionList,
PFGrid,
PFCard,
AKGlobal,
];
return [PFBase, PFPage, PFContent, PFButton, PFDescriptionList, PFGrid, PFCard, AKGlobal];
}
render(): TemplateResult {
@ -73,7 +64,9 @@ export class ApplicationViewPage extends LitElement {
class="pf-c-page__main-section pf-m-no-padding-mobile"
>
<div class="pf-l-grid pf-m-gutter">
<div class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-2-col-on-xl pf-m-1-col-on-2xl">
<div
class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-2-col-on-xl pf-m-1-col-on-2xl"
>
<div class="pf-c-card__title">${t`Related`}</div>
<div class="pf-c-card__body">
<dl class="pf-c-description-list">
@ -198,9 +191,7 @@ export class ApplicationViewPage extends LitElement {
</ak-charts-application-authorize>`}
</div>
</div>
<div
class="pf-c-card pf-l-grid__item pf-m-12-col"
>
<div class="pf-c-card pf-l-grid__item pf-m-12-col">
<div class="pf-c-card__title">${t`Changelog`}</div>
<div class="pf-c-card__body">
<ak-object-changelog

View File

@ -30,7 +30,6 @@ import PFDescriptionList from "@patternfly/patternfly/components/DescriptionList
@customElement("ak-flow-view")
export class FlowViewPage extends LitElement {
@property()
set flowSlug(value: string) {
new FlowsApi(DEFAULT_CONFIG)
@ -46,7 +45,16 @@ export class FlowViewPage extends LitElement {
flow!: Flow;
static get styles(): CSSResult[] {
return [PFBase, PFPage, PFDescriptionList, PFButton, PFCard, PFContent, PFGrid, AKGlobal].concat(
return [
PFBase,
PFPage,
PFDescriptionList,
PFButton,
PFCard,
PFContent,
PFGrid,
AKGlobal,
].concat(
css`
img.pf-icon {
max-height: 24px;
@ -75,7 +83,9 @@ export class FlowViewPage extends LitElement {
class="pf-c-page__main-section pf-m-no-padding-mobile"
>
<div class="pf-l-grid pf-m-gutter">
<div class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-2-col-on-xl pf-m-1-col-on-2xl">
<div
class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-2-col-on-xl pf-m-1-col-on-2xl"
>
<div class="pf-c-card__title">${t`Related`}</div>
<div class="pf-c-card__body">
<dl class="pf-c-description-list">

View File

@ -95,7 +95,9 @@ export class UserViewPage extends LitElement {
class="pf-c-page__main-section pf-m-no-padding-mobile"
>
<div class="pf-l-grid pf-m-gutter">
<div class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-2-col-on-xl pf-m-1-col-on-2xl">
<div
class="pf-c-card pf-l-grid__item pf-m-12-col pf-m-2-col-on-xl pf-m-1-col-on-2xl"
>
<div class="pf-c-card__title">${t`User Info`}</div>
<div class="pf-c-card__body">
<dl class="pf-c-description-list">