Fix incorrect translation and missing translation
This commit is contained in:
parent
bf20e73bd6
commit
5f7972ae58
|
@ -39,7 +39,7 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
selectExistingSource (source, domain, redirect) {
|
||||
addDomainToSource (source, domain, redirect, cbSUccess) {
|
||||
this.validatingNewDomain = true
|
||||
|
||||
axios
|
||||
|
@ -50,14 +50,17 @@ export default {
|
|||
.then(
|
||||
(response) => {
|
||||
this.$root.$bvToast.toast(
|
||||
'Great! ' + response.data.domain + ' has been added. You can manage it right now.', {
|
||||
title: 'New domain attached to happyDNS!',
|
||||
this.$t('domains.added-success', { domain: response.data.domain }), {
|
||||
title: this.$t('domains.attached-new'),
|
||||
autoHideDelay: 5000,
|
||||
variant: 'success',
|
||||
href: '/domains/' + response.data.domain,
|
||||
toaster: 'b-toaster-content-right'
|
||||
}
|
||||
)
|
||||
if (redirect) {
|
||||
if (cbSUccess) {
|
||||
cbSUccess(response.data)
|
||||
} else if (redirect) {
|
||||
this.$router.push('/domains/' + encodeURIComponent(response.data.domain))
|
||||
} else if (this.refreshDomains) {
|
||||
this.refreshDomains()
|
||||
|
@ -69,7 +72,7 @@ export default {
|
|||
this.validatingNewDomain = false
|
||||
this.$bvToast.toast(
|
||||
error.response.data.errmsg, {
|
||||
title: 'An error occurs when adding the domain!',
|
||||
title: this.$t('errors.domain-attach'),
|
||||
autoHideDelay: 5000,
|
||||
variant: 'danger',
|
||||
toaster: 'b-toaster-content-right'
|
||||
|
|
|
@ -76,7 +76,7 @@ export default {
|
|||
submitNewDomain () {
|
||||
if (this.validateNewDomain()) {
|
||||
if (this.mySource) {
|
||||
this.selectExistingSource(this.mySource, this.newDomain)
|
||||
this.addDomainToSource(this.mySource, this.newDomain)
|
||||
} else {
|
||||
this.$router.push('/domains/' + encodeURIComponent(this.newDomain) + '/new')
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
<b-row v-else>
|
||||
<b-col offset-md="2" md="8">
|
||||
<source-list ref="sourceList" emit-new-if-empty @newSource="newSource" @sourceSelected="selectExistingSource($event, $route.params.domain, true)" />
|
||||
<source-list ref="sourceList" emit-new-if-empty @newSource="newSource" @sourceSelected="addDomainToSource($event, $route.params.domain, true)" />
|
||||
|
||||
<p class="text-center mt-3">
|
||||
{{ $t('source.find') }} <a href="#" @click.prevent="newSource">{{ $t('domains.add-now') }}</a>
|
||||
|
|
|
@ -144,35 +144,10 @@ export default {
|
|||
},
|
||||
|
||||
importDomain (domain) {
|
||||
axios
|
||||
.post('/api/domains', {
|
||||
id_source: this.mySource._id,
|
||||
domain: domain
|
||||
})
|
||||
.then(
|
||||
(response) => {
|
||||
this.$bvToast.toast(
|
||||
this.$t('domains.added-success'), { domain: response.data.domain }, {
|
||||
title: this.$t('domains.attached-new'),
|
||||
autoHideDelay: 5000,
|
||||
variant: 'success',
|
||||
href: '/domains/' + response.data.domain,
|
||||
toaster: 'b-toaster-content-right'
|
||||
}
|
||||
)
|
||||
this.myDomains.push(response.data)
|
||||
},
|
||||
(error) => {
|
||||
this.$bvToast.toast(
|
||||
error.response.data.errmsg, {
|
||||
title: this.$t('errors.domain-attach'),
|
||||
autoHideDelay: 5000,
|
||||
variant: 'danger',
|
||||
toaster: 'b-toaster-content-right'
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
var vm = this
|
||||
this.addDomainToSource(this.mySource, domain, null, function (data) {
|
||||
vm.myDomains.push(data)
|
||||
})
|
||||
},
|
||||
|
||||
listImportableDomains () {
|
||||
|
|
Loading…
Reference in New Issue
Block a user