Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dns.html « xray « settings « html « web - github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2cb7082c2c030724eb12ce7a8d873f5d600dc7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{{define "settings/xray/dns"}}
<a-collapse default-active-key="1">
    <a-collapse-panel key="1" header='{{ i18n "pages.xray.generalConfigs"}}'>
        <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>
                    <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']">
                            <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>
        </template>
    </a-collapse-panel>
    <template v-if="enableDNS">
        <a-collapse-panel key="2" header='DNS'>
            <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"
                        :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0">
                        <template slot="action" slot-scope="text,dns,index">
                            <span>[[ index+1 ]]</span>
                            <a-dropdown :trigger="['click']">
                                <a-icon @click="e => e.preventDefault()" type="more"
                                    :style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon>
                                <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)">
                                        <span :style="{ color: '#FF4D4F' }">
                                            <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>
                <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-empty>
            </template>
        </a-collapse-panel>
        <a-collapse-panel key="3" header='Fake DNS'>
            <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"
                        :scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0">
                        <template slot="action" slot-scope="text,fakedns,index">
                            <span>[[ index+1 ]]</span>
                            <a-dropdown :trigger="['click']">
                                <a-icon @click="e => e.preventDefault()" type="more"
                                    :style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon>
                                <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)">
                                        <span :style="{ color: '#FF4D4F' }">
                                            <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>
                <a-empty description='{{ i18n "emptyFakeDnsDesc" }}' :style="{ margin: '20px' }">
                    <a-button type="primary" icon="plus" @click="addFakedns()" :style="{ marginTop: '10px' }">
                        <span>{{ i18n "pages.xray.fakedns.add" }}</span>
                    </a-button>
                </a-empty>
            </template>
        </a-collapse-panel>
    </template>
</a-collapse>
{{end}}