mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
chore: pretty dns section in xray settings
This commit is contained in:
parent
ea19fb8ff6
commit
adf9743d5a
1 changed files with 107 additions and 81 deletions
|
@ -661,88 +661,114 @@
|
||||||
<textarea style="position:absolute; left: -800px;" id="obsSetting"></textarea>
|
<textarea style="position:absolute; left: -800px;" id="obsSetting"></textarea>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="tpl-dns" tab='DNS' style="padding-top: 20px;" force-render="true">
|
<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" }}'
|
<a-collapse>
|
||||||
desc='{{ i18n "pages.xray.dns.enableDesc" }}' v-model="enableDNS"></setting-list-item>
|
<a-collapse-panel header='{{ i18n "pages.xray.generalConfigs"}}'>
|
||||||
<template v-if="enableDNS">
|
<a-list-item>
|
||||||
<setting-list-item style="padding: 10px 20px" type="text" title='{{ i18n "pages.xray.dns.tag" }}'
|
<a-row style="padding: 10px 20px; padding-top: 0;">
|
||||||
desc='{{ i18n "pages.xray.dns.tagDesc" }}' v-model="dnsTag"></setting-list-item>
|
<a-col :lg="24" :xl="12">
|
||||||
<a-list-item style="padding: 10px 20px">
|
<a-list-item-meta title='{{ i18n "pages.xray.dns.enable" }}'
|
||||||
<a-row>
|
description='{{ i18n "pages.xray.dns.enableDesc" }}' />
|
||||||
<a-col :lg="24" :xl="12">
|
</a-col>
|
||||||
<a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}'
|
<a-col :lg="24" :xl="12">
|
||||||
description='{{ i18n "pages.xray.dns.strategyDesc" }}' />
|
<a-switch v-model="enableDNS"></a-switch>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="24" :xl="12">
|
</a-row>
|
||||||
<a-select v-model="dnsStrategy" style="width: 100%"
|
</a-list-item>
|
||||||
:dropdown-class-name="themeSwitcher.currentTheme">
|
<template v-if="enableDNS">
|
||||||
<a-select-option :value="l" :label="l" v-for="l in ['UseIP', 'UseIPv4', 'UseIPv6']">
|
<a-list-item>
|
||||||
[[ l ]]
|
<a-row style="padding: 10px 20px;">
|
||||||
</a-select-option>
|
<a-col :lg="24" :xl="12">
|
||||||
</a-select>
|
<a-list-item-meta title='{{ i18n "pages.xray.dns.tag" }}'
|
||||||
</a-col>
|
description='{{ i18n "pages.xray.dns.tagDesc" }}' />
|
||||||
</a-row>
|
</a-col>
|
||||||
</a-list-item>
|
<a-col :lg="24" :xl="12">
|
||||||
<a-divider>DNS</a-divider>
|
<a-input type="text" v-model="dnsTag"></a-input>
|
||||||
<a-button type="primary" icon="plus" @click="addDNSServer()" style="margin-bottom: 10px;">{{ i18n
|
</a-col>
|
||||||
"pages.xray.dns.add" }}</a-button>
|
</a-row>
|
||||||
<a-table :columns="dnsColumns" bordered v-if="dnsServers.length>0" :row-key="r => r.key"
|
</a-list-item>
|
||||||
:data-source="dnsServers" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
|
<a-list-item>
|
||||||
:style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'">
|
<a-row style="padding: 10px 20px;">
|
||||||
<template slot="action" slot-scope="text,dns,index">
|
<a-col :lg="24" :xl="12">
|
||||||
[[ index+1 ]]
|
<a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}'
|
||||||
<a-dropdown :trigger="['click']">
|
description='{{ i18n "pages.xray.dns.strategyDesc" }}' />
|
||||||
<a-icon @click="e => e.preventDefault()" type="more"
|
</a-col>
|
||||||
style="font-size: 16px; text-decoration: bold;"></a-icon>
|
<a-col :lg="24" :xl="12">
|
||||||
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
|
<a-select v-model="dnsStrategy" style="width: 100%"
|
||||||
<a-menu-item @click="editDNSServer(index)">
|
:dropdown-class-name="themeSwitcher.currentTheme">
|
||||||
<a-icon type="edit"></a-icon>
|
<a-select-option :value="l" :label="l" v-for="l in ['UseIP', 'UseIPv4', 'UseIPv6']">
|
||||||
{{ i18n "edit" }}
|
[[ l ]]
|
||||||
</a-menu-item>
|
</a-select-option>
|
||||||
<a-menu-item @click="deleteDNSServer(index)">
|
</a-select>
|
||||||
<span style="color: #FF4D4F">
|
</a-col>
|
||||||
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
|
</a-row>
|
||||||
</span>
|
</a-list-item>
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
</a-dropdown>
|
|
||||||
</template>
|
</template>
|
||||||
<template slot="address" slot-scope="dns,index">
|
</a-collapse-panel>
|
||||||
<span v-if="typeof dns == 'object'">[[ dns.address ]]</span>
|
<template v-if="enableDNS">
|
||||||
<span v-else>[[ dns ]]</span>
|
<a-collapse-panel header='DNS'>
|
||||||
</template>
|
<a-button type="primary" icon="plus" @click="addDNSServer()" style="margin: 10px;">{{ i18n
|
||||||
<template slot="domain" slot-scope="dns,index">
|
"pages.xray.dns.add" }}</a-button>
|
||||||
<span v-if="typeof dns == 'object'">[[ dns.domains.join(",") ]]</span>
|
<a-table :columns="dnsColumns" bordered v-if="dnsServers.length>0" :row-key="r => r.key"
|
||||||
</template>
|
:data-source="dnsServers" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
|
||||||
<template slot="expectIPs" slot-scope="dns,index">
|
style="margin: 10px; margin-top: 10px;">
|
||||||
<span v-if="typeof dns == 'object'">[[ dns.expectIPs.join(",") ]]</span>
|
<template slot="action" slot-scope="text,dns,index">
|
||||||
</template>
|
[[ index+1 ]]
|
||||||
</a-table>
|
<a-dropdown :trigger="['click']">
|
||||||
<a-divider>Fake DNS</a-divider>
|
<a-icon @click="e => e.preventDefault()" type="more"
|
||||||
<a-button type="primary" icon="plus" @click="addFakedns()" style="margin-bottom: 10px;">{{ i18n
|
style="font-size: 16px; text-decoration: bold;"></a-icon>
|
||||||
"pages.xray.fakedns.add" }}</a-button>
|
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
|
||||||
<a-table :columns="fakednsColumns" bordered v-if="fakeDns && fakeDns.length>0" :row-key="r => r.key"
|
<a-menu-item @click="editDNSServer(index)">
|
||||||
:data-source="fakeDns" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
|
<a-icon type="edit"></a-icon>
|
||||||
:style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'">
|
{{ i18n "edit" }}
|
||||||
<template slot="action" slot-scope="text,fakedns,index">
|
</a-menu-item>
|
||||||
[[ index+1 ]]
|
<a-menu-item @click="deleteDNSServer(index)">
|
||||||
<a-dropdown :trigger="['click']">
|
<span style="color: #FF4D4F">
|
||||||
<a-icon @click="e => e.preventDefault()" type="more"
|
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
|
||||||
style="font-size: 16px; text-decoration: bold;"></a-icon>
|
</span>
|
||||||
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
|
</a-menu-item>
|
||||||
<a-menu-item @click="editFakedns(index)">
|
</a-menu>
|
||||||
<a-icon type="edit"></a-icon>
|
</a-dropdown>
|
||||||
{{ i18n "edit" }}
|
</template>
|
||||||
</a-menu-item>
|
<template slot="address" slot-scope="dns,index">
|
||||||
<a-menu-item @click="deleteFakedns(index)">
|
<span v-if="typeof dns == 'object'">[[ dns.address ]]</span>
|
||||||
<span style="color: #FF4D4F">
|
<span v-else>[[ dns ]]</span>
|
||||||
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
|
</template>
|
||||||
</span>
|
<template slot="domain" slot-scope="dns,index">
|
||||||
</a-menu-item>
|
<span v-if="typeof dns == 'object'">[[ dns.domains.join(",") ]]</span>
|
||||||
</a-menu>
|
</template>
|
||||||
</a-dropdown>
|
<template slot="expectIPs" slot-scope="dns,index">
|
||||||
</template>
|
<span v-if="typeof dns == 'object'">[[ dns.expectIPs.join(",") ]]</span>
|
||||||
</a-table>
|
</template>
|
||||||
</template>
|
</a-table>
|
||||||
|
</a-collapse-panel>
|
||||||
|
<a-collapse-panel header='FakeDNS'>
|
||||||
|
<a-button type="primary" icon="plus" @click="addFakedns()" style="margin: 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="margin: 10px; margin-top: 10px;">
|
||||||
|
<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>
|
||||||
|
</a-collapse-panel>
|
||||||
|
</template>
|
||||||
|
</a-collapse>
|
||||||
</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-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-list-item-meta title='{{ i18n "pages.xray.Template"}}' description='{{ i18n "pages.xray.TemplateDesc"}}'></a-list-item-meta>
|
||||||
|
|
Loading…
Reference in a new issue