Browse Source

[xray] add outbound sendThrough + warp typo fix

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 year ago
parent
commit
10f54cd937

+ 4 - 0
web/assets/js/model/outbound.js

@@ -501,6 +501,7 @@ class Outbound extends CommonClass {
         protocol=Protocols.VMess,
         settings=null,
         streamSettings = new StreamSettings(),
+        sendThrough,
         mux = new Mux(),
     ) {
         super();
@@ -508,6 +509,7 @@ class Outbound extends CommonClass {
         this._protocol = protocol;
         this.settings = settings == null ? Outbound.Settings.getSettings(protocol) : settings;
         this.stream = streamSettings;
+        this.sendThrough = sendThrough;
         this.mux = mux;
     }
 
@@ -573,6 +575,7 @@ class Outbound extends CommonClass {
             json.protocol,
             Outbound.Settings.fromJson(json.protocol, json.settings),
             StreamSettings.fromJson(json.streamSettings),
+            json.sendThrough,
             Mux.fromJson(json.mux),
         )
     }
@@ -590,6 +593,7 @@ class Outbound extends CommonClass {
             protocol: this.protocol,
             settings: this.settings instanceof CommonClass ? this.settings.toJson() : this.settings,
             streamSettings: stream,
+            sendThrough: this.sendThrough != "" ? this.sendThrough : undefined,
             mux: this.mux?.enabled ? this.mux : undefined,
         };
     }

+ 3 - 0
web/html/xui/form/outbound.html

@@ -11,6 +11,9 @@
         <a-form-item label='{{ i18n "pages.xray.outbound.tag" }}' has-feedback :validate-status="outModal.duplicateTag? 'warning' : 'success'">
             <a-input v-model.trim="outbound.tag" @change="outModal.check()" placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'></a-input>
         </a-form-item>
+        <a-form-item label='{{ i18n "pages.xray.outbound.sendThrough" }}'>
+            <a-input v-model="outbound.sendThrough"></a-input>
+        </a-form-item>
 
 <!-- freedom settings-->
 <template v-if="outbound.protocol === Protocols.Freedom">

+ 13 - 14
web/html/xui/warp_modal.html

@@ -12,7 +12,7 @@
                 <td>[[ warpModal.warpData.access_token ]]</td>
             </tr>
             <tr>
-                <td>Devide ID</td>
+                <td>Device ID</td>
                 <td>[[ warpModal.warpData.device_id ]]</td>
             </tr>
             <tr class="client-table-odd-row">
@@ -24,19 +24,19 @@
                 <td>[[ warpModal.warpData.private_key ]]</td>
             </tr>
         </table>
-        <a-divider style="margin: 0;">{{ i18n "pages.settings.toasts.modifySettings" }}</a-divider>
+        <a-divider style="margin: 0;">{{ i18n "pages.xray.outbound.settings" }}</a-divider>
         <a-collapse style="margin: 10px 0;">
             <a-collapse-panel header='WARP/WARP+ License Key'>
-                <a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
-                    <a-form-item label="License Key">
+                <a-form :colon="false" :label-col="{ md: {span:6} }" :wrapper-col="{ md: {span:14} }">
+                    <a-form-item label="Key">
                         <a-input v-model="warpPlus"></a-input>
                         <a-button @click="updateLicense(warpPlus)" :disabled="warpPlus.length<26" :loading="warpModal.confirmLoading">{{ i18n "pages.inbounds.update" }}</a-button>
                     </a-form-item>
                 </a-form>
             </a-collapse-panel>
         </a-collapse>
-        <a-divider style="margin: 0;">{{ i18n "pages.settings.toasts.getSettings" }}</a-divider>
-        <a-button icon="sync" @click="getConfig" style="margin-bottom: 10px;" :loading="warpModal.confirmLoading">{{ i18n "info" }}</a-button>
+        <a-divider style="margin: 0;">{{ i18n "pages.xray.outbound.accountInfo" }}</a-divider>
+        <a-button icon="sync" @click="getConfig" style="margin-top: 5px; margin-bottom: 10px;" :loading="warpModal.confirmLoading" type="primary">{{ i18n "info" }}</a-button>
         <template v-if="!ObjectUtil.isEmpty(warpModal.warpConfig)">
             <table style="width: 100%">
                 <tr class="client-table-odd-row">
@@ -48,7 +48,7 @@
                     <td>[[ warpModal.warpConfig.model ]]</td>
                 </tr>
                 <tr class="client-table-odd-row">
-                    <td>Device Active</td>
+                    <td>Device Enabled</td>
                     <td>[[ warpModal.warpConfig.enabled ]]</td>
                 </tr>
             <template v-if="!ObjectUtil.isEmpty(warpModal.warpConfig.account)">
@@ -61,7 +61,7 @@
                     <td>[[ warpModal.warpConfig.account.role ]]</td>
                 </tr>
                 <tr>
-                    <td>Premium Data</td>
+                    <td>WARP+ Data</td>
                     <td>[[ sizeFormat(warpModal.warpConfig.account.premium_data) ]]</td>
                 </tr>
                 <tr class="client-table-odd-row">
@@ -74,16 +74,15 @@
                 </tr>
             </template>
             </table>
-            <a-divider style="margin: 10px 0;">WARP {{ i18n "pages.xray.rules.outbound" }}</a-divider>
+            <a-divider style="margin: 10px 0;">{{ i18n "pages.xray.outbound.outboundStatus" }}</a-divider>
             <a-form :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
-                <a-form-item label='{{ i18n "status" }}'>
                     <template v-if="warpOutboundIndex>=0">
-                        <a-tag color="green">{{ i18n "enabled" }}</a-tag>
-                        <a-button @click="resetOutbound" :loading="warpModal.confirmLoading">{{ i18n "reset" }}</a-button>
+                        <a-tag color="green" style="line-height: 31px;">{{ i18n "enabled" }}</a-tag>
+                        <a-button @click="resetOutbound" :loading="warpModal.confirmLoading" type="danger">{{ i18n "reset" }}</a-button>
                     </template>
                     <template v-else>
-                        <a-tag color="orange">{{ i18n "disabled" }}</a-tag>
-                        <a-button @click="addOutbound" :loading="warpModal.confirmLoading">{{ i18n "pages.xray.outbound.addOutbound" }}</a-button>
+                        <a-tag color="orange" style="line-height: 31px;">{{ i18n "disabled" }}</a-tag>
+                        <a-button @click="addOutbound" :loading="warpModal.confirmLoading" type="primary">{{ i18n "pages.xray.outbound.addOutbound" }}</a-button>
                     </template>
                 </a-form-item>
             </a-form>

+ 4 - 0
web/translation/translate.en_US.toml

@@ -446,6 +446,10 @@
 "bridge" = "Bridge"
 "portal" = "Portal"
 "intercon" = "Interconnection"
+"settings" = "Settings"
+"accountInfo" = "Account Information"
+"outboundStatus" = "Outbound Status"
+"sendThrough" = "Send Through"
 
 [pages.xray.balancer]
 "addBalancer" = "Add Balancer"

+ 4 - 0
web/translation/translate.es_ES.toml

@@ -446,6 +446,10 @@
 "bridge" = "puente"
 "portal" = "portal"
 "intercon" = "Interconexión"
+"settings" = "Configuración"
+"accountInfo" = "Información de la cuenta"
+"outboundStatus" = "Estado de salida"
+"sendThrough" = "Enviar a través de"
 
 [pages.xray.balancer]
 "addBalancer" = "Agregar equilibrador"

+ 4 - 0
web/translation/translate.fa_IR.toml

@@ -446,6 +446,10 @@
 "bridge" = "پل"
 "portal" = "پورتال"
 "intercon" = "اتصال میانی"
+"settings" = "تنظیمات"
+"accountInfo" = "اطلاعات حساب"
+"outboundStatus" = "وضعیت خروجی"
+"sendThrough" = "ارسال با"
 
 [pages.xray.balancer]
 "addBalancer" = "افزودن بالانسر"

+ 4 - 0
web/translation/translate.id_ID.toml

@@ -446,6 +446,10 @@
 "bridge" = "Jembatan"
 "portal" = "Portal"
 "intercon" = "Interkoneksi"
+"settings" = "Pengaturan"
+"accountInfo" = "Informasi Akun"
+"outboundStatus" = "Status Keluar"
+"sendThrough" = "Kirim Melalui"
 
 [pages.xray.balancer]
 "addBalancer" = "Tambahkan Penyeimbang"

+ 4 - 0
web/translation/translate.ru_RU.toml

@@ -446,6 +446,10 @@
 "bridge" = "Мост"
 "portal" = "Портал"
 "intercon" = "Соединение"
+"settings" = "Настройки"
+"accountInfo" = "Информация Об Учетной Записи"
+"outboundStatus" = "Исходящий статус"
+"sendThrough" = "Отправить через"
 
 [pages.xray.balancer]
 "addBalancer" = "Добавить балансир"

+ 4 - 0
web/translation/translate.uk_UA.toml

@@ -446,6 +446,10 @@
 "bridge" = "Міст"
 "portal" = "Портал"
 "intercon" = "Взаємозв'язок"
+"settings" = "Налаштування"
+"accountInfo" = "Інформація про обліковий запис"
+"outboundStatus" = "Статус виходу"
+"sendThrough" = "Надіслати через"
 
 [pages.xray.balancer]
 "addBalancer" = "Додати балансир"

+ 4 - 0
web/translation/translate.vi_VN.toml

@@ -446,6 +446,10 @@
 "bridge" = "Cầu"
 "portal" = "Cổng thông tin"
 "intercon" = "Kết nối"
+"settings" = "cài đặt"
+"accountInfo" = "Thông tin tài khoản"
+"outboundStatus" = "Trạng thái đầu ra"
+"sendThrough" = "Gửi qua"
 
 [pages.xray.balancer]
 "addBalancer" = "Thêm cân bằng"

+ 4 - 0
web/translation/translate.zh_Hans.toml

@@ -446,6 +446,10 @@
 "bridge" = "Bridge"
 "portal" = "Portal"
 "intercon" = "互连"
+"settings" = "设置"
+"accountInfo" = "帐户信息"
+"outboundStatus" = "出站状态"
+"sendThrough" = "发送通过"
 
 [pages.xray.balancer]
 "addBalancer" = "添加负载均衡"