Browse Source

removed: Allocate

mhsanaei 3 days ago
parent
commit
0c7b59ed47

+ 0 - 2
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),
 	}
 }
 

+ 0 - 26
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
         };
     }

+ 0 - 15
web/html/form/allocate.html

@@ -1,15 +0,0 @@
-{{define "form/allocate"}}
-<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
-    <a-form-item label='Strategy'>
-      <a-select v-model="inbound.allocate.strategy" :dropdown-class-name="themeSwitcher.currentTheme">
-        <a-select-option v-for="s in ['always','random']" :value="s">[[ s ]]</a-select-option>
-      </a-select>
-    </a-form-item>
-    <a-form-item label='Refresh'>
-      <a-input-number v-model.number="inbound.allocate.refresh" min="0"></a-input-number>
-    </a-form-item>
-    <a-form-item label='Concurrency'>
-      <a-input-number v-model.number="inbound.allocate.concurrency" min="0"></a-input-number>
-    </a-form-item>
-</a-form>
-{{end}}

+ 0 - 9
web/html/form/inbound.html

@@ -121,13 +121,4 @@
     </a-collapse-panel>
 </a-collapse>
 
-<!-- allocate -->
-<!-- Temporarily disabled until we accepts range for port allocation
-<a-collapse>
-    <a-collapse-panel header='Allocate'>
-        {{template "form/allocate"}}
-    </a-collapse-panel>
-</a-collapse>
--->
-
 {{end}}

+ 0 - 3
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);
             },

+ 0 - 2
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(`

+ 0 - 4
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
 }