avoid multiple submit #85
This commit is contained in:
@@ -139,6 +139,7 @@
|
|||||||
<v-btn
|
<v-btn
|
||||||
color="blue-darken-1"
|
color="blue-darken-1"
|
||||||
variant="tonal"
|
variant="tonal"
|
||||||
|
:loading="loading"
|
||||||
@click="saveChanges"
|
@click="saveChanges"
|
||||||
>
|
>
|
||||||
{{ $t('actions.save') }}
|
{{ $t('actions.save') }}
|
||||||
@@ -160,6 +161,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
client: createClient(),
|
client: createClient(),
|
||||||
title: "add",
|
title: "add",
|
||||||
|
loading: false,
|
||||||
clientStats: false,
|
clientStats: false,
|
||||||
tab: "t1",
|
tab: "t1",
|
||||||
clientConfig: <any>[],
|
clientConfig: <any>[],
|
||||||
@@ -193,12 +195,14 @@ export default {
|
|||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
},
|
},
|
||||||
saveChanges() {
|
saveChanges() {
|
||||||
|
this.loading = true
|
||||||
this.client.config = updateConfigs(JSON.stringify(this.clientConfig), this.client.name)
|
this.client.config = updateConfigs(JSON.stringify(this.clientConfig), this.client.name)
|
||||||
this.client.links = JSON.stringify([
|
this.client.links = JSON.stringify([
|
||||||
...this.links,
|
...this.links,
|
||||||
...this.extLinks.filter(l => l.uri != ''),
|
...this.extLinks.filter(l => l.uri != ''),
|
||||||
...this.subLinks.filter(l => l.uri != '')])
|
...this.subLinks.filter(l => l.uri != '')])
|
||||||
this.$emit('save', this.client, this.clientStats)
|
this.$emit('save', this.client, this.clientStats)
|
||||||
|
this.loading = false
|
||||||
},
|
},
|
||||||
setDate(newDate:number){
|
setDate(newDate:number){
|
||||||
this.client.expiry = newDate
|
this.client.expiry = newDate
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
<v-btn
|
<v-btn
|
||||||
color="blue-darken-1"
|
color="blue-darken-1"
|
||||||
variant="text"
|
variant="text"
|
||||||
|
:loading="loading"
|
||||||
@click="saveChanges"
|
@click="saveChanges"
|
||||||
>
|
>
|
||||||
{{ $t('actions.save') }}
|
{{ $t('actions.save') }}
|
||||||
@@ -81,6 +82,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
inbound: createInbound("direct",{ "tag": "" }),
|
inbound: createInbound("direct",{ "tag": "" }),
|
||||||
title: "add",
|
title: "add",
|
||||||
|
loading: false,
|
||||||
inTypes: InTypes,
|
inTypes: InTypes,
|
||||||
inboundStats: false,
|
inboundStats: false,
|
||||||
HasOptionalUser: [InTypes.Mixed,InTypes.SOCKS,InTypes.HTTP,InTypes.Shadowsocks],
|
HasOptionalUser: [InTypes.Mixed,InTypes.SOCKS,InTypes.HTTP,InTypes.Shadowsocks],
|
||||||
@@ -109,7 +111,9 @@ export default {
|
|||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
},
|
},
|
||||||
saveChanges() {
|
saveChanges() {
|
||||||
|
this.loading = true
|
||||||
this.$emit('save', this.inbound, this.inboundStats)
|
this.$emit('save', this.inbound, this.inboundStats)
|
||||||
|
this.loading = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Reference in New Issue
Block a user