diff options
| author | Saeid <43953720+surbiks@users.noreply.github.com> | 2024-02-06 11:10:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-06 11:10:49 +0300 |
| commit | c53cee31f5a64ed3292f977bf5a0749324eb78a2 (patch) | |
| tree | 8a900083690e0767ee7fc2371f8203938d6e3a00 /web/html/xui/xray_rule_modal.html | |
| parent | 222b9734caba389604fd81caa068e815bdb16dcb (diff) | |
Manage balancers in settings UI (#1759)
* add balancer config to ui
* manage balancer in rules table
* fix balancer translations
* fix edit button text
Diffstat (limited to 'web/html/xui/xray_rule_modal.html')
| -rw-r--r-- | web/html/xui/xray_rule_modal.html | 23 |
1 files changed, 22 insertions, 1 deletions
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 @@ <a-select-option v-for="tag in ruleModal.outboundTags" :value="tag">[[ tag ]]</a-select-option> </a-select> </a-form-item> + <a-form-item> + <template slot="label"> + <a-tooltip> + <template slot="title"> + <span>{{ i18n "pages.xray.balancer.balancerDesc" }}</span> + </template> + Balancer Tag <a-icon type="question-circle"></a-icon> + </a-tooltip> + </template> + <a-select v-model="ruleModal.rule.balancerTag" :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option v-for="tag in ruleModal.balancerTags" :value="tag">[[ tag ]]</a-select-option> + </a-select> + </a-form-item> </table> </a-form> </a-modal> @@ -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 ( |
