web/admin: add ServiceAccount creation form

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-08-24 20:13:05 +02:00
parent 1a20c8ffc1
commit 16cfa8cae2
5 changed files with 163 additions and 11 deletions

View File

@ -11,9 +11,15 @@ export class ModalForm extends ModalButton {
@property({ type: Boolean })
closeAfterSuccessfulSubmit = true;
@property({ type: Boolean })
showSubmitButton = true;
@property({ type: Boolean })
loading = false;
@property({ type: String })
cancelText = t`Cancel`;
confirm(): Promise<void> {
const form = this.querySelector<Form<unknown>>("[slot=form]");
if (!form) {
@ -60,16 +66,18 @@ export class ModalForm extends ModalButton {
<slot name="form"></slot>
</section>
<footer class="pf-c-modal-box__footer">
<ak-spinner-button
.callAction=${() => {
this.loading = true;
this.locked = true;
return this.confirm();
}}
class="pf-m-primary"
>
<slot name="submit"></slot> </ak-spinner-button
>&nbsp;
${this.showSubmitButton
? html`<ak-spinner-button
.callAction=${() => {
this.loading = true;
this.locked = true;
return this.confirm();
}}
class="pf-m-primary"
>
<slot name="submit"></slot> </ak-spinner-button
>&nbsp;`
: html``}
<ak-spinner-button
.callAction=${async () => {
this.resetForms();
@ -77,7 +85,7 @@ export class ModalForm extends ModalButton {
}}
class="pf-m-secondary"
>
${t`Cancel`}
${this.cancelText}
</ak-spinner-button>
</footer>`;
}