static: re-add backdrop, format
This commit is contained in:
parent
49899a9ceb
commit
37979291b5
2
passbook/static/static/dist/main.js
vendored
2
passbook/static/static/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
passbook/static/static/dist/main.js.map
vendored
2
passbook/static/static/dist/main.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -1,9 +1,7 @@
|
||||||
export interface User {
|
export interface User {
|
||||||
|
|
||||||
pk: number;
|
pk: number;
|
||||||
username: string;
|
username: string;
|
||||||
name: string;
|
name: string;
|
||||||
is_superuser: boolean;
|
is_superuser: boolean;
|
||||||
email: boolean;
|
email: boolean;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,10 @@ import SpinnerStyle from "@patternfly/patternfly/components/Spinner/spinner.css"
|
||||||
const PRIMARY_CLASS = "pf-m-primary";
|
const PRIMARY_CLASS = "pf-m-primary";
|
||||||
const SUCCESS_CLASS = "pf-m-success";
|
const SUCCESS_CLASS = "pf-m-success";
|
||||||
const ERROR_CLASS = "pf-m-danger";
|
const ERROR_CLASS = "pf-m-danger";
|
||||||
const PROGRESS_CLASS ="pf-m-in-progress";
|
const PROGRESS_CLASS = "pf-m-in-progress";
|
||||||
|
|
||||||
@customElement("pb-action-button")
|
@customElement("pb-action-button")
|
||||||
export class ActionButton extends LitElement {
|
export class ActionButton extends LitElement {
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
url: string = "";
|
url: string = "";
|
||||||
|
|
||||||
|
@ -23,7 +22,7 @@ export class ActionButton extends LitElement {
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
|
|
||||||
static get styles() {
|
static get styles() {
|
||||||
return [GlobalsStyle, ButtonStyle, SpinnerStyle]
|
return [GlobalsStyle, ButtonStyle, SpinnerStyle];
|
||||||
}
|
}
|
||||||
|
|
||||||
setLoading() {
|
setLoading() {
|
||||||
|
@ -68,7 +67,10 @@ export class ActionButton extends LitElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`<button class="pf-c-button pf-m-progress ${this.classList}" @click=${() => this.callAction()}>
|
return html`<button
|
||||||
|
class="pf-c-button pf-m-progress ${this.classList}"
|
||||||
|
@click=${() => this.callAction()}
|
||||||
|
>
|
||||||
${this.isRunning
|
${this.isRunning
|
||||||
? html` <span class="pf-c-button__progress">
|
? html` <span class="pf-c-button__progress">
|
||||||
<span
|
<span
|
||||||
|
|
|
@ -122,15 +122,15 @@ export const ROOT_ITEMS: SidebarItem[] = [
|
||||||
path: "/audit/audit/",
|
path: "/audit/audit/",
|
||||||
condition: (sb: SideBar) => {
|
condition: (sb: SideBar) => {
|
||||||
return sb.user?.is_superuser!;
|
return sb.user?.is_superuser!;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Administration",
|
name: "Administration",
|
||||||
children: SIDEBAR_ITEMS,
|
children: SIDEBAR_ITEMS,
|
||||||
condition: (sb: SideBar) => {
|
condition: (sb: SideBar) => {
|
||||||
return sb.user?.is_superuser!;
|
return sb.user?.is_superuser!;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@customElement("pb-sidebar")
|
@customElement("pb-sidebar")
|
||||||
|
@ -183,8 +183,8 @@ export class SideBar extends LitElement {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
fetch("/api/v2beta/core/users/me/")
|
fetch("/api/v2beta/core/users/me/")
|
||||||
.then(r => r.json())
|
.then((r) => r.json())
|
||||||
.then(r => this.user = <User>r);
|
.then((r) => (this.user = <User>r));
|
||||||
this.activePath = window.location.hash.slice(1, Infinity);
|
this.activePath = window.location.hash.slice(1, Infinity);
|
||||||
window.addEventListener("hashchange", (e) => {
|
window.addEventListener("hashchange", (e) => {
|
||||||
this.activePath = window.location.hash.slice(1, Infinity);
|
this.activePath = window.location.hash.slice(1, Infinity);
|
||||||
|
@ -196,7 +196,9 @@ export class SideBar extends LitElement {
|
||||||
<a href="#/" class="pf-c-page__header-brand-link">
|
<a href="#/" class="pf-c-page__header-brand-link">
|
||||||
<div class="pf-c-brand pb-brand">
|
<div class="pf-c-brand pb-brand">
|
||||||
<img src="${this.brandLogo}" alt="passbook icon" />
|
<img src="${this.brandLogo}" alt="passbook icon" />
|
||||||
${this.brandTitle ? html`<span>${this.brandTitle}</span>` : ""}
|
${this.brandTitle
|
||||||
|
? html`<span>${this.brandTitle}</span>`
|
||||||
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>`;
|
</li>`;
|
||||||
|
@ -204,10 +206,10 @@ export class SideBar extends LitElement {
|
||||||
|
|
||||||
renderItem(item: SidebarItem): TemplateResult {
|
renderItem(item: SidebarItem): TemplateResult {
|
||||||
if (item.condition) {
|
if (item.condition) {
|
||||||
const result = item.condition(this);
|
const result = item.condition(this);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return html``;
|
return html``;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return html` <li
|
return html` <li
|
||||||
class="pf-c-nav__item ${item.children
|
class="pf-c-nav__item ${item.children
|
||||||
|
|
|
@ -97,17 +97,19 @@ export class SiteShell extends LitElement {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html` ${this.loading
|
return html` ${this.loading
|
||||||
? html` <div class="pf-l-bullseye">
|
? html`<div class="pf-c-backdrop">
|
||||||
<div class="pf-l-bullseye__item">
|
<div class="pf-l-bullseye">
|
||||||
<span
|
<div class="pf-l-bullseye__item">
|
||||||
class="pf-c-spinner pf-m-xl"
|
<span
|
||||||
role="progressbar"
|
class="pf-c-spinner pf-m-xl"
|
||||||
aria-valuetext="Loading..."
|
role="progressbar"
|
||||||
>
|
aria-valuetext="Loading..."
|
||||||
<span class="pf-c-spinner__clipper"></span>
|
>
|
||||||
<span class="pf-c-spinner__lead-ball"></span>
|
<span class="pf-c-spinner__clipper"></span>
|
||||||
<span class="pf-c-spinner__tail-ball"></span>
|
<span class="pf-c-spinner__lead-ball"></span>
|
||||||
</span>
|
<span class="pf-c-spinner__tail-ball"></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
: ""}
|
: ""}
|
||||||
|
|
Reference in a new issue