Fix: Disable save button on submit (#3729)

This commit is contained in:
Nelson Chan 2023-09-16 05:11:18 +08:00 committed by GitHub
parent 0af4ee6c34
commit 1e12ca4786
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,7 +102,7 @@
<!-- Sidebar Footer -->
<div class="sidebar-footer">
<button class="btn btn-success me-2" @click="save">
<button class="btn btn-success me-2" :disabled="loading" @click="save">
<font-awesome-icon icon="save" />
{{ $t("Save") }}
</button>
@ -438,6 +438,7 @@ export default {
lastUpdateTime: dayjs(),
updateCountdown: null,
updateCountdownText: null,
loading: false,
};
},
computed: {
@ -806,6 +807,7 @@ export default {
/** Save the status page */
save() {
this.loading = true;
let startTime = new Date();
this.config.slug = this.config.slug.trim().toLowerCase();
@ -823,10 +825,12 @@ export default {
}
setTimeout(() => {
this.loading = false;
location.href = "/status/" + this.config.slug;
}, time);
} else {
this.loading = false;
toast.error(res.msg);
}
});