resolver: suggest user own domains
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
e1df92ca1c
commit
40e0dfeb9f
1 changed files with 20 additions and 1 deletions
|
@ -54,9 +54,15 @@
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="domain"
|
id="domain"
|
||||||
v-model="form.domain"
|
v-model="form.domain"
|
||||||
|
list="my-domains"
|
||||||
required
|
required
|
||||||
placeholder="happydns.org"
|
placeholder="happydns.org"
|
||||||
/>
|
/>
|
||||||
|
<datalist v-if="sortedDomains" id="my-domains">
|
||||||
|
<option v-for="dn in sortedDomains" :key="dn.id">
|
||||||
|
{{ dn.domain }}
|
||||||
|
</option>
|
||||||
|
</datalist>
|
||||||
</b-form-group>
|
</b-form-group>
|
||||||
|
|
||||||
<div class="text-center mb-3">
|
<div class="text-center mb-3">
|
||||||
|
@ -162,6 +168,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
@ -267,10 +274,19 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
return this.responses.filter(rr => (rr.Hdr.Rrtype !== 46 && rr.Hdr.Rrtype !== 47 && rr.Hdr.Rrtype !== 50))
|
return this.responses.filter(rr => (rr.Hdr.Rrtype !== 46 && rr.Hdr.Rrtype !== 47 && rr.Hdr.Rrtype !== 50))
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
...mapGetters('domains', ['sortedDomains']),
|
||||||
|
...mapGetters('user', ['user_isLogged'])
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
user_isLogged: function (isLogged) {
|
||||||
|
if (isLogged) {
|
||||||
|
this.$store.dispatch('domains/getAllMyDomains')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
$route (n) {
|
$route (n) {
|
||||||
if (n.params.domain && (!this.response || n.params.domain !== this.form.domain)) {
|
if (n.params.domain && (!this.response || n.params.domain !== this.form.domain)) {
|
||||||
this.form.domain = n.params.domain
|
this.form.domain = n.params.domain
|
||||||
|
@ -282,6 +298,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted () {
|
mounted () {
|
||||||
|
if (this.user_isLogged) {
|
||||||
|
this.$store.dispatch('domains/getAllMyDomains')
|
||||||
|
}
|
||||||
if (this.$route.params.domain) {
|
if (this.$route.params.domain) {
|
||||||
this.form.domain = this.$route.params.domain
|
this.form.domain = this.$route.params.domain
|
||||||
this.submitRequest()
|
this.submitRequest()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue