diff options
| author | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-03-27 19:41:28 +0300 |
|---|---|---|
| committer | MHSanaei <33454419+MHSanaei@users.noreply.github.com> | 2023-03-27 19:41:28 +0300 |
| commit | 7b38d02ff035fc34699740d14807b4d2b8a36d06 (patch) | |
| tree | b5a1963c21865a6db93d35ec7a00b81da36c5723 /web | |
| parent | 606360ae03f6796aaa269a3f9871e1f18ae88242 (diff) | |
new feature - clone inbound
Diffstat (limited to 'web')
| -rw-r--r-- | web/html/xui/inbounds.html | 39 | ||||
| -rw-r--r-- | web/translation/translate.en_US.toml | 4 | ||||
| -rw-r--r-- | web/translation/translate.fa_IR.toml | 5 | ||||
| -rw-r--r-- | web/translation/translate.zh_Hans.toml | 4 |
4 files changed, 52 insertions, 0 deletions
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index f7b9e2ed..9fd663f7 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -96,6 +96,9 @@ <a-menu-item key="resetTraffic"> <a-icon type="retweet"></a-icon> {{ i18n "pages.inbounds.resetTraffic" }} </a-menu-item> + <a-menu-item key="clone"> + <a-icon type="block"></a-icon> {{ i18n "pages.inbounds.Clone"}} + </a-menu-item> <a-menu-item key="delete"> <span style="color: #FF4D4F"> <a-icon type="delete"></a-icon> {{ i18n "delete"}} @@ -311,11 +314,47 @@ case "resetTraffic": this.resetTraffic(dbInbound.id); break; + case "clone": + this.openCloneInbound(dbInbound); + break; case "delete": this.delInbound(dbInbound.id); break; } }, + openCloneInbound(dbInbound) { + this.$confirm({ + title: '{{ i18n "pages.inbounds.cloneInbound"}} ' + dbInbound.remark, + content: '{{ i18n "pages.inbounds.cloneInboundContent"}}', + okText: '{{ i18n "pages.inbounds.cloneInboundOk"}}', + cancelText: '{{ i18n "cancel" }}', + onOk: () => { + const baseInbound = dbInbound.toInbound(); + dbInbound.up = 0; + dbInbound.down = 0; + this.cloneInbound(baseInbound, dbInbound); + }, + }); + }, + async cloneInbound(baseInbound, dbInbound) { + const inbound = new Inbound(); + const data = { + up: dbInbound.up, + down: dbInbound.down, + total: dbInbound.total, + remark: dbInbound.remark + " - Cloned", + enable: dbInbound.enable, + expiryTime: dbInbound.expiryTime, + + listen: inbound.listen, + port: inbound.port, + protocol: baseInbound.protocol, + settings: inbound.settings.toString(), + streamSettings: baseInbound.stream.toString(), + sniffing: baseInbound.canSniffing() ? baseInbound.sniffing.toString() : '{}', + }; + await this.submit('/xui/inbound/add', data, inModal); + }, openAddInbound() { inModal.show({ title: '{{ i18n "pages.inbounds.addInbound"}}', diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 836e4692..d8a46d5d 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -129,6 +129,10 @@ "clickOnQRcode" = "Click on QR Code to Copy" "client" = "Client" "export" = "Export links" +"Clone" = "Clone" +"cloneInbound" = "Create" +"cloneInboundContent" = "All items of this inbound except Port, Listening IP, Clients will be applied to the clone" +"cloneInboundOk" = "Creating a clone from" [pages.client] "add" = "Add client" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 0fcab166..157d9cf7 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -129,6 +129,11 @@ "clickOnQRcode" = "برای کپی بر روی کد تصویری کلیک کنید" "client" = "کاربر" "export" = "استخراج لینکها" +"Clone" = "کلون" +"cloneInbound" = "ایجاد" +"cloneInboundContent" = "همه موارد این ورودی بجز پورت ، ای پی و کلاینت ها روی کلون اعمال خواهند شد" +"cloneInboundOk" = "ساختن یک کلون از" + [pages.client] "add" = "کاربر جدید" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index 18c1e322..cbffba0f 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -129,6 +129,10 @@ "clickOnQRcode" = "点击二维码复制" "client" = "客户" "export" = "导出链接" +"Clone" = "克隆" +"cloneInbound" = "创造" +"cloneInboundContent" = "此入站的所有项目除 Port、Listening IP、Clients 将应用于克隆" +"cloneInboundOk" = "从创建克隆" [pages.client] "add" = "添加客户端" |
