mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-18 05:04:40 +03:00
chore: add new dns features from v25.6.8
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
* chore: add new dns params * chore: add `DNS Presets` modal * chore: edit file names
This commit is contained in:
110
web/html/modals/dns_presets_modal.html
Normal file
110
web/html/modals/dns_presets_modal.html
Normal file
@@ -0,0 +1,110 @@
|
||||
{{define "modals/dnsPresetsModal"}}
|
||||
<a-modal id="dnsPresets-modal" v-model="dnsPresetsModal.visible" :title="dnsPresetsModal.title" :closable="true"
|
||||
:mask-closable="false" :footer="null" :class="themeSwitcher.currentTheme">
|
||||
<a-list class="ant-dns-presets-list" bordered :style="{ width: '100%' }">
|
||||
<a-list-item v-for="dns in dnsPresetsDatabase" :style="{ padding: '12px 16px' }">
|
||||
<a-row justify="space-between" align="middle">
|
||||
<a-col :span="12">
|
||||
<a-space direction="vertical" size="small">
|
||||
<span class="ant-dns-presets-list-name">[[ dns.name ]]</span>
|
||||
<a-tag :color="dns.family ? 'purple' : 'green'">[[ dns.family ? '{{ i18n "pages.xray.dns.dnsPresetFamily" }}' : 'DNS' ]]</a-tag>
|
||||
</a-space>
|
||||
</a-col>
|
||||
<a-col :span="12" :style="{ textAlign: 'right' }">
|
||||
<a-button type="primary" @click="dnsPresetsModal.install(dns.data)">{{ i18n "install" }}</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-list-item>
|
||||
</a-list>
|
||||
</a-modal>
|
||||
|
||||
<style>
|
||||
.dark .ant-dns-presets-list {
|
||||
border-color: var(--dark-color-stroke)
|
||||
}
|
||||
|
||||
.dark .ant-dns-presets-list-name {
|
||||
color: var(--dark-color-text-primary);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
const dnsPresetsDatabase = [
|
||||
{
|
||||
name: 'Google DNS',
|
||||
family: false,
|
||||
data: [
|
||||
"8.8.8.8",
|
||||
"8.8.4.4",
|
||||
"2001:4860:4860::8888",
|
||||
"2001:4860:4860::8844"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Cloudflare DNS',
|
||||
family: false,
|
||||
data: [
|
||||
"1.1.1.1",
|
||||
"1.0.0.1",
|
||||
"2606:4700:4700::1111",
|
||||
"2606:4700:4700::1001"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Adguard DNS',
|
||||
family: false,
|
||||
data: [
|
||||
"94.140.14.14",
|
||||
"94.140.15.15",
|
||||
"2a10:50c0::ad1:ff",
|
||||
"2a10:50c0::ad2:ff"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Adguard Family DNS',
|
||||
family: true,
|
||||
data: [
|
||||
"94.140.14.14",
|
||||
"94.140.15.15",
|
||||
"2a10:50c0::ad1:ff",
|
||||
"2a10:50c0::ad2:ff"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Cloudflare Family DNS',
|
||||
family: true,
|
||||
data: [
|
||||
"1.1.1.3",
|
||||
"1.0.0.3",
|
||||
"2606:4700:4700::1113",
|
||||
"2606:4700:4700::1003"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
const dnsPresetsModal = {
|
||||
title: '',
|
||||
visible: false,
|
||||
selected: null,
|
||||
install(selectedPreset) {
|
||||
return ObjectUtil.execute(dnsPresetsModal.selected, selectedPreset);
|
||||
},
|
||||
show({ title = '', selected = (selectedPreset) => { }, isEdit = false }) {
|
||||
this.title = title;
|
||||
this.selected = selected;
|
||||
this.visible = true;
|
||||
},
|
||||
close() {
|
||||
dnsPresetsModal.visible = false;
|
||||
},
|
||||
};
|
||||
|
||||
new Vue({
|
||||
delimiters: ['[[', ']]'],
|
||||
el: '#dnsPresets-modal',
|
||||
data: {
|
||||
dnsPresetsModal: dnsPresetsModal,
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -1,57 +0,0 @@
|
||||
{{define "modals/fakednsModal"}}
|
||||
<a-modal id="fakedns-modal" v-model="fakednsModal.visible" :title="fakednsModal.title" @ok="fakednsModal.ok"
|
||||
:closable="true" :mask-closable="false"
|
||||
:ok-text="fakednsModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme">
|
||||
<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
|
||||
<a-form-item label='{{ i18n "pages.xray.fakedns.ipPool" }}'>
|
||||
<a-input v-model.trim="fakednsModal.fakeDns.ipPool"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.fakedns.poolSize" }}'>
|
||||
<a-input-number v-model.number="fakednsModal.fakeDns.poolSize" :min="1"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<script>
|
||||
const fakednsModal = {
|
||||
title: '',
|
||||
visible: false,
|
||||
okText: '{{ i18n "confirm" }}',
|
||||
isEdit: false,
|
||||
confirm: null,
|
||||
fakeDns: {
|
||||
ipPool: "198.18.0.0/16",
|
||||
poolSize: 65535,
|
||||
},
|
||||
ok() {
|
||||
ObjectUtil.execute(fakednsModal.confirm, fakednsModal.fakeDns);
|
||||
},
|
||||
show({ title='', okText='{{ i18n "confirm" }}', fakeDns, confirm=(fakeDns)=>{}, isEdit=false }) {
|
||||
this.title = title;
|
||||
this.okText = okText;
|
||||
this.confirm = confirm;
|
||||
this.visible = true;
|
||||
if(isEdit) {
|
||||
this.fakeDns = fakeDns;
|
||||
} else {
|
||||
this.fakeDns = {
|
||||
ipPool: "198.18.0.0/16",
|
||||
poolSize: 65535,
|
||||
}
|
||||
}
|
||||
this.isEdit = isEdit;
|
||||
},
|
||||
close() {
|
||||
fakednsModal.visible = false;
|
||||
},
|
||||
};
|
||||
|
||||
new Vue({
|
||||
delimiters: ['[[', ']]'],
|
||||
el: '#fakedns-modal',
|
||||
data: {
|
||||
fakednsModal: fakednsModal,
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -6,6 +6,16 @@
|
||||
<a-form-item label='{{ i18n "pages.xray.outbound.address" }}'>
|
||||
<a-input v-model.trim="dnsModal.dnsServer.address"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.inbounds.port" }}'>
|
||||
<a-input-number v-model.number="dnsModal.dnsServer.port" :min="1" :max="65531"></a-input-number>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.dns.strategy" }}'>
|
||||
<a-select v-model="dnsModal.dnsServer.queryStrategy" :style="{ width: '100%' }"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option :value="l" :label="l" v-for="l in ['UseSystem', 'UseIP', 'UseIPv4', 'UseIPv6']"> [[ l ]] </a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-divider :style="{ margin: '5px 0' }"></a-divider>
|
||||
<a-form-item label='{{ i18n "pages.xray.dns.domains" }}'>
|
||||
<a-button icon="plus" size="small" type="primary" @click="dnsModal.dnsServer.domains.push('')"></a-button>
|
||||
<template v-for="(domain, index) in dnsModal.dnsServer.domains">
|
||||
@@ -15,15 +25,6 @@
|
||||
</a-input>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.dns.strategy" }}' v-if="isAdvanced">
|
||||
<a-select v-model="dnsModal.dnsServer.queryStrategy" :style="{ width: '100%' }"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option :value="l" :label="l" v-for="l in ['UseIP', 'UseIPv4', 'UseIPv6']"> [[ l ]] </a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label='Skip Fallback' v-if="isAdvanced">
|
||||
<a-switch v-model="dnsModal.dnsServer.skipFallback"></a-switch>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.dns.expectIPs"}}'>
|
||||
<a-button icon="plus" size="small" type="primary" @click="dnsModal.dnsServer.expectIPs.push('')"></a-button>
|
||||
<template v-for="(domain, index) in dnsModal.dnsServer.expectIPs">
|
||||
@@ -33,31 +34,50 @@
|
||||
</a-input>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.dns.unexpectIPs"}}'>
|
||||
<a-button icon="plus" size="small" type="primary" @click="dnsModal.dnsServer.unexpectedIPs.push('')"></a-button>
|
||||
<template v-for="(domain, index) in dnsModal.dnsServer.unexpectedIPs">
|
||||
<a-input v-model.trim="dnsModal.dnsServer.unexpectedIPs[index]">
|
||||
<a-button icon="minus" size="small" slot="addonAfter"
|
||||
@click="dnsModal.dnsServer.unexpectedIPs.splice(index,1)"></a-button>
|
||||
</a-input>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-divider :style="{ margin: '5px 0' }"></a-divider>
|
||||
<a-form-item label='Skip Fallback'>
|
||||
<a-switch v-model="dnsModal.dnsServer.skipFallback"></a-switch>
|
||||
</a-form-item>
|
||||
<a-form-item label='Disable Cache'>
|
||||
<a-switch v-model="dnsModal.dnsServer.disableCache"></a-switch>
|
||||
</a-form-item>
|
||||
<a-form-item label='Final Query'>
|
||||
<a-switch v-model="dnsModal.dnsServer.finalQuery"></a-switch>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<script>
|
||||
const defaultDnsObject = {
|
||||
address: "localhost",
|
||||
port: 53,
|
||||
domains: [],
|
||||
expectIPs: [],
|
||||
unexpectedIPs: [],
|
||||
queryStrategy: 'UseIP',
|
||||
skipFallback: true,
|
||||
disableCache: false,
|
||||
finalQuery: false
|
||||
}
|
||||
|
||||
const dnsModal = {
|
||||
title: '',
|
||||
visible: false,
|
||||
okText: '{{ i18n "confirm" }}',
|
||||
isEdit: false,
|
||||
confirm: null,
|
||||
dnsServer: {
|
||||
address: "localhost",
|
||||
domains: [],
|
||||
expectIPs: [],
|
||||
queryStrategy: 'UseIP',
|
||||
skipFallback: true,
|
||||
dnsServer: { ...defaultDnsObject },
|
||||
ok() {
|
||||
ObjectUtil.execute(dnsModal.confirm, { ...dnsModal.dnsServer });
|
||||
},
|
||||
ok() {
|
||||
domains = dnsModal.dnsServer.domains.filter(d => d.length > 0);
|
||||
expectIPs = dnsModal.dnsServer.expectIPs.filter(ip => ip.length > 0);
|
||||
dnsModal.dnsServer.domains = domains;
|
||||
dnsModal.dnsServer.expectIPs = expectIPs;
|
||||
newDnsServer = (domains.length > 0 || expectIPs.length > 0) ? dnsModal.dnsServer : dnsModal.dnsServer.address;
|
||||
ObjectUtil.execute(dnsModal.confirm, newDnsServer);
|
||||
},
|
||||
|
||||
show({
|
||||
title = '',
|
||||
okText = '{{ i18n "confirm" }}',
|
||||
@@ -69,28 +89,28 @@
|
||||
this.okText = okText;
|
||||
this.confirm = confirm;
|
||||
this.visible = true;
|
||||
this.isEdit = isEdit;
|
||||
|
||||
if (isEdit) {
|
||||
if (typeof dnsServer == 'object') {
|
||||
this.dnsServer = dnsServer;
|
||||
} else {
|
||||
this.dnsServer = {
|
||||
address: dnsServer ?? "",
|
||||
domains: [],
|
||||
expectIPs: [],
|
||||
queryStrategy: 'UseIP',
|
||||
skipFallback: true,
|
||||
}
|
||||
switch (typeof dnsServer) {
|
||||
case 'string':
|
||||
const dnsObj = { ...defaultDnsObject };
|
||||
|
||||
dnsObj.address = dnsServer;
|
||||
|
||||
this.dnsServer = dnsObj;
|
||||
break;
|
||||
case 'object':
|
||||
this.dnsServer = dnsServer;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.dnsServer = {
|
||||
address: "localhost",
|
||||
domains: [],
|
||||
expectIPs: [],
|
||||
queryStrategy: 'UseIP',
|
||||
skipFallback: true,
|
||||
}
|
||||
this.dnsServer = { ...defaultDnsObject };
|
||||
|
||||
this.dnsServer.domains = [];
|
||||
this.dnsServer.expectIPs = [];
|
||||
this.dnsServer.unexpectedIPs = [];
|
||||
}
|
||||
this.isEdit = isEdit;
|
||||
},
|
||||
close() {
|
||||
dnsModal.visible = false;
|
||||
@@ -101,13 +121,6 @@
|
||||
el: '#dns-modal',
|
||||
data: {
|
||||
dnsModal: dnsModal,
|
||||
},
|
||||
computed: {
|
||||
isAdvanced: {
|
||||
get: function () {
|
||||
return dnsModal.dnsServer.domains.length > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
56
web/html/modals/xray_fakedns_modal.html
Normal file
56
web/html/modals/xray_fakedns_modal.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{{define "modals/fakednsModal"}}
|
||||
<a-modal id="fakedns-modal" v-model="fakednsModal.visible" :title="fakednsModal.title" @ok="fakednsModal.ok"
|
||||
:closable="true" :mask-closable="false" :ok-text="fakednsModal.okText" cancel-text='{{ i18n "close" }}'
|
||||
:class="themeSwitcher.currentTheme">
|
||||
<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
|
||||
<a-form-item label='{{ i18n "pages.xray.fakedns.ipPool" }}'>
|
||||
<a-input v-model.trim="fakednsModal.fakeDns.ipPool"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.fakedns.poolSize" }}'>
|
||||
<a-input-number v-model.number="fakednsModal.fakeDns.poolSize" :min="1"></a-input-number>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<script>
|
||||
const fakednsDefaultData = {
|
||||
ipPool: "198.18.0.0/16",
|
||||
poolSize: 65535,
|
||||
}
|
||||
|
||||
const fakednsModal = {
|
||||
title: '',
|
||||
visible: false,
|
||||
okText: '{{ i18n "confirm" }}',
|
||||
isEdit: false,
|
||||
confirm: null,
|
||||
fakeDns: { ...fakednsDefaultData },
|
||||
ok() {
|
||||
ObjectUtil.execute(fakednsModal.confirm, fakednsModal.fakeDns);
|
||||
},
|
||||
show({ title = '', okText = '{{ i18n "confirm" }}', fakeDns, confirm = (fakeDns) => { }, isEdit = false }) {
|
||||
this.title = title;
|
||||
this.okText = okText;
|
||||
this.confirm = confirm;
|
||||
this.visible = true;
|
||||
if (isEdit) {
|
||||
this.fakeDns = fakeDns;
|
||||
} else {
|
||||
this.fakeDns = { ...fakednsDefaultData }
|
||||
}
|
||||
this.isEdit = isEdit;
|
||||
},
|
||||
close() {
|
||||
fakednsModal.visible = false;
|
||||
},
|
||||
};
|
||||
|
||||
new Vue({
|
||||
delimiters: ['[[', ']]'],
|
||||
el: '#fakedns-modal',
|
||||
data: {
|
||||
fakednsModal: fakednsModal,
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -135,7 +135,7 @@
|
||||
</template>
|
||||
</a-setting-list-item>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="4" header='{{ i18n "pages.xray.blockConfigs"}}'>
|
||||
<a-collapse-panel key="4" header='{{ i18n "pages.xray.basicRouting"}}'>
|
||||
<a-row :xs="24" :sm="24" :lg="12">
|
||||
<a-alert type="warning" :style="{ textAlign: 'center' }">
|
||||
<template slot="message">
|
||||
@@ -144,22 +144,12 @@
|
||||
</template>
|
||||
</a-alert>
|
||||
</a-row>
|
||||
<a-setting-list-item paddings="small">
|
||||
<a-setting-list-item paddings="small" :style="{ marginBottom: '20px' }">
|
||||
<template #title>{{ i18n "pages.xray.Torrent"}}</template>
|
||||
<template #description>{{ i18n "pages.xray.TorrentDesc"}}</template>
|
||||
<template #control>
|
||||
<a-switch v-model="torrentSettings"></a-switch>
|
||||
</template>
|
||||
</a-setting-list-item>
|
||||
<a-setting-list-item paddings="small">
|
||||
<template #title>{{ i18n "pages.xray.Family"}}</template>
|
||||
<template #description>{{ i18n "pages.xray.FamilyDesc"}}</template>
|
||||
<template #control>
|
||||
<a-switch v-model="familyProtectSettings"></a-switch>
|
||||
</template>
|
||||
</a-setting-list-item>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="5" header='{{ i18n "pages.xray.basicRouting"}}'>
|
||||
<a-row :xs="24" :sm="24" :lg="12">
|
||||
<a-alert type="warning" :style="{ textAlign: 'center' }">
|
||||
<template slot="message">
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<template #control>
|
||||
<a-select v-model="dnsStrategy" :style="{ width: '100%' }"
|
||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option :value="l" :label="l" v-for="l in ['UseIP', 'UseIPv4', 'UseIPv6']">
|
||||
<a-select-option :value="l" :label="l" v-for="l in ['UseSystem', 'UseIP', 'UseIPv4', 'UseIPv6']">
|
||||
<span>[[ l ]]</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@@ -56,6 +56,14 @@
|
||||
<a-switch v-model="dnsDisableFallbackIfMatch"></a-switch>
|
||||
</template>
|
||||
</a-setting-list-item>
|
||||
|
||||
<a-setting-list-item paddings="small">
|
||||
<template #title>{{ i18n "pages.xray.dns.useSystemHosts" }}</template>
|
||||
<template #description>{{ i18n "pages.xray.dns.useSystemHostsDesc" }}</template>
|
||||
<template #control>
|
||||
<a-switch v-model="dnsUseSystemHosts"></a-switch>
|
||||
</template>
|
||||
</a-setting-list-item>
|
||||
</template>
|
||||
</a-collapse-panel>
|
||||
<template v-if="enableDNS">
|
||||
@@ -102,9 +110,12 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-empty description='{{ i18n "emptyDnsDesc" }}' :style="{ margin: '10px' }">
|
||||
<a-button type="primary" icon="plus" @click="addDNSServer()" :style="{ marginTop: '10px' }">
|
||||
<span>{{ i18n "pages.xray.dns.add" }}</span>
|
||||
</a-button>
|
||||
<a-button-group>
|
||||
<a-button type="primary" icon="plus" @click="addDNSServer()">
|
||||
<span>{{ i18n "pages.xray.dns.add" }}</span>
|
||||
</a-button>
|
||||
<a-button type="primary" icon="menu" @click="openDNSPresets()"></a-button>
|
||||
</a-button-group>
|
||||
</a-empty>
|
||||
</template>
|
||||
</a-collapse-panel>
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
{{template "modals/reverseModal"}}
|
||||
{{template "modals/balancerModal"}}
|
||||
{{template "modals/dnsModal"}}
|
||||
{{template "modals/dnsPresetsModal"}}
|
||||
{{template "modals/fakednsModal"}}
|
||||
{{template "modals/warpModal"}}
|
||||
<script>
|
||||
@@ -308,16 +309,7 @@
|
||||
{ label: 'Netflix', value: 'geosite:netflix' },
|
||||
{ label: 'Reddit', value: 'geosite:reddit' },
|
||||
{ label: 'Speedtest', value: 'geosite:speedtest' },
|
||||
],
|
||||
familyProtectDNS: {
|
||||
"servers": [
|
||||
"1.1.1.3", // https://developers.cloudflare.com/1.1.1.1/setup/
|
||||
"1.0.0.3",
|
||||
"2606:4700:4700::1113",
|
||||
"2606:4700:4700::1003"
|
||||
],
|
||||
"queryStrategy": "UseIP"
|
||||
},
|
||||
]
|
||||
},
|
||||
defaultObservatory: {
|
||||
subjectSelector: [],
|
||||
@@ -826,6 +818,16 @@
|
||||
this.obsSettings = '';
|
||||
this.changeObsCode()
|
||||
},
|
||||
openDNSPresets() {
|
||||
dnsPresetsModal.show({
|
||||
title: '{{ i18n "pages.xray.dns.dnsPresetTitle" }}',
|
||||
selected: (selectedPreset) => {
|
||||
this.dnsServers = selectedPreset;
|
||||
|
||||
dnsPresetsModal.close();
|
||||
}
|
||||
});
|
||||
},
|
||||
addDNSServer(){
|
||||
dnsModal.show({
|
||||
title: '{{ i18n "pages.xray.dns.add" }}',
|
||||
@@ -1270,21 +1272,6 @@
|
||||
}
|
||||
},
|
||||
},
|
||||
familyProtectSettings: {
|
||||
get: function () {
|
||||
if (!this.templateSettings || !this.templateSettings.dns || !this.templateSettings.dns.servers) return false;
|
||||
return ArrayUtils.doAllItemsExist(this.settingsData.familyProtectDNS.servers, this.templateSettings.dns.servers);
|
||||
},
|
||||
set: function (newValue) {
|
||||
newTemplateSettings = this.templateSettings;
|
||||
if (newValue) {
|
||||
newTemplateSettings.dns = this.settingsData.familyProtectDNS;
|
||||
} else {
|
||||
newTemplateSettings.dns.servers = newTemplateSettings.dns?.servers?.filter(data => !this.settingsData.familyProtectDNS.servers.includes(data))
|
||||
}
|
||||
this.templateSettings = newTemplateSettings;
|
||||
},
|
||||
},
|
||||
WarpExist: {
|
||||
get: function() {
|
||||
return this.templateSettings ? this.templateSettings.outbounds.findIndex((o) => o.tag == "warp")>=0 : false;
|
||||
@@ -1376,6 +1363,20 @@
|
||||
this.templateSettings = newTemplateSettings;
|
||||
}
|
||||
},
|
||||
dnsUseSystemHosts: {
|
||||
get: function () {
|
||||
return this.enableDNS ? this.templateSettings.dns.useSystemHosts : false;
|
||||
},
|
||||
set: function (newValue) {
|
||||
newTemplateSettings = this.templateSettings;
|
||||
if (newValue) {
|
||||
newTemplateSettings.dns.useSystemHosts = newValue;
|
||||
} else {
|
||||
delete newTemplateSettings.dns.useSystemHosts
|
||||
}
|
||||
this.templateSettings = newTemplateSettings;
|
||||
}
|
||||
},
|
||||
dnsStrategy: {
|
||||
get: function () {
|
||||
return this.enableDNS ? this.templateSettings.dns.queryStrategy : null;
|
||||
|
||||
Reference in New Issue
Block a user