From aced4c41d083f53189857c13ef78550deca077c1 Mon Sep 17 00:00:00 2001
From: quydang <81231812+quydang04@users.noreply.github.com>
Date: Wed, 30 Aug 2023 07:32:19 +0700
Subject: [PATCH] Add files via upload
---
web/assets/js/langs.js | 5 -----
web/assets/js/model/xray.js | 5 ++---
web/html/xui/form/sniffing.html | 2 +-
web/html/xui/inbounds.html | 14 +++++---------
web/html/xui/index.html | 9 ++++-----
web/translation/translate.vi_VN.toml | 21 +++++++++------------
6 files changed, 21 insertions(+), 35 deletions(-)
diff --git a/web/assets/js/langs.js b/web/assets/js/langs.js
index 9038fc54..fcaf19a4 100644
--- a/web/assets/js/langs.js
+++ b/web/assets/js/langs.js
@@ -9,11 +9,6 @@ const supportLangs = [
value: 'fa-IR',
icon: '🇮🇷',
},
- {
- name: '汉语',
- value: 'zh-Hans',
- icon: '🇨🇳',
- },
{
name: 'Русский',
value: 'ru-RU',
diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js
index f7e13be2..2b337c9f 100644
--- a/web/assets/js/model/xray.js
+++ b/web/assets/js/model/xray.js
@@ -421,6 +421,7 @@ class HttpStreamSettings extends XrayCommonClass {
}
}
+
class QuicStreamSettings extends XrayCommonClass {
constructor(security=VmessMethods.NONE,
key=RandomUtil.randomSeq(10), type='none') {
@@ -482,7 +483,7 @@ class TlsStreamSettings extends XrayCommonClass {
cipherSuites = '',
rejectUnknownSni = false,
certificates=[new TlsStreamSettings.Cert()],
- alpn=[ALPN_OPTION.HTTP1,ALPN_OPTION.H2],
+ alpn=[ALPN_OPTION.H2,ALPN_OPTION.HTTP1],
settings=new TlsStreamSettings.Settings()) {
super();
this.server = serverName;
@@ -815,7 +816,6 @@ class SockoptStreamSettings extends XrayCommonClass {
this.tproxy = tproxy;
}
static fromJson(json = {}) {
- if (Object.keys(json).length === 0) return undefined;
return new SockoptStreamSettings(
json.acceptProxyProtocol,
json.tcpFastOpen,
@@ -823,7 +823,6 @@ class SockoptStreamSettings extends XrayCommonClass {
json.tproxy,
);
}
-
toJson() {
return {
acceptProxyProtocol: this.acceptProxyProtocol,
diff --git a/web/html/xui/form/sniffing.html b/web/html/xui/form/sniffing.html
index 65b3312d..31858ef3 100644
--- a/web/html/xui/form/sniffing.html
+++ b/web/html/xui/form/sniffing.html
@@ -5,7 +5,7 @@
Sniffing
- {{ i18n "pages.inbounds.noRecommendKeepDefault" }}
+ {{ i18n "pages.inbounds.noRecommendKeepDefault" }}
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index 4e1873f8..7e438f91 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -711,7 +711,7 @@
openEditClient(dbInboundId, client) {
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
clients = this.getInboundClients(dbInbound);
- index = this.findIndexOfClient(dbInbound.protocol, clients, client);
+ index = this.findIndexOfClient(clients, client);
clientModal.show({
title: '{{ i18n "pages.client.edit"}}',
okText: '{{ i18n "pages.client.submitEdit"}}',
@@ -725,13 +725,8 @@
isEdit: true
});
},
- findIndexOfClient(protocol, clients, client) {
- switch (protocol) {
- case Protocols.TROJAN:
- case Protocols.SHADOWSOCKS:
- return clients.findIndex(item => item.password === client.password && item.email === client.email);
- default: return clients.findIndex(item => item.id === client.id && item.email === client.email);
- }
+ findIndexOfClient(clients, client) {
+ return clients.findIndex(item => JSON.stringify(item) === JSON.stringify(client));
},
async addClient(clients, dbInboundId) {
const data = {
@@ -837,7 +832,8 @@
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
inbound = dbInbound.toInbound();
clients = this.getClients(dbInbound.protocol, inbound.settings);
- index = this.findIndexOfClient(dbInbound.protocol, clients, client);
+ client.enable = !client.enable; // For finding correct index in findIndexOfClient() function
+ index = this.findIndexOfClient(clients, client);
clients[index].enable = !clients[index].enable;
clientId = this.getClientId(dbInbound.protocol, clients[index]);
await this.updateClient(clients[index], dbInboundId, clientId);
diff --git a/web/html/xui/index.html b/web/html/xui/index.html
index 62e60297..2a0745f4 100644
--- a/web/html/xui/index.html
+++ b/web/html/xui/index.html
@@ -78,9 +78,8 @@
- 3X: v{{ .cur_ver }}
- Xray: v[[ status.xray.version ]]
- @panel3xui
+ X-UI: v{{ .cur_ver }}
+ Xray version: v[[ status.xray.version ]]
@@ -111,7 +110,7 @@
{{ i18n "pages.index.operationHours" }}:
Xray:
[[ formatSecond(status.appStats.uptime) ]]
- OS:
+ System:
[[ formatSecond(status.uptime) ]]
@@ -609,4 +608,4 @@