Skip to content

Commit 653ec90

Browse files
authored
chore: pretty dns section in xray settings (#2700)
1 parent 91a84db commit 653ec90

File tree

1 file changed

+107
-81
lines changed

1 file changed

+107
-81
lines changed

web/html/xui/xray.html

+107-81
Original file line numberDiff line numberDiff line change
@@ -661,88 +661,114 @@
661661
<textarea style="position:absolute; left: -800px;" id="obsSetting"></textarea>
662662
</a-tab-pane>
663663
<a-tab-pane key="tpl-dns" tab='DNS' style="padding-top: 20px;" force-render="true">
664-
<setting-list-item type="switch" title='{{ i18n "pages.xray.dns.enable" }}'
665-
desc='{{ i18n "pages.xray.dns.enableDesc" }}' v-model="enableDNS"></setting-list-item>
666-
<template v-if="enableDNS">
667-
<setting-list-item style="padding: 10px 20px" type="text" title='{{ i18n "pages.xray.dns.tag" }}'
668-
desc='{{ i18n "pages.xray.dns.tagDesc" }}' v-model="dnsTag"></setting-list-item>
669-
<a-list-item style="padding: 10px 20px">
670-
<a-row>
671-
<a-col :lg="24" :xl="12">
672-
<a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}'
673-
description='{{ i18n "pages.xray.dns.strategyDesc" }}' />
674-
</a-col>
675-
<a-col :lg="24" :xl="12">
676-
<a-select v-model="dnsStrategy" style="width: 100%"
677-
:dropdown-class-name="themeSwitcher.currentTheme">
678-
<a-select-option :value="l" :label="l" v-for="l in ['UseIP', 'UseIPv4', 'UseIPv6']">
679-
[[ l ]]
680-
</a-select-option>
681-
</a-select>
682-
</a-col>
683-
</a-row>
684-
</a-list-item>
685-
<a-divider>DNS</a-divider>
686-
<a-button type="primary" icon="plus" @click="addDNSServer()" style="margin-bottom: 10px;">{{ i18n
687-
"pages.xray.dns.add" }}</a-button>
688-
<a-table :columns="dnsColumns" bordered v-if="dnsServers.length>0" :row-key="r => r.key"
689-
:data-source="dnsServers" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
690-
:style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'">
691-
<template slot="action" slot-scope="text,dns,index">
692-
[[ index+1 ]]
693-
<a-dropdown :trigger="['click']">
694-
<a-icon @click="e => e.preventDefault()" type="more"
695-
style="font-size: 16px; text-decoration: bold;"></a-icon>
696-
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
697-
<a-menu-item @click="editDNSServer(index)">
698-
<a-icon type="edit"></a-icon>
699-
{{ i18n "edit" }}
700-
</a-menu-item>
701-
<a-menu-item @click="deleteDNSServer(index)">
702-
<span style="color: #FF4D4F">
703-
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
704-
</span>
705-
</a-menu-item>
706-
</a-menu>
707-
</a-dropdown>
708-
</template>
709-
<template slot="address" slot-scope="dns,index">
710-
<span v-if="typeof dns == 'object'">[[ dns.address ]]</span>
711-
<span v-else>[[ dns ]]</span>
712-
</template>
713-
<template slot="domain" slot-scope="dns,index">
714-
<span v-if="typeof dns == 'object'">[[ dns.domains.join(",") ]]</span>
715-
</template>
716-
<template slot="expectIPs" slot-scope="dns,index">
717-
<span v-if="typeof dns == 'object'">[[ dns.expectIPs.join(",") ]]</span>
718-
</template>
719-
</a-table>
720-
<a-divider>Fake DNS</a-divider>
721-
<a-button type="primary" icon="plus" @click="addFakedns()" style="margin-bottom: 10px;">{{ i18n
722-
"pages.xray.fakedns.add" }}</a-button>
723-
<a-table :columns="fakednsColumns" bordered v-if="fakeDns && fakeDns.length>0" :row-key="r => r.key"
724-
:data-source="fakeDns" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
725-
:style="isMobile ? 'padding: 5px 0' : 'margin-left: 1px;'">
726-
<template slot="action" slot-scope="text,fakedns,index">
727-
[[ index+1 ]]
728-
<a-dropdown :trigger="['click']">
729-
<a-icon @click="e => e.preventDefault()" type="more"
730-
style="font-size: 16px; text-decoration: bold;"></a-icon>
731-
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
732-
<a-menu-item @click="editFakedns(index)">
733-
<a-icon type="edit"></a-icon>
734-
{{ i18n "edit" }}
735-
</a-menu-item>
736-
<a-menu-item @click="deleteFakedns(index)">
737-
<span style="color: #FF4D4F">
738-
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
739-
</span>
740-
</a-menu-item>
741-
</a-menu>
742-
</a-dropdown>
664+
<a-collapse>
665+
<a-collapse-panel header='{{ i18n "pages.xray.generalConfigs"}}'>
666+
<a-list-item>
667+
<a-row style="padding: 10px 20px; padding-top: 0;">
668+
<a-col :lg="24" :xl="12">
669+
<a-list-item-meta title='{{ i18n "pages.xray.dns.enable" }}'
670+
description='{{ i18n "pages.xray.dns.enableDesc" }}' />
671+
</a-col>
672+
<a-col :lg="24" :xl="12">
673+
<a-switch v-model="enableDNS"></a-switch>
674+
</a-col>
675+
</a-row>
676+
</a-list-item>
677+
<template v-if="enableDNS">
678+
<a-list-item>
679+
<a-row style="padding: 10px 20px;">
680+
<a-col :lg="24" :xl="12">
681+
<a-list-item-meta title='{{ i18n "pages.xray.dns.tag" }}'
682+
description='{{ i18n "pages.xray.dns.tagDesc" }}' />
683+
</a-col>
684+
<a-col :lg="24" :xl="12">
685+
<a-input type="text" v-model="dnsTag"></a-input>
686+
</a-col>
687+
</a-row>
688+
</a-list-item>
689+
<a-list-item>
690+
<a-row style="padding: 10px 20px;">
691+
<a-col :lg="24" :xl="12">
692+
<a-list-item-meta title='{{ i18n "pages.xray.dns.strategy" }}'
693+
description='{{ i18n "pages.xray.dns.strategyDesc" }}' />
694+
</a-col>
695+
<a-col :lg="24" :xl="12">
696+
<a-select v-model="dnsStrategy" style="width: 100%"
697+
:dropdown-class-name="themeSwitcher.currentTheme">
698+
<a-select-option :value="l" :label="l" v-for="l in ['UseIP', 'UseIPv4', 'UseIPv6']">
699+
[[ l ]]
700+
</a-select-option>
701+
</a-select>
702+
</a-col>
703+
</a-row>
704+
</a-list-item>
743705
</template>
744-
</a-table>
745-
</template>
706+
</a-collapse-panel>
707+
<template v-if="enableDNS">
708+
<a-collapse-panel header='DNS'>
709+
<a-button type="primary" icon="plus" @click="addDNSServer()" style="margin: 10px;">{{ i18n
710+
"pages.xray.dns.add" }}</a-button>
711+
<a-table :columns="dnsColumns" bordered v-if="dnsServers.length>0" :row-key="r => r.key"
712+
:data-source="dnsServers" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
713+
style="margin: 10px; margin-top: 10px;">
714+
<template slot="action" slot-scope="text,dns,index">
715+
[[ index+1 ]]
716+
<a-dropdown :trigger="['click']">
717+
<a-icon @click="e => e.preventDefault()" type="more"
718+
style="font-size: 16px; text-decoration: bold;"></a-icon>
719+
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
720+
<a-menu-item @click="editDNSServer(index)">
721+
<a-icon type="edit"></a-icon>
722+
{{ i18n "edit" }}
723+
</a-menu-item>
724+
<a-menu-item @click="deleteDNSServer(index)">
725+
<span style="color: #FF4D4F">
726+
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
727+
</span>
728+
</a-menu-item>
729+
</a-menu>
730+
</a-dropdown>
731+
</template>
732+
<template slot="address" slot-scope="dns,index">
733+
<span v-if="typeof dns == 'object'">[[ dns.address ]]</span>
734+
<span v-else>[[ dns ]]</span>
735+
</template>
736+
<template slot="domain" slot-scope="dns,index">
737+
<span v-if="typeof dns == 'object'">[[ dns.domains.join(",") ]]</span>
738+
</template>
739+
<template slot="expectIPs" slot-scope="dns,index">
740+
<span v-if="typeof dns == 'object'">[[ dns.expectIPs.join(",") ]]</span>
741+
</template>
742+
</a-table>
743+
</a-collapse-panel>
744+
<a-collapse-panel header='FakeDNS'>
745+
<a-button type="primary" icon="plus" @click="addFakedns()" style="margin: 10px;">{{ i18n
746+
"pages.xray.fakedns.add" }}</a-button>
747+
<a-table :columns="fakednsColumns" bordered v-if="fakeDns && fakeDns.length>0" :row-key="r => r.key"
748+
:data-source="fakeDns" :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
749+
style="margin: 10px; margin-top: 10px;">
750+
<template slot="action" slot-scope="text,fakedns,index">
751+
[[ index+1 ]]
752+
<a-dropdown :trigger="['click']">
753+
<a-icon @click="e => e.preventDefault()" type="more"
754+
style="font-size: 16px; text-decoration: bold;"></a-icon>
755+
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
756+
<a-menu-item @click="editFakedns(index)">
757+
<a-icon type="edit"></a-icon>
758+
{{ i18n "edit" }}
759+
</a-menu-item>
760+
<a-menu-item @click="deleteFakedns(index)">
761+
<span style="color: #FF4D4F">
762+
<a-icon type="delete"></a-icon> {{ i18n "delete"}}
763+
</span>
764+
</a-menu-item>
765+
</a-menu>
766+
</a-dropdown>
767+
</template>
768+
</a-table>
769+
</a-collapse-panel>
770+
</template>
771+
</a-collapse>
746772
</a-tab-pane>
747773
<a-tab-pane key="tpl-advanced" tab='{{ i18n "pages.xray.advancedTemplate"}}' style="padding-top: 20px;" force-render="true">
748774
<a-list-item-meta title='{{ i18n "pages.xray.Template"}}' description='{{ i18n "pages.xray.TemplateDesc"}}'></a-list-item-meta>

0 commit comments

Comments
 (0)