From f545bcb30ca1774e2bcb78cfa9fea0040848c432 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Tue, 16 Apr 2024 22:53:21 +0200 Subject: [PATCH] avoid multiple submit #85 --- frontend/src/layouts/modals/Client.vue | 4 ++++ frontend/src/layouts/modals/Inbound.vue | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/frontend/src/layouts/modals/Client.vue b/frontend/src/layouts/modals/Client.vue index f0cd14a..bf22168 100644 --- a/frontend/src/layouts/modals/Client.vue +++ b/frontend/src/layouts/modals/Client.vue @@ -139,6 +139,7 @@ {{ $t('actions.save') }} @@ -160,6 +161,7 @@ export default { return { client: createClient(), title: "add", + loading: false, clientStats: false, tab: "t1", clientConfig: [], @@ -193,12 +195,14 @@ export default { this.$emit('close') }, saveChanges() { + this.loading = true this.client.config = updateConfigs(JSON.stringify(this.clientConfig), this.client.name) this.client.links = JSON.stringify([ ...this.links, ...this.extLinks.filter(l => l.uri != ''), ...this.subLinks.filter(l => l.uri != '')]) this.$emit('save', this.client, this.clientStats) + this.loading = false }, setDate(newDate:number){ this.client.expiry = newDate diff --git a/frontend/src/layouts/modals/Inbound.vue b/frontend/src/layouts/modals/Inbound.vue index 3ab0536..35e450c 100644 --- a/frontend/src/layouts/modals/Inbound.vue +++ b/frontend/src/layouts/modals/Inbound.vue @@ -48,6 +48,7 @@ {{ $t('actions.save') }} @@ -81,6 +82,7 @@ export default { return { inbound: createInbound("direct",{ "tag": "" }), title: "add", + loading: false, inTypes: InTypes, inboundStats: false, HasOptionalUser: [InTypes.Mixed,InTypes.SOCKS,InTypes.HTTP,InTypes.Shadowsocks], @@ -109,7 +111,9 @@ export default { this.$emit('close') }, saveChanges() { + this.loading = true this.$emit('save', this.inbound, this.inboundStats) + this.loading = false }, }, watch: {