diff --git a/ui/src/components/AdminButton.vue b/ui/src/components/AdminButton.vue index 5cef5f7..604c02c 100644 --- a/ui/src/components/AdminButton.vue +++ b/ui/src/components/AdminButton.vue @@ -9,6 +9,7 @@ class="button is-light" @click.left="on_click" :icon="'fa-solid fa-toggle-' + (modelValue ? 'on' : 'off')" + :busy="is_busy" text="Admin" /> @@ -33,6 +34,7 @@ export default class extends Vue { // true, iff Benutzer Admin ist public modelValue!: boolean; public modal_visible = false; + public is_busy = false; public on_click() { if (this.modelValue) { @@ -41,6 +43,7 @@ export default class extends Vue { this.$emit("update:modelValue", false); } else { // show login modal + this.is_busy = true; this.modal_visible = true; } } @@ -49,9 +52,10 @@ export default class extends Vue { this.modal_visible = false; this.$advent22.set_api_auth(username, password); - this.$advent22 - .api_get("admin/is_admin") - .then((is_admin) => this.$emit("update:modelValue", is_admin)); + this.$advent22.api_get("admin/is_admin").then((is_admin) => { + this.$emit("update:modelValue", is_admin); + this.is_busy = false; + }); } } diff --git a/ui/src/components/bulma/Button.vue b/ui/src/components/bulma/Button.vue index 2feb041..a0e96f8 100644 --- a/ui/src/components/bulma/Button.vue +++ b/ui/src/components/bulma/Button.vue @@ -1,7 +1,7 @@