diff --git a/web/html/modals/inbound_info_modal.html b/web/html/modals/inbound_info_modal.html
index 37f8248a..4fee720e 100644
--- a/web/html/modals/inbound_info_modal.html
+++ b/web/html/modals/inbound_info_modal.html
@@ -650,7 +650,9 @@
this.dbInbound = new DBInbound(dbInbound);
this.clientSettings = this.inbound.clients ? this.inbound.clients[index] : null;
this.isExpired = this.inbound.clients ? this.inbound.isExpiry(index) : this.dbInbound.isExpiry;
- this.clientStats = this.inbound.clients ? (this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) || null) : null;
+ this.clientStats = (this.inbound.clients && this.clientSettings)
+ ? (this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) || null)
+ : null;
if (
[
@@ -774,10 +776,13 @@
return ColorUtils.usageColor(stats.up + stats.down, app.trafficDiff, stats.total);
},
getRemStats() {
- remained = this.infoModal.clientStats.total - this.infoModal.clientStats.up - this.infoModal.clientStats.down;
+ const remained = this.infoModal.clientStats.total - this.infoModal.clientStats.up - this.infoModal.clientStats.down;
return remained > 0 ? SizeFormatter.sizeFormat(remained) : '-';
},
refreshIPs() {
+ if (!this.infoModal.clientStats) {
+ return;
+ }
this.refreshing = true;
refreshIPs(this.infoModal.clientStats.email)
.then((result) => {
@@ -789,6 +794,9 @@
});
},
clearClientIps() {
+ if (!this.infoModal.clientStats) {
+ return;
+ }
HttpUtil.post(`/panel/api/inbounds/clearClientIps/${this.infoModal.clientStats.email}`)
.then((msg) => {
if (!msg.success) {
diff --git a/web/html/modals/xray_reverse_modal.html b/web/html/modals/xray_reverse_modal.html
index 22f04317..588b305b 100644
--- a/web/html/modals/xray_reverse_modal.html
+++ b/web/html/modals/xray_reverse_modal.html
@@ -84,10 +84,9 @@
type: reverse.type,
domain: reverse.domain,
};
- reverse;
- rules0 = rules.filter(r => r.domain != null);
+ let rules0 = rules.filter(r => r.domain != null);
if(rules0.length == 0) rules0 = [{ outboundTag: '', domain: ["full:" + this.reverse.domain], inboundTag: []}];
- rules1 = rules.filter(r => r.domain == null);
+ let rules1 = rules.filter(r => r.domain == null);
if(rules1.length == 0) rules1 = [{ outboundTag: '', inboundTag: []}];
this.rules = [];
this.rules.push({
diff --git a/web/html/modals/xray_rule_modal.html b/web/html/modals/xray_rule_modal.html
index e6a8bf46..7c1c7725 100644
--- a/web/html/modals/xray_rule_modal.html
+++ b/web/html/modals/xray_rule_modal.html
@@ -147,7 +147,7 @@
users: [],
balancerTags: [],
ok() {
- newRule = ruleModal.getResult();
+ const newRule = ruleModal.getResult();
ObjectUtil.execute(ruleModal.confirm, newRule);
},
show({
@@ -215,9 +215,9 @@
ruleModal.confirmLoading = loading;
},
getResult() {
- value = ruleModal.rule;
- rule = {};
- newRule = {};
+ const value = ruleModal.rule;
+ const rule = {};
+ const newRule = {};
rule.type = "field";
rule.domain = value.domain.length > 0 ? value.domain.split(',').map(s => s.trim()) : [];
rule.ip = value.ip.length > 0 ? value.ip.split(',').map(s => s.trim()) : [];