From 09407710a75fad2da525d3921f7a7277c4680f1b Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Thu, 22 Feb 2024 20:35:19 +0100 Subject: [PATCH] small changes --- sub/subJsonService.go | 6 +----- web/html/xui/xray.html | 2 +- web/html/xui/xray_balancer_modal.html | 13 +++++++------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/sub/subJsonService.go b/sub/subJsonService.go index 14db09e5..92519f3e 100644 --- a/sub/subJsonService.go +++ b/sub/subJsonService.go @@ -117,11 +117,7 @@ func (s *SubJsonService) GetJson(subId string, host string) (string, string, err // Combile outbounds outbounds = append(outbounds, defaultOutbounds...) - var outboundStrings []json_util.RawMessage - for _, outbound := range outbounds { - outboundStrings = append(outboundStrings, outbound) - } - configJson["outbounds"] = outboundStrings + configJson["outbounds"] = outbounds finalJson, _ := json.MarshalIndent(configJson, "", " ") header = fmt.Sprintf("upload=%d; download=%d; total=%d; expire=%d", traffic.Up, traffic.Down, traffic.Total, traffic.ExpiryTime/1000) diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 8959e151..027e2c47 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -445,7 +445,7 @@ {{ i18n "pages.xray.outbound.addReverse" }} - tag != balancer.tag); this.outboundTags = app.templateSettings.outbounds.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag); this.isEdit = isEdit; - this.check() + this.check(); + this.checkSelector(); }, close() { - balancerModal.visible = false; - balancerModal.loading(false); + this.visible = false; + this.loading(false); }, loading(loading=true) { - balancerModal.confirmLoading = loading; + this.confirmLoading = loading; }, check() { - if (balancerModal.balancer.tag == '' || balancerModal.balancerTags.includes(balancerModal.balancer.tag)) { + if (this.balancer.tag == '' || this.balancerTags.includes(this.balancer.tag)) { this.duplicateTag = true; this.isValid = false; } else { @@ -93,7 +94,7 @@ } }, checkSelector() { - balancerModal.emptySelector = balancerModal.balancer.selector.length == 0; + this.emptySelector = this.balancer.selector.length == 0; } };