mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-11 12:46:19 +00:00
fix TypeError: this.shortIds.split is not a function
This commit is contained in:
parent
f0165c1ad8
commit
0af630a481
3 changed files with 8 additions and 4 deletions
|
@ -914,18 +914,20 @@ class RealityStreamSettings extends XrayCommonClass {
|
||||||
minClient = '',
|
minClient = '',
|
||||||
maxClient = '',
|
maxClient = '',
|
||||||
maxTimediff = 0,
|
maxTimediff = 0,
|
||||||
shortIds = RandomUtil.randomShortId(),
|
shortIds = RandomUtil.randomShortIds(),
|
||||||
settings = new RealityStreamSettings.Settings()
|
settings = new RealityStreamSettings.Settings()
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.show = show;
|
this.show = show;
|
||||||
this.xver = xver;
|
this.xver = xver;
|
||||||
this.dest = dest;
|
this.dest = dest;
|
||||||
|
/** @type {string} */
|
||||||
this.serverNames = Array.isArray(serverNames) ? serverNames.join(",") : serverNames;
|
this.serverNames = Array.isArray(serverNames) ? serverNames.join(",") : serverNames;
|
||||||
this.privateKey = privateKey;
|
this.privateKey = privateKey;
|
||||||
this.minClient = minClient;
|
this.minClient = minClient;
|
||||||
this.maxClient = maxClient;
|
this.maxClient = maxClient;
|
||||||
this.maxTimediff = maxTimediff;
|
this.maxTimediff = maxTimediff;
|
||||||
|
/** @type {string} */
|
||||||
this.shortIds = Array.isArray(shortIds) ? shortIds.join(",") : shortIds;
|
this.shortIds = Array.isArray(shortIds) ? shortIds.join(",") : shortIds;
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,13 +99,15 @@ class RandomUtil {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static randomShortId() {
|
/** @return {string} */
|
||||||
|
static randomShortIds() {
|
||||||
const lengths = [2, 4, 6, 8, 10, 12, 14, 16];
|
const lengths = [2, 4, 6, 8, 10, 12, 14, 16];
|
||||||
for (let i = lengths.length - 1; i > 0; i--) {
|
for (let i = lengths.length - 1; i > 0; i--) {
|
||||||
const j = Math.floor(Math.random() * (i + 1));
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
[lengths[i], lengths[j]] = [lengths[j], lengths[i]];
|
[lengths[i], lengths[j]] = [lengths[j], lengths[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @type {string[]} */
|
||||||
let shortIds = [];
|
let shortIds = [];
|
||||||
for (let length of lengths) {
|
for (let length of lengths) {
|
||||||
let shortId = '';
|
let shortId = '';
|
||||||
|
@ -114,7 +116,7 @@ class RandomUtil {
|
||||||
}
|
}
|
||||||
shortIds.push(shortId);
|
shortIds.push(shortId);
|
||||||
}
|
}
|
||||||
return shortIds;
|
return shortIds.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
static randomLowerAndNum(len) {
|
static randomLowerAndNum(len) {
|
||||||
|
|
|
@ -189,7 +189,7 @@
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<span>{{ i18n "reset" }}</span>
|
<span>{{ i18n "reset" }}</span>
|
||||||
</template> Short ID <a-icon @click="inbound.stream.reality.shortIds = RandomUtil.randomShortId()" type="sync"></a-icon>
|
</template> Short IDs <a-icon @click="inbound.stream.reality.shortIds = RandomUtil.randomShortIds()" type="sync"></a-icon>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<a-input v-model.trim="inbound.stream.reality.shortIds"></a-input>
|
<a-input v-model.trim="inbound.stream.reality.shortIds"></a-input>
|
||||||
|
|
Loading…
Reference in a new issue