mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-11 04:36:20 +00:00
Update dns_modal.html
This commit is contained in:
parent
a24892e2fa
commit
6ad2dfe259
1 changed files with 6 additions and 49 deletions
|
@ -44,30 +44,6 @@
|
||||||
confirm = (dnsServer) => {},
|
confirm = (dnsServer) => {},
|
||||||
isEdit = false
|
isEdit = false
|
||||||
}) {
|
}) {
|
||||||
this.title = title;
|
|
||||||
this.okText = okText;
|
|
||||||
this.confirm = confirm;
|
|
||||||
this.visible = true;
|
|
||||||
if (isEdit) {
|
|
||||||
if (typeof dnsServer == 'object') {
|
|
||||||
this.dnsServer = dnsServer;
|
|
||||||
} else {
|
|
||||||
this.dnsServer.address = dnsServer ?? '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.dnsServer = {
|
|
||||||
address: "localhost",
|
|
||||||
domains: [],
|
|
||||||
queryStrategy: 'UseIP',
|
|
||||||
|
|
||||||
},
|
|
||||||
ok() {
|
|
||||||
domains = dnsModal.dnsServer.domains.filter(d => d.length>0);
|
|
||||||
dnsModal.dnsServer.domains = domains;
|
|
||||||
newDnsServer = domains.length > 0 ? dnsModal.dnsServer : dnsModal.dnsServer.address;
|
|
||||||
ObjectUtil.execute(dnsModal.confirm, newDnsServer);
|
|
||||||
},
|
|
||||||
show({ title='', okText='{{ i18n "confirm" }}', dnsServer, confirm=(dnsServer)=>{}, isEdit=false }) {
|
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.okText = okText;
|
this.okText = okText;
|
||||||
this.confirm = confirm;
|
this.confirm = confirm;
|
||||||
|
@ -95,25 +71,6 @@
|
||||||
dnsModal.visible = false;
|
dnsModal.visible = false;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
new Vue({
|
|
||||||
delimiters: ['[[', ']]'],
|
|
||||||
el: '#dns-modal',
|
|
||||||
data: {
|
|
||||||
dnsModal: dnsModal,
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isAdvanced: {
|
|
||||||
get: function () { return dnsModal.dnsServer.domains.length>0 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.isEdit = isEdit;
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
dnsModal.visible = false;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
new Vue({
|
new Vue({
|
||||||
delimiters: ['[[', ']]'],
|
delimiters: ['[[', ']]'],
|
||||||
el: '#dns-modal',
|
el: '#dns-modal',
|
||||||
|
|
Loading…
Reference in a new issue