diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 768c8106..5e64ae87 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -700,7 +700,8 @@ } outModal.close(); }, - isEdit: false + isEdit: false, + tags: this.templateSettings.outbounds.map(obj => obj.tag) }); }, editOutbound(index){ @@ -713,7 +714,8 @@ this.outboundSettings = JSON.stringify(this.templateSettings.outbounds); outModal.close(); }, - isEdit: true + isEdit: true, + tags: this.outboundData.filter((o) => o.key != index ).map(obj => obj.tag) }); }, deleteOutbound(index){ diff --git a/web/html/xui/xray_outbound_modal.html b/web/html/xui/xray_outbound_modal.html index c8be04c4..2941e096 100644 --- a/web/html/xui/xray_outbound_modal.html +++ b/web/html/xui/xray_outbound_modal.html @@ -21,10 +21,11 @@ duplicateTag: false, isValid: true, activeKey: '1', + tags: [], ok() { ObjectUtil.execute(outModal.confirm, outModal.outbound.toJson()); }, - show({ title='', okText='{{ i18n "sure" }}', outbound, confirm=(outbound)=>{}, isEdit=false }) { + show({ title='', okText='{{ i18n "sure" }}', outbound, confirm=(outbound)=>{}, isEdit=false, tags=[] }) { this.title = title; this.okText = okText; this.confirm = confirm; @@ -34,6 +35,7 @@ this.visible = true; this.outbound = isEdit ? Outbound.fromJson(outbound) : new Outbound(); this.isEdit = isEdit; + this.tags = tags; this.check() }, close() { @@ -44,7 +46,7 @@ outModal.confirmLoading = loading; }, check(){ - if(outModal.outbound.tag == ''){ + if(outModal.outbound.tag == '' || outModal.tags.includes(outModal.outbound.tag)){ this.duplicateTag = true; this.isValid = false; } else { diff --git a/web/html/xui/xray_reverse_modal.html b/web/html/xui/xray_reverse_modal.html index 7b1aaed1..94193b47 100644 --- a/web/html/xui/xray_reverse_modal.html +++ b/web/html/xui/xray_reverse_modal.html @@ -148,9 +148,9 @@ ] } this.isEdit = isEdit; - this.inboundTags = app.templateSettings.inbounds.map(obj => obj.tag); + this.inboundTags = app.templateSettings.inbounds.filter((i) => !ObjectUtil.isEmpty(i.tag)).map(obj => obj.tag); this.inboundTags.push(...app.inboundTags); - this.outboundTags = app.templateSettings.outbounds.map(obj => obj.tag); + this.outboundTags = app.templateSettings.outbounds.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag); }, close() { reverseModal.visible = false; diff --git a/web/html/xui/xray_rule_modal.html b/web/html/xui/xray_rule_modal.html index ebc17f98..63267055 100644 --- a/web/html/xui/xray_rule_modal.html +++ b/web/html/xui/xray_rule_modal.html @@ -214,9 +214,9 @@ } } this.isEdit = isEdit; - this.inboundTags = app.templateSettings.inbounds.map(obj => obj.tag); + this.inboundTags = app.templateSettings.inbounds.filter((i) => !ObjectUtil.isEmpty(i.tag)).map(obj => obj.tag); this.inboundTags.push(...app.inboundTags); - this.outboundTags = app.templateSettings.outbounds.map(obj => obj.tag); + this.outboundTags = app.templateSettings.outbounds.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj => obj.tag); if(app.templateSettings.reverse){ if(app.templateSettings.reverse.bridges) { this.inboundTags.push(...app.templateSettings.reverse.bridges.map(b => b.tag)); diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 0d9b4afe..68c5c55d 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -374,6 +374,7 @@ "editOutbound" = "Edit outbound" "editReverse" = "Edit reverse" "tag" = "Tag" +"tagDesc" = "Unique tag" "address" = "Address" "reverse" = "Reverse" "domain" = "Domain" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index ef996c16..56214c7f 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -373,6 +373,7 @@ "editOutbound" = "ویرایش خروجی" "editReverse" = "ویرایش معکوس" "tag" = "برچسب" +"tagDesc" = "برچسب یگانه" "address" = "آدرس" "reverse" = "معکوس" "domain" = "دامنه" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 7a5bcab7..4d509b08 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -374,6 +374,7 @@ "editOutbound" = "Изменить исходящий" "editReverse" = "Редактировать реверс" "tag" = "Тег" +"tagDesc" = "уникальный тег" "address" = "Адрес" "reverse" = "Обратный" "domain" = "Домен" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index fad81011..d6004311 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -374,6 +374,7 @@ "editOutbound" = "Chỉnh sửa đầu vào" "editReverse" = "Chỉnh sửa đảo ngược" "tag" = "Nhãn" +"tagDesc" = "thẻ duy nhất" "address" = "Địa chỉ" "reverse" = "Đảo ngược" "domain" = "Tên Miền" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index 0382f410..6548be50 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -374,6 +374,7 @@ "editOutbound" = "编辑出站" "editReverse" = "编辑反向" "tag" = "标签" +"tagDesc" = "独特的标签" "address" = "地址" "rreverse" = "反转" "domain" = "域名"