mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
small fixes
This commit is contained in:
@@ -401,11 +401,6 @@ func (s *SubService) genVlessLink(inbound *model.Inbound, email string) string {
|
||||
params["spx"] = spx
|
||||
}
|
||||
}
|
||||
if serverName, ok := searchKey(realitySettings, "serverName"); ok {
|
||||
if sname, ok := serverName.(string); ok && len(sname) > 0 {
|
||||
address = sname
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if streamNetwork == "tcp" && len(clients[clientIndex].Flow) > 0 {
|
||||
@@ -583,11 +578,6 @@ func (s *SubService) genTrojanLink(inbound *model.Inbound, email string) string
|
||||
params["spx"] = spx
|
||||
}
|
||||
}
|
||||
if serverName, ok := searchKey(realitySettings, "serverName"); ok {
|
||||
if sname, ok := serverName.(string); ok && len(sname) > 0 {
|
||||
address = sname
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1563,7 +1563,7 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
|
||||
fallbacks=[],) {
|
||||
super(protocol);
|
||||
this.vlesses = vlesses;
|
||||
this.decryption = 'none'; // Using decryption is not implemented here
|
||||
this.decryption = decryption;
|
||||
this.fallbacks = fallbacks;
|
||||
}
|
||||
|
||||
@@ -1695,11 +1695,11 @@ Inbound.TrojanSettings = class extends Inbound.Settings {
|
||||
this.fallbacks = fallbacks;
|
||||
}
|
||||
|
||||
addTrojanFallback() {
|
||||
addFallback() {
|
||||
this.fallbacks.push(new Inbound.TrojanSettings.Fallback());
|
||||
}
|
||||
|
||||
delTrojanFallback(index) {
|
||||
delFallback(index) {
|
||||
this.fallbacks.splice(index, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,35 +113,35 @@ function usageColor(data, threshold, total) {
|
||||
function clientUsageColor(clientStats, trafficDiff) {
|
||||
switch (true) {
|
||||
case !clientStats || clientStats.total == 0:
|
||||
return "#7a316f";
|
||||
return "#7a316f"; // Purple
|
||||
case clientStats.up + clientStats.down < clientStats.total - trafficDiff:
|
||||
return "#0e49b5";
|
||||
return "#0e49b5"; // Blue
|
||||
case clientStats.up + clientStats.down < clientStats.total:
|
||||
return "#ffa031";
|
||||
return "#f37b24"; // Orange
|
||||
default:
|
||||
return "#e04141";
|
||||
return "#e04141"; // red
|
||||
}
|
||||
}
|
||||
|
||||
function userExpiryColor(threshold, client, isDark = false) {
|
||||
if (!client.enable) {
|
||||
return isDark ? '#2c3950' : '#bcbcbc';
|
||||
return isDark ? '#2c3950' : '#bcbcbc'; // Gray
|
||||
}
|
||||
now = new Date().getTime(),
|
||||
expiry = client.expiryTime;
|
||||
switch (true) {
|
||||
case expiry === null:
|
||||
return "#389e0d";
|
||||
return "#7a316f"; // Purple
|
||||
case expiry < 0:
|
||||
return "#0e49b5";
|
||||
return "#0e49b5"; // Blue
|
||||
case expiry == 0:
|
||||
return "#7a316f";
|
||||
return "#7a316f"; // Purple
|
||||
case now < expiry - threshold:
|
||||
return "#0e49b5";
|
||||
return "#0e49b5"; // Blue
|
||||
case now < expiry:
|
||||
return "#f37b24";
|
||||
return "#f37b24"; // Orange
|
||||
default:
|
||||
return "#e04141";
|
||||
return "#e04141"; // red
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<a-form-item label="Fallbacks">
|
||||
<a-row>
|
||||
<a-button type="primary" size="small"
|
||||
@click="inbound.settings.addTrojanFallback()">
|
||||
@click="inbound.settings.addFallback()">
|
||||
+
|
||||
</a-button>
|
||||
</a-row>
|
||||
@@ -35,24 +35,51 @@
|
||||
<a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline">
|
||||
<a-divider style="margin:0;">
|
||||
fallback[[ index + 1 ]]
|
||||
<a-icon type="delete" @click="() => inbound.settings.delTrojanFallback(index)"
|
||||
<a-icon type="delete" @click="() => inbound.settings.delFallback(index)"
|
||||
style="color: rgb(255, 77, 79);cursor: pointer;"/>
|
||||
</a-divider>
|
||||
<a-form-item label="name">
|
||||
<a-input v-model="fallback.name"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="alpn">
|
||||
<a-input v-model="fallback.alpn"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="path">
|
||||
<a-input v-model="fallback.path"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="dest">
|
||||
<a-input v-model="fallback.dest"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="xver">
|
||||
<a-input-number v-model.number="fallback.xver"></a-input-number>
|
||||
</a-form-item>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="width: 20%;">Name</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.name" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpn</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.alpn" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Path</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.path" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dest</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.dest" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>xVer</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input-number v-model="fallback.xver" :min="0" :max="2"></a-input-number>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a-form>
|
||||
<a-divider style="margin:0;"></a-divider>
|
||||
</template>
|
||||
|
||||
@@ -40,21 +40,48 @@
|
||||
<a-icon type="delete" @click="() => inbound.settings.delFallback(index)"
|
||||
style="color: rgb(255, 77, 79);cursor: pointer;"/>
|
||||
</a-divider>
|
||||
<a-form-item label="name">
|
||||
<a-input v-model="fallback.name"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="alpn">
|
||||
<a-input v-model="fallback.alpn"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="path">
|
||||
<a-input v-model="fallback.path"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="dest">
|
||||
<a-input v-model="fallback.dest"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="xver">
|
||||
<a-input-number v-model.number="fallback.xver"></a-input-number>
|
||||
</a-form-item>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="width: 20%;">Name</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.name" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpn</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.alpn" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Path</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.path" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dest</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input v-model="fallback.dest" style="width: 250px"></a-input>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>xVer</td>
|
||||
<td>
|
||||
<a-form-item>
|
||||
<a-input-number v-model="fallback.xver" :min="0" :max="2"></a-input-number>
|
||||
</a-form-item>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a-form>
|
||||
<a-divider style="margin:0;"></a-divider>
|
||||
</template>
|
||||
|
||||
@@ -438,7 +438,7 @@
|
||||
formatLogs(logs) {
|
||||
let formattedLogs = '';
|
||||
const levels = ["DEBUG","INFO","WARNING","ERROR"];
|
||||
const levelColors = ["#3c89e8","#0e49b5","#f37b24","#e04141","#bcbcbc"];
|
||||
const levelColors = ["#3c89e8","#008771","#f37b24","#e04141","#bcbcbc"];
|
||||
|
||||
logs.forEach((log, index) => {
|
||||
let [data, message] = log.split(" - ",2);
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<a-alert type="warning" style="text-align: center;">
|
||||
<template slot="message">
|
||||
<a-icon type="exclamation-circle" theme="filled" style="color: #FFA031"></a-icon>
|
||||
{{ i18n "pages.xray.generalConfigsDesc" }}
|
||||
{{ i18n "pages.xray.blockConfigsDesc" }}
|
||||
</template>
|
||||
</a-alert>
|
||||
</a-row>
|
||||
|
||||
Reference in New Issue
Block a user