From 0c7b59ed47eaa2f786eedd584d9e4192964931f3 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Thu, 28 Aug 2025 10:15:04 +0200 Subject: [PATCH] removed: Allocate --- database/model/model.go | 2 -- web/assets/js/model/inbound.js | 26 -------------------------- web/html/form/allocate.html | 15 --------------- web/html/form/inbound.html | 9 --------- web/html/inbounds.html | 3 --- web/service/inbound.go | 2 -- xray/inbound.go | 4 ---- 7 files changed, 61 deletions(-) delete mode 100644 web/html/form/allocate.html diff --git a/database/model/model.go b/database/model/model.go index 62cfac41..18211ef8 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -46,7 +46,6 @@ type Inbound struct { StreamSettings string `json:"streamSettings" form:"streamSettings"` Tag string `json:"tag" form:"tag" gorm:"unique"` Sniffing string `json:"sniffing" form:"sniffing"` - Allocate string `json:"allocate" form:"allocate"` } type OutboundTraffics struct { @@ -81,7 +80,6 @@ func (i *Inbound) GenXrayInboundConfig() *xray.InboundConfig { StreamSettings: json_util.RawMessage(i.StreamSettings), Tag: i.Tag, Sniffing: json_util.RawMessage(i.Sniffing), - Allocate: json_util.RawMessage(i.Allocate), } } diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 33aa24e0..c91dbd11 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -1042,27 +1042,6 @@ class Sniffing extends XrayCommonClass { } } -class Allocate extends XrayCommonClass { - constructor( - strategy = "always", - refresh = 5, - concurrency = 3, - ) { - super(); - this.strategy = strategy; - this.refresh = refresh; - this.concurrency = concurrency; - } - - static fromJson(json = {}) { - return new Allocate( - json.strategy, - json.refresh, - json.concurrency, - ); - } -} - class Inbound extends XrayCommonClass { constructor( port = RandomUtil.randomInteger(10000, 60000), @@ -1072,7 +1051,6 @@ class Inbound extends XrayCommonClass { streamSettings = new StreamSettings(), tag = '', sniffing = new Sniffing(), - allocate = new Allocate(), clientStats = '', ) { super(); @@ -1083,7 +1061,6 @@ class Inbound extends XrayCommonClass { this.stream = streamSettings; this.tag = tag; this.sniffing = sniffing; - this.allocate = allocate; this.clientStats = clientStats; } getClientStats() { @@ -1248,7 +1225,6 @@ class Inbound extends XrayCommonClass { this.stream = new StreamSettings(); this.tag = ''; this.sniffing = new Sniffing(); - this.allocate = new Allocate(); } genVmessLink(address = '', port = this.port, forceTls, remark = '', clientId, security) { @@ -1703,7 +1679,6 @@ class Inbound extends XrayCommonClass { StreamSettings.fromJson(json.streamSettings), json.tag, Sniffing.fromJson(json.sniffing), - Allocate.fromJson(json.allocate), json.clientStats ) } @@ -1721,7 +1696,6 @@ class Inbound extends XrayCommonClass { streamSettings: streamSettings, tag: this.tag, sniffing: this.sniffing.toJson(), - allocate: this.allocate.toJson(), clientStats: this.clientStats }; } diff --git a/web/html/form/allocate.html b/web/html/form/allocate.html deleted file mode 100644 index aba8d5c9..00000000 --- a/web/html/form/allocate.html +++ /dev/null @@ -1,15 +0,0 @@ -{{define "form/allocate"}} - - - - [[ s ]] - - - - - - - - - -{{end}} diff --git a/web/html/form/inbound.html b/web/html/form/inbound.html index 021a51c7..9554d6aa 100644 --- a/web/html/form/inbound.html +++ b/web/html/form/inbound.html @@ -121,13 +121,4 @@ - - - {{end}} diff --git a/web/html/inbounds.html b/web/html/inbounds.html index 142a167c..b0d9828f 100644 --- a/web/html/inbounds.html +++ b/web/html/inbounds.html @@ -1093,7 +1093,6 @@ settings: Inbound.Settings.getSettings(baseInbound.protocol).toString(), streamSettings: baseInbound.stream.toString(), sniffing: baseInbound.sniffing.toString(), - allocate: baseInbound.allocate.toString(), }; await this.submit('/panel/inbound/add', data, inModal); }, @@ -1143,7 +1142,6 @@ data.streamSettings = JSON.stringify({ sockopt: inbound.stream.sockopt.toJson() }, null, 2); } data.sniffing = inbound.sniffing.toString(); - data.allocate = inbound.allocate.toString(); await this.submit('/panel/inbound/add', data, inModal); }, @@ -1167,7 +1165,6 @@ data.streamSettings = JSON.stringify({ sockopt: inbound.stream.sockopt.toJson() }, null, 2); } data.sniffing = inbound.sniffing.toString(); - data.allocate = inbound.allocate.toString(); await this.submit(`/panel/inbound/update/${dbInbound.id}`, data, inModal); }, diff --git a/web/service/inbound.go b/web/service/inbound.go index 78abef73..0621cdea 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -403,7 +403,6 @@ func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound, oldInbound.Settings = inbound.Settings oldInbound.StreamSettings = inbound.StreamSettings oldInbound.Sniffing = inbound.Sniffing - oldInbound.Allocate = inbound.Allocate if inbound.Listen == "" || inbound.Listen == "0.0.0.0" || inbound.Listen == "::" || inbound.Listen == "::0" { oldInbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port) } else { @@ -2037,7 +2036,6 @@ func (s *InboundService) MigrationRequirements() { tx.Rollback() } }() - // Calculate and backfill all_time from up+down for inbounds and clients err = tx.Exec(` diff --git a/xray/inbound.go b/xray/inbound.go index c74b07ba..ea11449d 100644 --- a/xray/inbound.go +++ b/xray/inbound.go @@ -14,7 +14,6 @@ type InboundConfig struct { StreamSettings json_util.RawMessage `json:"streamSettings"` Tag string `json:"tag"` Sniffing json_util.RawMessage `json:"sniffing"` - Allocate json_util.RawMessage `json:"allocate"` } func (c *InboundConfig) Equals(other *InboundConfig) bool { @@ -39,8 +38,5 @@ func (c *InboundConfig) Equals(other *InboundConfig) bool { if !bytes.Equal(c.Sniffing, other.Sniffing) { return false } - if !bytes.Equal(c.Allocate, other.Allocate) { - return false - } return true }