From 7b38d02ff035fc34699740d14807b4d2b8a36d06 Mon Sep 17 00:00:00 2001
From: MHSanaei <33454419+MHSanaei@users.noreply.github.com>
Date: Mon, 27 Mar 2023 20:11:28 +0330
Subject: new feature - clone inbound
---
web/html/xui/inbounds.html | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
(limited to 'web/html/xui')
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
@@ -95,6 +95,9 @@
{{ i18n "pages.inbounds.resetTraffic" }}
+
+
+ {{ i18n "pages.inbounds.Clone"}}
@@ -310,11 +313,47 @@
break;
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({
--
cgit v1.2.3
From 88744d92b3677b33f0b6265bacb7805aeab856e6 Mon Sep 17 00:00:00 2001
From: MHSanaei <33454419+MHSanaei@users.noreply.github.com>
Date: Mon, 27 Mar 2023 20:12:45 +0330
Subject: new feature - reset traffic all inbound
---
web/html/xui/inbounds.html | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
(limited to 'web/html/xui')
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 9fd663f7..90250869 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -52,6 +52,7 @@
{{ i18n "pages.inbounds.addInbound" }}
{{ i18n "pages.inbounds.export" }}
+
{{ i18n "pages.inbounds.resetAllTraffic" }}
{
+ for (const dbInbound of this.dbInbounds) {
+ const inbound = dbInbound.toInbound();
+ dbInbound.up = 0;
+ dbInbound.down = 0;
+ this.updateInbound(inbound, dbInbound);
+ }
+ },
+ });
},
delInbound(dbInboundId) {
this.$confirm({
--
cgit v1.2.3