Skip to content

Commit

Permalink
[xray] add outbound sendThrough + warp typo fix
Browse files Browse the repository at this point in the history
Co-Authored-By: Alireza Ahmadi <[email protected]>
  • Loading branch information
MHSanaei and alireza0 committed Mar 12, 2024
1 parent b21758e commit 10f54cd
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 14 deletions.
4 changes: 4 additions & 0 deletions web/assets/js/model/outbound.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,15 @@ class Outbound extends CommonClass {
protocol=Protocols.VMess,
settings=null,
streamSettings = new StreamSettings(),
sendThrough,
mux = new Mux(),
) {
super();
this.tag = tag;
this._protocol = protocol;
this.settings = settings == null ? Outbound.Settings.getSettings(protocol) : settings;
this.stream = streamSettings;
this.sendThrough = sendThrough;
this.mux = mux;
}

Expand Down Expand Up @@ -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),
)
}
Expand All @@ -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,
};
}
Expand Down
3 changes: 3 additions & 0 deletions web/html/xui/form/outbound.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
27 changes: 13 additions & 14 deletions web/html/xui/warp_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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">
Expand All @@ -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)">
Expand All @@ -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">
Expand All @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.en_US.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.es_ES.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.fa_IR.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@
"bridge" = "پل"
"portal" = "پورتال"
"intercon" = "اتصال میانی"
"settings" = "تنظیمات"
"accountInfo" = "اطلاعات حساب"
"outboundStatus" = "وضعیت خروجی"
"sendThrough" = "ارسال با"

[pages.xray.balancer]
"addBalancer" = "افزودن بالانسر"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.id_ID.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.ru_RU.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@
"bridge" = "Мост"
"portal" = "Портал"
"intercon" = "Соединение"
"settings" = "Настройки"
"accountInfo" = "Информация Об Учетной Записи"
"outboundStatus" = "Исходящий статус"
"sendThrough" = "Отправить через"

[pages.xray.balancer]
"addBalancer" = "Добавить балансир"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.uk_UA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@
"bridge" = "Міст"
"portal" = "Портал"
"intercon" = "Взаємозв'язок"
"settings" = "Налаштування"
"accountInfo" = "Інформація про обліковий запис"
"outboundStatus" = "Статус виходу"
"sendThrough" = "Надіслати через"

[pages.xray.balancer]
"addBalancer" = "Додати балансир"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.vi_VN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions web/translation/translate.zh_Hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@
"bridge" = "Bridge"
"portal" = "Portal"
"intercon" = "互连"
"settings" = "设置"
"accountInfo" = "帐户信息"
"outboundStatus" = "出站状态"
"sendThrough" = "发送通过"

[pages.xray.balancer]
"addBalancer" = "添加负载均衡"
Expand Down

0 comments on commit 10f54cd

Please sign in to comment.