Skip to content

Commit

Permalink
avoid multiple submit #85
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Apr 16, 2024
1 parent 819d74c commit f545bcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/layouts/modals/Client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<v-btn
color="blue-darken-1"
variant="tonal"
:loading="loading"
@click="saveChanges"
>
{{ $t('actions.save') }}
Expand All @@ -160,6 +161,7 @@ export default {
return {
client: createClient(),
title: "add",
loading: false,
clientStats: false,
tab: "t1",
clientConfig: <any>[],
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/layouts/modals/Inbound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<v-btn
color="blue-darken-1"
variant="text"
:loading="loading"
@click="saveChanges"
>
{{ $t('actions.save') }}
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -109,7 +111,9 @@ export default {
this.$emit('close')
},
saveChanges() {
this.loading = true
this.$emit('save', this.inbound, this.inboundStats)
this.loading = false
},
},
watch: {
Expand Down

0 comments on commit f545bcb

Please sign in to comment.