Browse Source

fit xray settings #1300

Alireza Ahmadi 1 year ago
parent
commit
38013e5ea9
3 changed files with 679 additions and 340 deletions
  1. 464 226
      web/html/xui/form/outbound.html
  2. 69 32
      web/html/xui/xray_reverse_modal.html
  3. 146 82
      web/html/xui/xray_rule_modal.html

+ 464 - 226
web/html/xui/form/outbound.html

@@ -3,296 +3,534 @@
 <a-tabs :active-key="outModal.activeKey"  style="padding: 0; background-color: transparent;" @change="(activeKey) => {outModal.toggleJson(activeKey == '2'); }">
 <a-tab-pane key="1" tab="Form">
 <a-form layout="inline">
-    <a-form-item label='{{ i18n "protocol" }}'>
-        <a-select v-model="outbound.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-            <a-select-option v-for="x,y in Protocols" :value="x">[[ y ]]</a-select-option>
-        </a-select>
-    </a-form-item>
-    <a-form-item label='{{ i18n "pages.xray.outbound.tag" }}' has-feedback :validate-status="outModal.duplicateTag? 'warning' : 'success'">
-        <a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'></a-input>
-    </a-form-item>
+    <table width="100%" class="ant-table-tbody">
+        <tr>
+            <td>{{ i18n "protocol" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="x,y in Protocols" :value="x">[[ y ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "pages.xray.outbound.tag" }}</td>
+            <td>
+                <a-form-item has-feedback :validate-status="outModal.duplicateTag? 'warning' : 'success'">
+                    <a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+
 <!-- freedom settings-->
 <template v-if="outbound.protocol === Protocols.Freedom">
-    <a-form-item label="Strategy">
-        <a-select
-        v-model="outbound.settings.domainStrategy"
-        style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-            <a-select-option v-for="s in outboundDomainStrategies" :value="s">[[ s ]]</a-select-option>
-        </a-select>
-    </a-form-item>
-    <a-form-item label="Fragment">
-        <a-switch
-            :checked="Object.keys(outbound.settings.fragment).length >0"
-            @change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}">
-        </a-switch>
-    </a-form-item>
+        <tr>
+            <td>Strategy</td>
+            <td>
+                <a-form-item>
+                    <a-select
+                    v-model="outbound.settings.domainStrategy"
+                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="s in outboundDomainStrategies" :value="s">[[ s ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Fragment</td>
+            <td>
+                <a-form-item>
+                    <a-switch
+                        :checked="Object.keys(outbound.settings.fragment).length >0"
+                        @change="checked => outbound.settings.fragment = checked ? new Outbound.FreedomSettings.Fragment() : {}">
+                    </a-switch>
+                </a-form-item>
+            </td>
+        </tr>
     <template v-if="Object.keys(outbound.settings.fragment).length >0">
-        <a-form-item label="Packets">
-            <a-select
-            v-model="outbound.settings.fragment.packets"
-            style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="s in ['1-3','tlshello']" :value="s">[[ s ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label="Length">
-            <a-input v-model.trim="outbound.settings.fragment.length" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label="Interval">
-            <a-input v-model.trim="outbound.settings.fragment.interval" style="width: 250px"></a-input>
-        </a-form-item>
+        <tr>
+            <td>Packets</td>
+            <td>
+                <a-form-item>
+                    <a-select
+                    v-model="outbound.settings.fragment.packets"
+                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="s in ['1-3','tlshello']" :value="s">[[ s ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Length</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.settings.fragment.length" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Interval</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.settings.fragment.interval" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
 </template>
 
 <!-- blackhole settings -->
 <template v-if="outbound.protocol === Protocols.Blackhole">
-    <a-form-item label="Response Type">
-        <a-select
-        v-model="outbound.settings.type"
-        style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-            <a-select-option v-for="s in ['', 'none','http']" :value="s">[[ s ]]</a-select-option>
-        </a-select>
-    </a-form-item>
+        <tr>
+            <td>Response Type</td>
+            <td>
+                <a-form-item>
+                    <a-select
+                    v-model="outbound.settings.type"
+                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="s in ['', 'none','http']" :value="s">[[ s ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
 </template>
 
 <!-- dns settings -->
 <template v-if="outbound.protocol === Protocols.DNS">
-    <a-form-item label='{{ i18n "pages.inbounds.network" }}'>
-        <a-select
-        v-model="outbound.settings.network"
-        style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-            <a-select-option v-for="s in ['udp','tcp']" :value="s">[[ s ]]</a-select-option>
-        </a-select>
-    </a-form-item>
+        <tr>
+            <td>{{ i18n "pages.inbounds.network" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select
+                    v-model="outbound.settings.network"
+                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="s in ['udp','tcp']" :value="s">[[ s ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
 </template>
 
 <!-- Address + Port -->
 <template v-if="outbound.hasAddressPort()">
-    <a-form-item label='{{ i18n "pages.inbounds.address" }}'>
-        <a-input v-model.trim="outbound.settings.address" style="width: 250px"></a-input>
-    </a-form-item>
-    <a-form-item label='{{ i18n "pages.inbounds.port" }}'>
-        <a-input-number v-model.number="outbound.settings.port" :min="1" :max="65532"></a-input-number>
-    </a-form-item>
+        <tr>
+            <td>{{ i18n "pages.inbounds.address" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.settings.address" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "pages.inbounds.port" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.settings.port" :min="1" :max="65532"></a-input-number>
+                </a-form-item>
+            </td>
+        </tr>
 </template>
 
 <!-- Vnext (vless/vmess) settings -->
 <template v-if="[Protocols.VMess, Protocols.VLESS].includes(outbound.protocol)">
-    <a-form-item label="ID">
-        <a-input v-model.trim="outbound.settings.id" style="width: 250px"></a-input>
-    </a-form-item>
+        <tr>
+            <td>ID</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.settings.id" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
     <!-- vless settings -->
     <template v-if="outbound.canEnableTlsFlow()">
-        <a-form-item label="Flow">
-            <a-select v-model="outbound.settings.flow" style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
-                <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
-            </a-select>
-        </a-form-item>
+        <tr>
+            <td>Flow</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.settings.flow" style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option value="" selected>{{ i18n "none" }}</a-select-option>
+                        <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
 </template>
 
 <!-- Servers (trojan/shadowsocks/socks/http) settings -->
 <template v-if="outbound.hasServers()">
-    <template v-if="outbound.hasUsername()">
-        <a-form-item label='{{ i18n "username" }}'>
-            <a-input v-model.trim="outbound.settings.user" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='{{ i18n "password" }}'>
-            <a-input v-model.trim="outbound.settings.password" style="width: 250px"></a-input>
-        </a-form-item>
-    </template>
+        <tr v-if="outbound.hasUsername()">
+            <td>{{ i18n "username" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.settings.user" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "password" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.settings.password" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
     <!-- shadowsocks -->
     <template v-if="outbound.protocol === Protocols.Shadowsocks">
-        <a-form-item label='{{ i18n "encryption" }}'>
-            <a-select v-model="outbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label="UDP over TCP">
-            <a-switch v-model="outbound.settings.uot"></a-switch>
-        </a-form-item>
+        <tr>
+            <td>{{ i18n "encryption" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.settings.method" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="method in SSMethods" :value="method">[[ method ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>UDP over TCP</td>
+            <td>
+                <a-form-item>
+                    <a-switch v-model="outbound.settings.uot"></a-switch>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
 </template>
 
 <!-- stream settings -->
 <template v-if="outbound.canEnableStream()">
-    <a-form-item label='{{ i18n "transmission" }}'>
-        <a-select v-model="outbound.stream.network" @change="streamNetworkChange"
-        style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-            <a-select-option value="tcp">TCP</a-select-option>
-            <a-select-option value="kcp">KCP</a-select-option>
-            <a-select-option value="ws">WebSocket</a-select-option>
-            <a-select-option value="http">HTTP2</a-select-option>
-            <a-select-option value="quic">QUIC</a-select-option>
-            <a-select-option value="grpc">gRPC</a-select-option>
-        </a-select>
-    </a-form-item>
+        <tr>
+            <td>{{ i18n "transmission" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.stream.network" @change="streamNetworkChange"
+                    style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option value="tcp">TCP</a-select-option>
+                        <a-select-option value="kcp">KCP</a-select-option>
+                        <a-select-option value="ws">WebSocket</a-select-option>
+                        <a-select-option value="http">HTTP2</a-select-option>
+                        <a-select-option value="quic">QUIC</a-select-option>
+                        <a-select-option value="grpc">gRPC</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
     <template v-if="outbound.stream.network === 'tcp'">
-        <a-form-item label='http {{ i18n "camouflage" }}'>
-            <a-switch
-                    :checked="outbound.stream.tcp.type === 'http'"
-                    @change="checked => outbound.stream.tcp.type = checked ? 'http' : 'none'">
-            </a-switch>
-        </a-form-item>
+        <tr>
+            <td>http {{ i18n "camouflage" }}</td>
+            <td>
+                <a-form-item>
+                    <a-switch
+                            :checked="outbound.stream.tcp.type === 'http'"
+                            @change="checked => outbound.stream.tcp.type = checked ? 'http' : 'none'">
+                    </a-switch>
+                </a-form-item>
+            </td>
+        </tr>
         <template v-if="outbound.stream.tcp.type == 'http'">
-            <a-form-item label='{{ i18n "host" }}'>
-                <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.host"></a-input>
-            </a-form-item> 
-            <a-form-item label='{{ i18n "path" }}'>
-                <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.path"></a-input>
-            </a-form-item> 
+        <tr>
+            <td>{{ i18n "host" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.host"></a-input>
+                </a-form-item> 
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "path" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input style="width: 250px;" v-model.trim="outbound.stream.tcp.path"></a-input>
+                </a-form-item> 
+            </td>
+        </tr>
         </template>
     </template>
     
     <!-- kcp -->
     <template v-if="outbound.stream.network === 'kcp'">
-        <a-form-item label='{{ i18n "camouflage" }}'>
-            <a-select v-model="outbound.stream.kcp.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option value="none">none (not camouflage)</a-select-option>
-                <a-select-option value="srtp">srtp (video call)</a-select-option>
-                <a-select-option value="utp">utp (BT download)</a-select-option>
-                <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
-                <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
-                <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='{{ i18n "password" }}'>
-            <a-input v-model="outbound.stream.kcp.seed" style="width: 250px;"></a-input>
-        </a-form-item>
-        <a-form-item label="mtu">
-            <a-input-number v-model.number="outbound.stream.kcp.mtu"></a-input-number>
-        </a-form-item>
-        <a-form-item label="tti (ms)">
-            <a-input-number v-model.number="outbound.stream.kcp.tti"></a-input-number>
-        </a-form-item>
-        <a-form-item label="uplink capacity (MB/S)">
-            <a-input-number v-model.number="outbound.stream.kcp.upCap"></a-input-number>
-        </a-form-item> 
-        <a-form-item label="downlink capacity (MB/S)">
-            <a-input-number v-model.number="outbound.stream.kcp.downCap"></a-input-number>
-        </a-form-item>
-        <a-form-item label="congestion">
-            <a-switch v-model="outbound.stream.kcp.congestion"></a-switch>
-        </a-form-item>
-        <a-form-item label="read buffer size (MB)">
-            <a-input-number v-model.number="outbound.stream.kcp.readBuffer"></a-input-number>
-        </a-form-item>
-        <a-form-item label="write buffer size (MB)">
-            <a-input-number v-model.number="outbound.stream.kcp.writeBuffer"></a-input-number>
-        </a-form-item>
+        <tr>
+            <td>{{ i18n "camouflage" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.stream.kcp.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option value="none">none (not camouflage)</a-select-option>
+                        <a-select-option value="srtp">srtp (video call)</a-select-option>
+                        <a-select-option value="utp">utp (BT download)</a-select-option>
+                        <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
+                        <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
+                        <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "password" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model="outbound.stream.kcp.seed" style="width: 250px;"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>mtu</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.stream.kcp.mtu"></a-input-number>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>tti (ms)</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.stream.kcp.tti"></a-input-number>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>uplink capacity (MB/S)</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.stream.kcp.upCap"></a-input-number>
+                </a-form-item> 
+            </td>
+        </tr>
+        <tr>
+            <td>downlink capacity (MB/S)</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.stream.kcp.downCap"></a-input-number>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>congestion</td>
+            <td>
+                <a-form-item>
+                    <a-switch v-model="outbound.stream.kcp.congestion"></a-switch>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>read buffer size (MB)</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.stream.kcp.readBuffer"></a-input-number>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>write buffer size (MB)</td>
+            <td>
+                <a-form-item>
+                    <a-input-number v-model.number="outbound.stream.kcp.writeBuffer"></a-input-number>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
     
     <!-- ws -->
     <template v-if="outbound.stream.network === 'ws'">
-        <a-form-item label='{{ i18n "host" }}'>
-            <a-input style="width: 250px" v-model="outbound.stream.ws.host"></a-input>
-        </a-form-item>
-        <a-form-item label='{{ i18n "path" }}'>
-            <a-input style="width: 250px;" v-model.trim="outbound.stream.ws.path"></a-input>
-        </a-form-item>
+        <tr>
+            <td>{{ i18n "host" }}</td>
+            <td><a-form-item><a-input style="width: 250px" v-model="outbound.stream.ws.host"></a-input></a-form-item></td>
+        </tr>
+        <tr>
+            <td>{{ i18n "path" }}</td>
+            <td><a-form-item><a-input style="width: 250px;" v-model.trim="outbound.stream.ws.path"></a-input></a-form-item></td>
+        </tr>
     </template>
     
     <!-- http -->
     <template v-if="outbound.stream.network === 'http'">
-        <a-form-item label='{{ i18n "host" }}'>
-            <a-input v-model.trim="outbound.stream.http.host" style="width: 250px;"></a-input>
-        </a-form-item>
-        <a-form-item label='{{ i18n "path" }}'>
-            <a-input v-model.trim="outbound.stream.http.path" style="width: 250px;"></a-input>
-        </a-form-item>
+        <tr>
+            <td>{{ i18n "host" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.stream.http.host" style="width: 250px;"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "path" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.stream.http.path" style="width: 250px;"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
     
     <!-- quic -->
     <template v-if="outbound.stream.network === 'quic'">
-        <a-form-item label='{{ i18n "pages.inbounds.stream.quic.encryption" }}'>
-            <a-select v-model="outbound.stream.quic.security" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option value="none">none</a-select-option>
-                <a-select-option value="aes-128-gcm">aes-128-gcm</a-select-option>
-                <a-select-option value="chacha20-poly1305">chacha20-poly1305</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='{{ i18n "password" }}'>
-            <a-input v-model.trim="outbound.stream.quic.key" style="width: 250px;"></a-input>
-        </a-form-item> 
-        <a-form-item label='{{ i18n "camouflage" }}'>
-            <a-select v-model="outbound.stream.quic.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option value="none">none (not camouflage)</a-select-option>
-                <a-select-option value="srtp">srtp (video call)</a-select-option>
-                <a-select-option value="utp">utp (BT download)</a-select-option>
-                <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
-                <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
-                <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
-            </a-select>
-        </a-form-item>
+        <tr>
+            <td>{{ i18n "pages.inbounds.stream.quic.encryption" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.stream.quic.security" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option value="none">none</a-select-option>
+                        <a-select-option value="aes-128-gcm">aes-128-gcm</a-select-option>
+                        <a-select-option value="chacha20-poly1305">chacha20-poly1305</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "password" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.stream.quic.key" style="width: 250px;"></a-input>
+                </a-form-item> 
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "camouflage" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="outbound.stream.quic.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option value="none">none (not camouflage)</a-select-option>
+                        <a-select-option value="srtp">srtp (video call)</a-select-option>
+                        <a-select-option value="utp">utp (BT download)</a-select-option>
+                        <a-select-option value="wechat-video">wechat-video (WeChat video)</a-select-option>
+                        <a-select-option value="dtls">dtls (DTLS 1.2 packages)</a-select-option>
+                        <a-select-option value="wireguard">wireguard (wireguard packages)</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
     
     <!-- grpc -->
     <template v-if="outbound.stream.network === 'grpc'">
-        <a-form-item label="serviceName">
-            <a-input v-model.trim="outbound.stream.grpc.serviceName" style="width: 250px;"></a-input>
-        </a-form-item>
-        <a-form-item label="MultiMode">
-            <a-switch v-model="outbound.stream.grpc.multiMode"></a-switch>
-        </a-form-item>
+        <tr>
+            <td>serviceName</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="outbound.stream.grpc.serviceName" style="width: 250px;"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>MultiMode</td>
+            <td>
+                <a-form-item>
+                    <a-switch v-model="outbound.stream.grpc.multiMode"></a-switch>
+                </a-form-item>
+            </td>
+        </tr>
     </template>
 </template>
 
 <!-- tls settings -->
 <template v-if="outbound.canEnableTls()">
-    <a-form-item label='{{ i18n "security" }}'>
-        <a-radio-group v-model="outbound.stream.security" button-style="solid">
-            <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
-            <a-radio-button value="tls">TLS</a-radio-button>
-            <a-radio-button v-if="outbound.canEnableReality()" value="reality">Reality</a-radio-button>
-        </a-radio-group>
-    </a-form-item><br />
-    <template v-if="outbound.stream.isTls">
-        <a-form-item label="SNI" placeholder="Server Name Indication">
-            <a-input v-model.trim="outbound.stream.tls.serverName" style="width: 250px"></a-input>
-        </a-form-item>                
-        <a-form-item label="uTLS">
-            <a-select v-model="outbound.stream.tls.fingerprint"
-                        style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option value=''>None</a-select-option>
-                <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label="ALPN">
-            <a-select
-                mode="multiple"
-                style="width: 250px"
-                :dropdown-class-name="themeSwitcher.currentTheme"
-                v-model="outbound.stream.tls.alpn">
-                <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label="Allow insecure">
-            <a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch>
-        </a-form-item>
-    </template>
+        <tr>
+            <td>{{ i18n "security" }}</td>
+            <td>
+                <a-form-item>
+                    <a-radio-group v-model="outbound.stream.security" button-style="solid">
+                        <a-radio-button value="none">{{ i18n "none" }}</a-radio-button>
+                        <a-radio-button value="tls">TLS</a-radio-button>
+                        <a-radio-button v-if="outbound.canEnableReality()" value="reality">Reality</a-radio-button>
+                    </a-radio-group>
+                </a-form-item>
+            </td>
+        </tr>
+        <template v-if="outbound.stream.isTls">
+            <tr>
+                <td>SNI</td>
+                <td>
+                    <a-form-item placeholder="Server Name Indication">
+                        <a-input v-model.trim="outbound.stream.tls.serverName" style="width: 250px"></a-input>
+                    </a-form-item>                
+                </td>
+            </tr>
+            <tr>
+                <td>uTLS</td>
+                <td>
+                    <a-form-item>
+                        <a-select v-model="outbound.stream.tls.fingerprint"
+                                    style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
+                            <a-select-option value=''>None</a-select-option>
+                            <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
+                        </a-select>
+                    </a-form-item>
+                </td>
+            </tr>
+            <tr>
+                <td>ALPN</td>
+                <td>
+                    <a-form-item>
+                        <a-select
+                            mode="multiple"
+                            style="width: 250px"
+                            :dropdown-class-name="themeSwitcher.currentTheme"
+                            v-model="outbound.stream.tls.alpn">
+                            <a-select-option v-for="alpn in ALPN_OPTION" :value="alpn">[[ alpn ]]</a-select-option>
+                        </a-select>
+                    </a-form-item>
+                </td>
+            </tr>
+            <tr>
+                <td>Allow insecure</td>
+                <td>
+                    <a-form-item>
+                        <a-switch v-model="outbound.stream.tls.allowInsecure"></a-switch>
+                    </a-form-item>
+                </td>
+            </tr>
+        </template>
         
-    <!-- reality settings -->
-    <template v-if="outbound.stream.isReality">
-        <a-form-item label='{{ i18n "domainName" }}'>
-            <a-input v-model.trim="outbound.stream.reality.serverName" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label="uTLS">
-            <a-select v-model="outbound.stream.reality.fingerprint"
-                        style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label="Short Id">
-            <a-input v-model.trim="outbound.stream.reality.shortId" style="width:250px"></a-input>
-        </a-form-item>
-        <a-form-item label="SpiderX">
-            <a-input v-model.trim="outbound.stream.reality.spiderX" style="width:250px"></a-input>
-        </a-form-item>
-        <a-form-item label="Public Key">
-            <a-input v-model.trim="outbound.stream.reality.publicKey" style="width: 250px"></a-input>
-        </a-form-item>
-    </template>
+        <!-- reality settings -->
+        <template v-if="outbound.stream.isReality">
+                <tr>
+                    <td>{{ i18n "domainName" }}</td>
+                    <td>
+                        <a-form-item>
+                            <a-input v-model.trim="outbound.stream.reality.serverName" style="width: 250px"></a-input>
+                        </a-form-item>
+                    </td>
+                </tr>
+                <tr>
+                    <td>uTLS</td>
+                    <td>
+                        <a-form-item>
+                            <a-select v-model="outbound.stream.reality.fingerprint"
+                                      style="width: 250px" :dropdown-class-name="themeSwitcher.currentTheme">
+                                <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option>
+                            </a-select>
+                        </a-form-item>
+                    </td>
+                </tr>
+                <tr>
+                    <td>Short Id</td>
+                    <td>
+                        <a-form-item>
+                            <a-input v-model.trim="outbound.stream.reality.shortId" style="width:250px"></a-input>
+                        </a-form-item>
+                    </td>
+                </tr>
+                <tr>
+                    <td>SpiderX</td>
+                    <td>
+                        <a-form-item>
+                            <a-input v-model.trim="outbound.stream.reality.spiderX" style="width:250px"></a-input>
+                        </a-form-item>
+                    </td>
+                </tr>
+                <tr>
+                    <td>Public Key</td>
+                    <td>
+                        <a-form-item>
+                            <a-input v-model.trim="outbound.stream.reality.publicKey" style="width: 250px"></a-input>
+                        </a-form-item>
+                    </td>
+                </tr>
+        </template>
 </template>
+    </table>
 </a-form>
 </a-tab-pane>
 <a-tab-pane key="2" tab="JSON" force-render="true">

+ 69 - 32
web/html/xui/xray_reverse_modal.html

@@ -3,41 +3,78 @@
          :confirm-loading="reverseModal.confirmLoading" :closable="true" :mask-closable="false"
          :ok-text="reverseModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme">
     <a-form layout="inline">
-        <a-form-item label='{{ i18n "pages.xray.outbound.type" }}'>
-            <a-select v-model="reverseModal.reverse.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="x,y in reverseTypes" :value="y">[[ x ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='{{ i18n "pages.xray.outbound.tag" }}'>
-            <a-input v-model.trim="reverseModal.reverse.tag" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='{{ i18n "pages.xray.outbound.domain" }}'>
-            <a-input v-model.trim="reverseModal.reverse.domain" style="width: 250px"></a-input>
-        </a-form-item>
+    <table width="100%" class="ant-table-tbody">
+        <tr>
+            <td>{{ i18n "pages.xray.outbound.type" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="reverseModal.reverse.type" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="x,y in reverseTypes" :value="y">[[ x ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "pages.xray.outbound.tag" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="reverseModal.reverse.tag" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "pages.xray.outbound.domain" }}</td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="reverseModal.reverse.domain" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
         <template v-if="reverseModal.reverse.type=='bridge'">
-            <a-form-item label='{{ i18n "pages.xray.outbound.intercon" }}'>
-                <a-select v-model="reverseModal.rules[0].outboundTag" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                    <a-select-option v-for="x in reverseModal.outboundTags" :value="x">[[ x ]]</a-select-option>
-                </a-select>
-            </a-form-item>
-            <a-form-item label='{{ i18n "pages.xray.rules.outbound" }}'>
-                <a-select v-model="reverseModal.rules[1].outboundTag" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                    <a-select-option v-for="x in reverseModal.outboundTags" :value="x">[[ x ]]</a-select-option>
-                </a-select>
-            </a-form-item>
+        <tr>
+            <td>{{ i18n "pages.xray.outbound.intercon" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="reverseModal.rules[0].outboundTag" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="x in reverseModal.outboundTags" :value="x">[[ x ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>{{ i18n "pages.xray.rules.outbound" }}</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="reverseModal.rules[1].outboundTag" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="x in reverseModal.outboundTags" :value="x">[[ x ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
         </template>
         <template v-else>
-            <a-form-item label='{{ i18n "pages.xray.outbound.intercon" }}'>
-                <a-checkbox-group
-                    v-model="reverseModal.rules[0].inboundTag"
-                    :options="reverseModal.inboundTags"></a-checkbox-group>
-            </a-form-item>
-            <a-form-item label='{{ i18n "pages.xray.rules.inbound" }}'>
-                <a-checkbox-group
-                    v-model="reverseModal.rules[1].inboundTag"
-                    :options="reverseModal.inboundTags"></a-checkbox-group>
-            </a-form-item>
+            <tr>
+                <td>{{ i18n "pages.xray.outbound.intercon" }}</td>
+                <td>
+                    <a-form-item>
+                        <a-checkbox-group
+                            v-model="reverseModal.rules[0].inboundTag"
+                            :options="reverseModal.inboundTags"></a-checkbox-group>
+                    </a-form-item>
+                </td>
+            </tr>
+            <tr>
+                <td>{{ i18n "pages.xray.rules.inbound" }}</td>
+                <td>
+                    <a-form-item>
+                        <a-checkbox-group
+                            v-model="reverseModal.rules[1].inboundTag"
+                            :options="reverseModal.inboundTags"></a-checkbox-group>
+                    </a-form-item>
+                </td>
+            </tr>
         </template>
+    </table>
     </a-form>
 </a-modal>
 <script>
@@ -136,4 +173,4 @@
     });
 
 </script>
-{{end}}
+{{end}}

+ 146 - 82
web/html/xui/xray_rule_modal.html

@@ -3,87 +3,149 @@
          :confirm-loading="ruleModal.confirmLoading" :closable="true" :mask-closable="false"
          :ok-text="ruleModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme">
     <a-form layout="inline">
-        <a-form-item label='Domain Matcher'>
-            <a-select v-model="ruleModal.rule.domainMatcher" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="dm in ['','hybrid','linear']" :value="dm">[[ dm ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='Source IPs'>
-            <a-tooltip>
-                <template slot="title">
-                    <span>{{ i18n "pages.xray.rules.useComma" }}</span>
-                </template>
-                <a-icon type="question-circle"></a-icon>
-            </a-tooltip>
-            <a-input v-model.trim="ruleModal.rule.source" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='Source Port'>
-            <a-tooltip>
-                <template slot="title">
-                    <span>{{ i18n "pages.xray.rules.useComma" }}</span>
-                </template>
-                <a-icon type="question-circle"></a-icon>
-            </a-tooltip>
-            <a-input v-model.trim="ruleModal.rule.sourcePort" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='Network'>
-            <a-select v-model="ruleModal.rule.network" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="x in ['','tcp','tdp','tcp,udp']" :value="x">[[ x ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='Protocol'>
-            <a-select v-model="ruleModal.rule.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="x in ['','http','tls','bittorrent']" :value="x">[[ x ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='Attributes'>
-            <a-button size="small" style="margin-left: 10px" @click="ruleModal.rule.attrs.push(['', ''])">+</a-button>
-            <a-input-group compact v-for="(attr,index) in ruleModal.rule.attrs">
-                <a-input style="width: 50%" v-model="attr[0]" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
-                    <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
-                </a-input>
-                <a-input style="width: 50%" v-model="attr[1]" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
-                    <a-button slot="addonAfter" size="small" @click="ruleModal.rule.attrs.splice(index,1)">-</a-button>
-                </a-input>
-            </a-input-group>
-        </a-form-item>
-        <a-form-item label='IP'>
-            <a-tooltip>
-                <template slot="title">
-                    <span>{{ i18n "pages.xray.rules.useComma" }}</span>
-                </template>
-                <a-icon type="question-circle"></a-icon>
-            </a-tooltip>
-            <a-input v-model.trim="ruleModal.rule.ip" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='Domain'>
-            <a-tooltip>
-                <template slot="title">
-                    <span>{{ i18n "pages.xray.rules.useComma" }}</span>
-                </template>
-                <a-icon type="question-circle"></a-icon>
-            </a-tooltip>
-            <a-input v-model.trim="ruleModal.rule.domain" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='Port'>
-            <a-tooltip>
-                <template slot="title">
-                    <span>{{ i18n "pages.xray.rules.useComma" }}</span>
-                </template>
-                <a-icon type="question-circle"></a-icon>
-            </a-tooltip>
-            <a-input v-model.trim="ruleModal.rule.port" style="width: 250px"></a-input>
-        </a-form-item>
-        <a-form-item label='Inbound Tags'>
-            <a-select v-model="ruleModal.rule.inboundTag" mode="multiple" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="tag in ruleModal.inboundTags" :value="tag">[[ tag ]]</a-select-option>
-            </a-select>
-        </a-form-item>
-        <a-form-item label='Outbound Tag'>
-            <a-select v-model="ruleModal.rule.outboundTag" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
-                <a-select-option v-for="tag in ruleModal.outboundTags" :value="tag">[[ tag ]]</a-select-option>
-            </a-select>
-        </a-form-item>
+        <table width="100%" class="ant-table-tbody">
+            <tr>
+            <td style="width: 30%;">Domain Matcher</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="ruleModal.rule.domainMatcher" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="dm in ['','hybrid','linear']" :value="dm">[[ dm ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Source IPs
+                <a-tooltip>
+                    <template slot="title">
+                        <span>{{ i18n "pages.xray.rules.useComma" }}</span>
+                    </template>
+                    <a-icon type="question-circle"></a-icon>
+                </a-tooltip>
+            </td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="ruleModal.rule.source" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Source Port
+                <a-tooltip>
+                    <template slot="title">
+                        <span>{{ i18n "pages.xray.rules.useComma" }}</span>
+                    </template>
+                    <a-icon type="question-circle"></a-icon>
+                </a-tooltip>
+            </td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="ruleModal.rule.sourcePort" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Network</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="ruleModal.rule.network" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="x in ['','tcp','tdp','tcp,udp']" :value="x">[[ x ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Protocol</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="ruleModal.rule.protocol" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="x in ['','http','tls','bittorrent']" :value="x">[[ x ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <a-form-item>
+                    <span>Attributes</span>
+                    <a-button size="small" style="margin-left: 10px" @click="ruleModal.rule.attrs.push(['', ''])">+</a-button>
+                    <a-input-group compact v-for="(attr,index) in ruleModal.rule.attrs">
+                        <a-input style="width: 50%" v-model="attr[0]" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
+                            <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
+                        </a-input>
+                        <a-input style="width: 50%" v-model="attr[1]" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
+                            <a-button slot="addonAfter" size="small" @click="ruleModal.rule.attrs.splice(index,1)">-</a-button>
+                        </a-input>
+                    </a-input-group>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>IP
+                <a-tooltip>
+                    <template slot="title">
+                        <span>{{ i18n "pages.xray.rules.useComma" }}</span>
+                    </template>
+                    <a-icon type="question-circle"></a-icon>
+                </a-tooltip>
+            </td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="ruleModal.rule.ip" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Domain
+                <a-tooltip>
+                    <template slot="title">
+                        <span>{{ i18n "pages.xray.rules.useComma" }}</span>
+                    </template>
+                    <a-icon type="question-circle"></a-icon>
+                </a-tooltip>
+            </td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="ruleModal.rule.domain" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Port
+                <a-tooltip>
+                    <template slot="title">
+                        <span>{{ i18n "pages.xray.rules.useComma" }}</span>
+                    </template>
+                    <a-icon type="question-circle"></a-icon>
+                </a-tooltip>
+            </td>
+            <td>
+                <a-form-item>
+                    <a-input v-model.trim="ruleModal.rule.port" style="width: 250px"></a-input>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Inbound Tags</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="ruleModal.rule.inboundTag" mode="multiple" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="tag in ruleModal.inboundTags" :value="tag">[[ tag ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+        <tr>
+            <td>Outbound Tag</td>
+            <td>
+                <a-form-item>
+                    <a-select v-model="ruleModal.rule.outboundTag" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
+                        <a-select-option v-for="tag in ruleModal.outboundTags" :value="tag">[[ tag ]]</a-select-option>
+                    </a-select>
+                </a-form-item>
+            </td>
+        </tr>
+    </table>
     </a-form>
 </a-modal>
 <script>
@@ -96,6 +158,7 @@
         isEdit: false,
         confirm: null,
         rule: {
+            type: "field",
             domainMatcher: "",
             domain: "",
             ip: "",
@@ -173,6 +236,7 @@
             value = ruleModal.rule;
             rule = {};
             newRule = {};
+            rule.type = "field";
             rule.domainMatcher = value.domainMatcher;
             rule.domain = value.domain.length>0 ? value.domain.split(',') : [];
             rule.ip = value.ip.length>0 ? value.ip.split(',') : [];
@@ -210,4 +274,4 @@
     });
 
 </script>
-{{end}}
+{{end}}