diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 0a3d26b2..f0b7ae27 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -327,6 +327,14 @@ [[ rule.outboundTag ]] + + + + Balancer Tag: [[ rule.balancerTag ]] + + [[ rule.balancerTag ]] + + { balancerModal.loading(); newTemplateSettings = this.templateSettings; - let oldTag = this.balancersData[index].tag; let tmpBalancer = { 'tag': balancer.tag, @@ -1010,7 +1019,7 @@ newTemplateSettings = this.templateSettings; //remove from balancers - let oldTag = this.balancersData[index].tag; + const oldTag = this.balancersData[index].tag; this.balancersData.splice(index, 1); // remove from settings diff --git a/web/html/xui/xray_rule_modal.html b/web/html/xui/xray_rule_modal.html index 9ed9e06a..07cc3217 100644 --- a/web/html/xui/xray_rule_modal.html +++ b/web/html/xui/xray_rule_modal.html @@ -107,6 +107,19 @@ [[ tag ]] + + + + + {{ i18n "pages.xray.balancer.balancerDesc" }} + + Balancer Tag + + + + [[ tag ]] + + @@ -133,11 +146,12 @@ protocol: [], attrs: [], outboundTag: "", + balancerTag: "", }, inboundTags: [], outboundTags: [], users: [], - balancerTag: [], + balancerTags: [], ok() { newRule = ruleModal.getResult(); ObjectUtil.execute(ruleModal.confirm, newRule); @@ -160,6 +174,7 @@ this.rule.protocol = rule.protocol; this.rule.attrs = rule.attrs ? Object.entries(rule.attrs) : []; this.rule.outboundTag = rule.outboundTag; + this.rule.balancerTag = rule.balancerTag ? rule.balancerTag : "" } else { this.rule = { domainMatcher: "", @@ -174,6 +189,7 @@ protocol: [], attrs: [], outboundTag: "", + balancerTag: "", } } this.isEdit = isEdit; @@ -186,6 +202,10 @@ } if(app.templateSettings.reverse.portals) this.outboundTags.push(...app.templateSettings.reverse.portals.map(b => b.tag)); } + + if (app.templateSettings.routing && app.templateSettings.routing.balancers) { + this.balancerTags = app.templateSettings.routing.balancers.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag) + } }, close() { ruleModal.visible = false; @@ -211,6 +231,7 @@ rule.protocol = value.protocol; rule.attrs = Object.fromEntries(value.attrs); rule.outboundTag = value.outboundTag; + rule.balancerTag = value.balancerTag; for (const [key, value] of Object.entries(rule)) { if ( diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 0edf1c3d..f4f9afac 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -407,6 +407,7 @@ "dest" = "Destination" "inbound" = "Inbound" "outbound" = "Outbound" +"balancer" = "Balancer" "info" = "Info" "add" = "Add Rule" "edit" = "Edit Rule" @@ -433,6 +434,7 @@ "balancerStrategy" = "Strategy" "balancerSelectors" = "Selectors" "tag" = "Tag" +"balancerDesc" = "balancerTag and outboundTag must choose one of the two. outboundTag Effective when specified at the same time." [pages.xray.wireguard] "secretKey" = "Secret Key"
Balancer Tag: [[ rule.balancerTag ]]