web: implement initial DeleteForm

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-03-18 01:43:12 +01:00
parent ac78e3e2ec
commit a95b6e0e61
5 changed files with 99 additions and 8 deletions

View File

@ -15,7 +15,7 @@ export class ActionButton extends SpinnerButton {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
apiRequest: () => Promise<any> = () => { throw new Error(); };
callAction(): void {
defaultCallAction(): void {
if (this.isRunning === true) {
return;
}

View File

@ -158,6 +158,10 @@ export class ModalButton extends LitElement {
}
}
renderModalInner(): TemplateResult {
return html`${unsafeHTML(this.modal)}`;
}
renderModal(): TemplateResult {
return html`<div class="pf-c-backdrop">
<div class="pf-l-bullseye">
@ -176,7 +180,7 @@ export class ModalButton extends LitElement {
>
<i class="fas fa-times" aria-hidden="true"></i>
</button>
${unsafeHTML(this.modal)}
${this.renderModalInner()}
</div>
</div>
</div>`;

View File

@ -13,6 +13,9 @@ export class SpinnerButton extends LitElement {
@property()
form?: string;
@property()
callAction: () => void = this.defaultCallAction;
static get styles(): CSSResult[] {
return [
PFBase,
@ -49,7 +52,7 @@ export class SpinnerButton extends LitElement {
}, 1000);
}
callAction(): void {
defaultCallAction(): void {
if (this.isRunning === true) {
return;
}