| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  | {{define "settings/xray/dns"}} | 
					
						
							| 
									
										
										
										
											2025-03-25 15:13:17 +00:00
										 |  |  | <a-collapse default-active-key="1"> | 
					
						
							|  |  |  |     <a-collapse-panel key="1" header='{{ i18n "pages.xray.generalConfigs"}}'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |         <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |             <template #title>{{ i18n "pages.xray.dns.enable" }}</template> | 
					
						
							|  |  |  |             <template #description>{{ i18n "pages.xray.dns.enableDesc" }}</template> | 
					
						
							|  |  |  |             <template #control> | 
					
						
							|  |  |  |                 <a-switch v-model="enableDNS"></a-switch> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-setting-list-item> | 
					
						
							|  |  |  |         <template v-if="enableDNS"> | 
					
						
							|  |  |  |             <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |                 <template #title>{{ i18n "pages.xray.dns.tag" }}</template> | 
					
						
							|  |  |  |                 <template #description>{{ i18n "pages.xray.dns.tagDesc" }}</template> | 
					
						
							|  |  |  |                 <template #control> | 
					
						
							|  |  |  |                     <a-input type="text" v-model="dnsTag"></a-input> | 
					
						
							|  |  |  |                 </template> | 
					
						
							|  |  |  |             </a-setting-list-item> | 
					
						
							|  |  |  |             <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |                 <template #title>{{ i18n "pages.xray.dns.clientIp" }}</template> | 
					
						
							|  |  |  |                 <template #description>{{ i18n "pages.xray.dns.clientIpDesc" }}</template> | 
					
						
							|  |  |  |                 <template #control> | 
					
						
							|  |  |  |                     <a-input type="text" v-model="dnsClientIp"></a-input> | 
					
						
							|  |  |  |                 </template> | 
					
						
							|  |  |  |             </a-setting-list-item> | 
					
						
							|  |  |  |             <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |                 <template #title>{{ i18n "pages.xray.dns.strategy" }}</template> | 
					
						
							|  |  |  |                 <template #description>{{ i18n "pages.xray.dns.strategyDesc" }}</template> | 
					
						
							|  |  |  |                 <template #control> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                     <a-select v-model="dnsStrategy" :style="{ width: '100%' }" | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                         :dropdown-class-name="themeSwitcher.currentTheme"> | 
					
						
							| 
									
										
										
										
											2025-06-18 16:24:18 +00:00
										 |  |  |                         <a-select-option :value="l" :label="l" v-for="l in ['UseSystem', 'UseIP', 'UseIPv4', 'UseIPv6']"> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                             <span>[[ l ]]</span> | 
					
						
							|  |  |  |                         </a-select-option> | 
					
						
							|  |  |  |                     </a-select> | 
					
						
							|  |  |  |                 </template> | 
					
						
							|  |  |  |             </a-setting-list-item> | 
					
						
							|  |  |  |             <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |                 <template #title>{{ i18n "pages.xray.dns.disableCache" }}</template> | 
					
						
							|  |  |  |                 <template #description>{{ i18n "pages.xray.dns.disableCacheDesc" }}</template> | 
					
						
							|  |  |  |                 <template #control> | 
					
						
							|  |  |  |                     <a-switch v-model="dnsDisableCache"></a-switch> | 
					
						
							|  |  |  |                 </template> | 
					
						
							|  |  |  |             </a-setting-list-item> | 
					
						
							|  |  |  |             <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |                 <template #title>{{ i18n "pages.xray.dns.disableFallback" }}</template> | 
					
						
							|  |  |  |                 <template #description>{{ i18n "pages.xray.dns.disableFallbackDesc" }}</template> | 
					
						
							|  |  |  |                 <template #control> | 
					
						
							|  |  |  |                     <a-switch v-model="dnsDisableFallback"></a-switch> | 
					
						
							|  |  |  |                 </template> | 
					
						
							|  |  |  |             </a-setting-list-item> | 
					
						
							|  |  |  |             <a-setting-list-item paddings="small"> | 
					
						
							|  |  |  |                 <template #title>{{ i18n "pages.xray.dns.disableFallbackIfMatch" }}</template> | 
					
						
							|  |  |  |                 <template #description>{{ i18n "pages.xray.dns.disableFallbackIfMatchDesc" }}</template> | 
					
						
							|  |  |  |                 <template #control> | 
					
						
							|  |  |  |                     <a-switch v-model="dnsDisableFallbackIfMatch"></a-switch> | 
					
						
							|  |  |  |                 </template> | 
					
						
							|  |  |  |             </a-setting-list-item> | 
					
						
							| 
									
										
										
										
											2025-06-18 16:24:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |             <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> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |         </template> | 
					
						
							|  |  |  |     </a-collapse-panel> | 
					
						
							|  |  |  |     <template v-if="enableDNS"> | 
					
						
							| 
									
										
										
										
											2025-03-25 15:13:17 +00:00
										 |  |  |         <a-collapse-panel key="2" header='DNS'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |             <template v-if="dnsServers.length > 0"> | 
					
						
							|  |  |  |                 <a-space direction="vertical" size="middle"> | 
					
						
							|  |  |  |                     <a-button type="primary" icon="plus" @click="addDNSServer()"> | 
					
						
							|  |  |  |                         <span>{{ i18n "pages.xray.dns.add" }}</span> | 
					
						
							|  |  |  |                     </a-button> | 
					
						
							|  |  |  |                     <a-table :columns="dnsColumns" bordered :row-key="r => r.key" :data-source="dnsServers" | 
					
						
							| 
									
										
										
										
											2025-05-10 14:47:59 +00:00
										 |  |  |                         :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0" | 
					
						
							|  |  |  |                         :locale='{ filterConfirm: `{{ i18n "confirm" }}`, filterReset: `{{ i18n "reset" }}` }'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                         <template slot="action" slot-scope="text,dns,index"> | 
					
						
							|  |  |  |                             <span>[[ index+1 ]]</span> | 
					
						
							|  |  |  |                             <a-dropdown :trigger="['click']"> | 
					
						
							|  |  |  |                                 <a-icon @click="e => e.preventDefault()" type="more" | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                                     :style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                                 <a-menu slot="overlay" :theme="themeSwitcher.currentTheme"> | 
					
						
							|  |  |  |                                     <a-menu-item @click="editDNSServer(index)"> | 
					
						
							|  |  |  |                                         <a-icon type="edit"></a-icon> | 
					
						
							|  |  |  |                                         <span>{{ i18n "edit" }}</span> | 
					
						
							|  |  |  |                                     </a-menu-item> | 
					
						
							|  |  |  |                                     <a-menu-item @click="deleteDNSServer(index)"> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                                         <span :style="{ color: '#FF4D4F' }"> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                                             <a-icon type="delete"></a-icon> | 
					
						
							|  |  |  |                                             <span>{{ i18n "delete"}}</span> | 
					
						
							|  |  |  |                                         </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-space> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |             <template v-else> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                 <a-empty description='{{ i18n "emptyDnsDesc" }}' :style="{ margin: '10px' }"> | 
					
						
							| 
									
										
										
										
											2025-06-18 16:24:18 +00:00
										 |  |  |                     <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> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                 </a-empty> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-collapse-panel> | 
					
						
							| 
									
										
										
										
											2025-03-25 15:13:17 +00:00
										 |  |  |         <a-collapse-panel key="3" header='Fake DNS'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |             <template v-if="fakeDns && fakeDns.length > 0"> | 
					
						
							|  |  |  |                 <a-space direction="vertical" size="middle"> | 
					
						
							|  |  |  |                     <a-button type="primary" icon="plus" @click="addFakedns()">{{ i18n "pages.xray.fakedns.add" | 
					
						
							|  |  |  |                         }}</a-button> | 
					
						
							|  |  |  |                     <a-table :columns="fakednsColumns" bordered :row-key="r => r.key" :data-source="fakeDns" | 
					
						
							| 
									
										
										
										
											2025-05-10 14:47:59 +00:00
										 |  |  |                         :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0" | 
					
						
							|  |  |  |                         :locale='{ filterConfirm: `{{ i18n "confirm" }}`, filterReset: `{{ i18n "reset" }}` }'> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                         <template slot="action" slot-scope="text,fakedns,index"> | 
					
						
							|  |  |  |                             <span>[[ index+1 ]]</span> | 
					
						
							|  |  |  |                             <a-dropdown :trigger="['click']"> | 
					
						
							|  |  |  |                                 <a-icon @click="e => e.preventDefault()" type="more" | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                                     :style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                                 <a-menu slot="overlay" :theme="themeSwitcher.currentTheme"> | 
					
						
							|  |  |  |                                     <a-menu-item @click="editFakedns(index)"> | 
					
						
							|  |  |  |                                         <a-icon type="edit"></a-icon> | 
					
						
							|  |  |  |                                         <span>{{ i18n "edit" }}</span> | 
					
						
							|  |  |  |                                     </a-menu-item> | 
					
						
							|  |  |  |                                     <a-menu-item @click="deleteFakedns(index)"> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                                         <span :style="{ color: '#FF4D4F' }"> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                                             <a-icon type="delete"></a-icon> | 
					
						
							|  |  |  |                                             <span>{{ i18n "delete"}}</span> | 
					
						
							|  |  |  |                                         </span> | 
					
						
							|  |  |  |                                     </a-menu-item> | 
					
						
							|  |  |  |                                 </a-menu> | 
					
						
							|  |  |  |                             </a-dropdown> | 
					
						
							|  |  |  |                         </template> | 
					
						
							|  |  |  |                     </a-table> | 
					
						
							|  |  |  |                 </a-space> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |             <template v-else> | 
					
						
							| 
									
										
										
										
											2025-04-06 09:40:33 +00:00
										 |  |  |                 <a-empty description='{{ i18n "emptyFakeDnsDesc" }}' :style="{ margin: '20px' }"> | 
					
						
							|  |  |  |                     <a-button type="primary" icon="plus" @click="addFakedns()" :style="{ marginTop: '10px' }"> | 
					
						
							| 
									
										
										
										
											2025-03-24 09:45:15 +00:00
										 |  |  |                         <span>{{ i18n "pages.xray.fakedns.add" }}</span> | 
					
						
							|  |  |  |                     </a-button> | 
					
						
							|  |  |  |                 </a-empty> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |         </a-collapse-panel> | 
					
						
							|  |  |  |     </template> | 
					
						
							|  |  |  | </a-collapse> | 
					
						
							|  |  |  | {{end}} |