diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-09-26 14:08:54 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-09-26 14:08:54 +0300 |
| commit | 0b8beafc89c684140fe6be4cd007fbb2a9eb5f3d (patch) | |
| tree | 03eff8a34abecbd80841beb689c5077549803454 | |
| parent | 8b6e3491c4ed8e8dca8c068d99c4126b6927cf2e (diff) | |
DNS - Expect IPs
| -rw-r--r-- | web/html/xui/dns_modal.html | 33 | ||||
| -rw-r--r-- | web/html/xui/xray.html | 161 | ||||
| -rw-r--r-- | web/translation/translate.en_US.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.es_ES.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.fa_IR.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.id_ID.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.pt_BR.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.ru_RU.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.tr_TR.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.uk_UA.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.vi_VN.toml | 1 | ||||
| -rw-r--r-- | web/translation/translate.zh_CN.toml | 1 |
12 files changed, 119 insertions, 85 deletions
diff --git a/web/html/xui/dns_modal.html b/web/html/xui/dns_modal.html index 1ea93885..f61cd8b2 100644 --- a/web/html/xui/dns_modal.html +++ b/web/html/xui/dns_modal.html @@ -1,5 +1,7 @@ {{define "dnsModal"}} -<a-modal id="dns-modal" v-model="dnsModal.visible" :title="dnsModal.title" @ok="dnsModal.ok" :closable="true" :mask-closable="false" :ok-text="dnsModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme"> +<a-modal id="dns-modal" v-model="dnsModal.visible" :title="dnsModal.title" @ok="dnsModal.ok" :closable="true" + :mask-closable="false" :ok-text="dnsModal.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.outbound.address" }}'> <a-input v-model.trim="dnsModal.dnsServer.address"></a-input> @@ -8,18 +10,29 @@ <a-button icon="plus" size="small" type="primary" @click="dnsModal.dnsServer.domains.push('')"></a-button> <template v-for="(domain, index) in dnsModal.dnsServer.domains"> <a-input v-model.trim="dnsModal.dnsServer.domains[index]"> - <a-button icon="minus" size="small" slot="addonAfter" @click="dnsModal.dnsServer.domains.splice(index,1)"></a-button> + <a-button icon="minus" size="small" slot="addonAfter" + @click="dnsModal.dnsServer.domains.splice(index,1)"></a-button> </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 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"> + <a-input v-model.trim="dnsModal.dnsServer.expectIPs[index]"> + <a-button icon="minus" size="small" slot="addonAfter" + @click="dnsModal.dnsServer.expectIPs.splice(index,1)"></a-button> + </a-input> + </template> + </a-form-item> </a-form> </a-modal> <script> @@ -32,20 +45,24 @@ dnsServer: { address: "localhost", domains: [], + expectIPs: [], queryStrategy: 'UseIP', skipFallback: true, }, ok() { domains = dnsModal.dnsServer.domains.filter(d => d.length > 0); + expectIPs = dnsModal.dnsServer.expectIPs.filter(ip => ip.length > 0); dnsModal.dnsServer.domains = domains; - newDnsServer = domains.length > 0 ? dnsModal.dnsServer : dnsModal.dnsServer.address; + 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" }}', dnsServer, - confirm = (dnsServer) => {}, + confirm = (dnsServer) => { }, isEdit = false }) { this.title = title; @@ -59,6 +76,7 @@ this.dnsServer = { address: dnsServer ?? "", domains: [], + expectIPs: [], queryStrategy: 'UseIP', skipFallback: true, } @@ -67,6 +85,7 @@ this.dnsServer = { address: "localhost", domains: [], + expectIPs: [], queryStrategy: 'UseIP', skipFallback: true, } @@ -85,8 +104,8 @@ }, computed: { isAdvanced: { - get: function() { - return dnsModal.dnsServer.domains.length > 0 + get: function () { + return dnsModal.dnsServer.domains.length > 0; } } } diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 39010f28..71c7f4a1 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -587,86 +587,90 @@ </a-radio-group> <textarea style="position:absolute; left: -800px;" id="obsSetting"></textarea> </a-tab-pane> - <a-tab-pane key="tpl-dns" tab='DNS' style="padding-top: 20px;" force-render="true"> - <setting-list-item type="switch" title='{{ i18n "pages.xray.dns.enable" }}' desc='{{ i18n "pages.xray.dns.enableDesc" }}' v-model="enableDNS"></setting-list-item> + <a-tab-pane key="tpl-dns" tab='DNS' style="padding-top: 20px;" force-render="true"> + <setting-list-item type="switch" title='{{ i18n "pages.xray.dns.enable" }}' + desc='{{ i18n "pages.xray.dns.enableDesc" }}' v-model="enableDNS"></setting-list-item> <template v-if="enableDNS"> - <setting-list-item style="padding: 10px 20px" type="text" title='{{ i18n "pages.xray.dns.tag" }}' desc='{{ i18n "pages.xray.dns.tagDesc" }}' v-model="dnsTag"></setting-list-item> - <a-list-item style="padding: 10px 20px"> - <a-row> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}' description='{{ i18n "pages.xray.dns.strategyDesc" }}' /> - </a-col> - <a-col :lg="24" :xl="12"> - <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']"> - [[ l ]] - </a-select-option> - </a-select> - </a-col> - </a-row> - </a-list-item> - <a-divider>DNS</a-divider> - <a-button type="primary" icon="plus" @click="addDNSServer()" style="margin-bottom: 10px;">{{ i18n "pages.xray.dns.add" }}</a-button> - <a-table :columns="dnsColumns" bordered v-if="dnsServers.length>0" - :row-key="r => r.key" - :data-source="dnsServers" - :scroll="isMobile ? {} : { x: 200 }" - :pagination="false" - :indent-size="0" - :style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'"> - <template slot="action" slot-scope="text,dns,index"> - [[ index+1 ]] - <a-dropdown :trigger="['click']"> - <a-icon @click="e => e.preventDefault()" type="more" style="font-size: 16px; text-decoration: bold;"></a-icon> - <a-menu slot="overlay" :theme="themeSwitcher.currentTheme"> - <a-menu-item @click="editDNSServer(index)"> - <a-icon type="edit"></a-icon> - {{ i18n "edit" }} - </a-menu-item> - <a-menu-item @click="deleteDNSServer(index)"> - <span style="color: #FF4D4F"> - <a-icon type="delete"></a-icon> {{ i18n "delete"}} - </span> - </a-menu-item> - </a-menu> - </a-dropdown> - </template> - <template slot="address" slot-scope="dns,index"> - <span v-if="typeof dns == 'object'">[[ dns.address ]]</span> - <span v-else>[[ dns ]]</span> - </template> - <template slot="domain" slot-scope="dns,index"> - <span v-if="typeof dns == 'object'">[[ dns.domains.join(",") ]]</span> - </template> - </a-table> - <a-divider>Fake DNS</a-divider> - <a-button type="primary" icon="plus" @click="addFakedns()" style="margin-bottom: 10px;">{{ i18n "pages.xray.fakedns.add" }}</a-button> - <a-table :columns="fakednsColumns" bordered v-if="fakeDns && fakeDns.length>0" :row-key="r => r.key" - :data-source="fakeDns" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0" - :style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'"> - <template slot="action" slot-scope="text,fakedns,index"> - [[ index+1 ]] - <a-dropdown :trigger="['click']"> - <a-icon @click="e => e.preventDefault()" type="more" style="font-size: 16px; text-decoration: bold;"></a-icon> - <a-menu slot="overlay" :theme="themeSwitcher.currentTheme"> - <a-menu-item @click="editFakedns(index)"> - <a-icon type="edit"></a-icon> - {{ i18n "edit" }} - </a-menu-item> - <a-menu-item @click="deleteFakedns(index)"> - <span style="color: #FF4D4F"> - <a-icon type="delete"></a-icon> {{ i18n "delete"}} - </span> - </a-menu-item> - </a-menu> - </a-dropdown> - </template> - </a-table> + <setting-list-item style="padding: 10px 20px" type="text" title='{{ i18n "pages.xray.dns.tag" }}' + desc='{{ i18n "pages.xray.dns.tagDesc" }}' v-model="dnsTag"></setting-list-item> + <a-list-item style="padding: 10px 20px"> + <a-row> + <a-col :lg="24" :xl="12"> + <a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}' + description='{{ i18n "pages.xray.dns.strategyDesc" }}' /> + </a-col> + <a-col :lg="24" :xl="12"> + <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']"> + [[ l ]] + </a-select-option> + </a-select> + </a-col> + </a-row> + </a-list-item> + <a-divider>DNS</a-divider> + <a-button type="primary" icon="plus" @click="addDNSServer()" style="margin-bottom: 10px;">{{ i18n + "pages.xray.dns.add" }}</a-button> + <a-table :columns="dnsColumns" bordered v-if="dnsServers.length>0" :row-key="r => r.key" + :data-source="dnsServers" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0" + :style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'"> + <template slot="action" slot-scope="text,dns,index"> + [[ index+1 ]] + <a-dropdown :trigger="['click']"> + <a-icon @click="e => e.preventDefault()" type="more" + style="font-size: 16px; text-decoration: bold;"></a-icon> + <a-menu slot="overlay" :theme="themeSwitcher.currentTheme"> + <a-menu-item @click="editDNSServer(index)"> + <a-icon type="edit"></a-icon> + {{ i18n "edit" }} + </a-menu-item> + <a-menu-item @click="deleteDNSServer(index)"> + <span style="color: #FF4D4F"> + <a-icon type="delete"></a-icon> {{ i18n "delete"}} + </span> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + <template slot="address" slot-scope="dns,index"> + <span v-if="typeof dns == 'object'">[[ dns.address ]]</span> + <span v-else>[[ dns ]]</span> + </template> + <template slot="domain" slot-scope="dns,index"> + <span v-if="typeof dns == 'object'">[[ dns.domains.join(",") ]]</span> + </template> + <template slot="expectIPs" slot-scope="dns,index"> + <span v-if="typeof dns == 'object'">[[ dns.expectIPs.join(",") ]]</span> + </template> + </a-table> + <a-divider>Fake DNS</a-divider> + <a-button type="primary" icon="plus" @click="addFakedns()" style="margin-bottom: 10px;">{{ i18n + "pages.xray.fakedns.add" }}</a-button> + <a-table :columns="fakednsColumns" bordered v-if="fakeDns && fakeDns.length>0" :row-key="r => r.key" + :data-source="fakeDns" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0" + :style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'"> + <template slot="action" slot-scope="text,fakedns,index"> + [[ index+1 ]] + <a-dropdown :trigger="['click']"> + <a-icon @click="e => e.preventDefault()" type="more" + style="font-size: 16px; text-decoration: bold;"></a-icon> + <a-menu slot="overlay" :theme="themeSwitcher.currentTheme"> + <a-menu-item @click="editFakedns(index)"> + <a-icon type="edit"></a-icon> + {{ i18n "edit" }} + </a-menu-item> + <a-menu-item @click="deleteFakedns(index)"> + <span style="color: #FF4D4F"> + <a-icon type="delete"></a-icon> {{ i18n "delete"}} + </span> + </a-menu-item> + </a-menu> + </a-dropdown> + </template> + </a-table> </template> - </a-tab-pane> + </a-tab-pane> <a-tab-pane key="tpl-advanced" tab='{{ i18n "pages.xray.advancedTemplate"}}' style="padding-top: 20px;" force-render="true"> <a-list-item-meta title='{{ i18n "pages.xray.Template"}}' description='{{ i18n "pages.xray.TemplateDesc"}}'></a-list-item-meta> <a-radio-group v-model="advSettings" @change="changeCode" button-style="solid" style="margin: 10px 0;" :size="isMobile ? 'small' : ''"> @@ -748,6 +752,7 @@ { title: "#", align: 'center', width: 20, scopedSlots: { customRender: 'action' } }, { title: '{{ i18n "pages.xray.outbound.address"}}', align: 'center', width: 50, scopedSlots: { customRender: 'address' } }, { title: '{{ i18n "pages.xray.dns.domains"}}', align: 'center', width: 50, scopedSlots: { customRender: 'domain' } }, + { title: '{{ i18n "pages.xray.dns.expectIPs"}}', align: 'center', width: 50, scopedSlots: { customRender: 'expectIPs' } }, ]; const fakednsColumns = [ diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 0978e84e..8174e24f 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -488,6 +488,7 @@ "add" = "Add Server" "edit" = "Edit Server" "domains" = "Domains" +"expectIPs" = "Expect IPs" [pages.xray.fakedns] "add" = "Add Fake DNS" diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml index 1997bd82..b5b306bb 100644 --- a/web/translation/translate.es_ES.toml +++ b/web/translation/translate.es_ES.toml @@ -486,6 +486,7 @@ "add" = "Agregar Servidor"
"edit" = "Editar Servidor"
"domains" = "Dominios"
+"expectIPs" = "IPs esperadas"
[pages.xray.fakedns]
"add" = "Agregar DNS Falso"
diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index dac201f2..b6c8fb60 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -488,6 +488,7 @@ "add" = "افزودن سرور" "edit" = "ویرایش سرور" "domains" = "دامنهها" +"expectIPs" = "آیپیهای مورد انتظار" [pages.xray.fakedns] "add" = "افزودن دیاناس جعلی" diff --git a/web/translation/translate.id_ID.toml b/web/translation/translate.id_ID.toml index 565b10a7..5b649079 100644 --- a/web/translation/translate.id_ID.toml +++ b/web/translation/translate.id_ID.toml @@ -488,6 +488,7 @@ "add" = "Tambahkan Server" "edit" = "Sunting Server" "domains" = "Domains" +"expectIPs" = "IP yang Diharapkan" [pages.xray.fakedns] "add" = "Tambahkan DNS Palsu" diff --git a/web/translation/translate.pt_BR.toml b/web/translation/translate.pt_BR.toml index 106bc9b9..cbfad950 100644 --- a/web/translation/translate.pt_BR.toml +++ b/web/translation/translate.pt_BR.toml @@ -488,6 +488,7 @@ "add" = "Adicionar Servidor" "edit" = "Editar Servidor" "domains" = "Domínios" +"expectIPs" = "IPs Esperadas" [pages.xray.fakedns] "add" = "Adicionar Fake DNS" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 7ddc95c8..4717d889 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -488,6 +488,7 @@ "add" = "Добавить сервер" "edit" = "Редактировать сервер" "domains" = "Домены" +"expectIPs" = "Ожидаемые IP" [pages.xray.fakedns] "add" = "Добавить поддельный DNS" diff --git a/web/translation/translate.tr_TR.toml b/web/translation/translate.tr_TR.toml index f21a2927..52558485 100644 --- a/web/translation/translate.tr_TR.toml +++ b/web/translation/translate.tr_TR.toml @@ -488,6 +488,7 @@ "add" = "Sunucu Ekle" "edit" = "Sunucuyu Düzenle" "domains" = "Alan Adları" +"expectIPs" = "Beklenen IP'ler" [pages.xray.fakedns] "add" = "Sahte DNS Ekle" diff --git a/web/translation/translate.uk_UA.toml b/web/translation/translate.uk_UA.toml index 1ed68eab..a9926bd1 100644 --- a/web/translation/translate.uk_UA.toml +++ b/web/translation/translate.uk_UA.toml @@ -488,6 +488,7 @@ "add" = "Додати сервер" "edit" = "Редагувати сервер" "domains" = "Домени" +"expectIPs" = "Очікувані IP" [pages.xray.fakedns] "add" = "Додати підроблений DNS" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index edcf56bb..91c748cd 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -488,6 +488,7 @@ "add" = "Thêm máy chủ"
"edit" = "Chỉnh sửa máy chủ"
"domains" = "Tên miền"
+"expectIPs" = "Các IP Dự Kiến"
[pages.xray.fakedns]
"add" = "Thêm DNS giả"
diff --git a/web/translation/translate.zh_CN.toml b/web/translation/translate.zh_CN.toml index 65a2a6ea..152e3e6d 100644 --- a/web/translation/translate.zh_CN.toml +++ b/web/translation/translate.zh_CN.toml @@ -488,6 +488,7 @@ "add" = "添加服务器" "edit" = "编辑服务器" "domains" = "域" +"expectIPs" = "预期 IP" [pages.xray.fakedns] "add" = "添加假 DNS" |
