Compare commits

..

59 Commits
1.6.1 ... 1.6.2

Author SHA1 Message Date
Alireza Ahmadi
905ffda848 v1.6.2 2023-12-11 14:06:59 +01:00
Alireza Ahmadi
b946f7a1d4 new geofile strategy 2023-12-10 16:01:13 +01:00
Alireza Ahmadi
aaa0f66a37 small fixes 2023-12-10 15:56:07 +01:00
Alireza Ahmadi
ebbe2c8e5b Merge pull request #739 from TaraRostami/main
Update xq.css
2023-12-10 15:41:54 +01:00
Enkidu
0fdd4dcfb9 Update x-ui.sh (#729)
* Update x-ui.sh

Change log:

- Made the code less bulky. More code = more potential for bugs and vulnerabilities

- The code is now showing the progress of downloads. Having the progres report allows us to see the errors and rectify them.

- Added a Success / Failure prompt for each download

- Solved the inherent problem with wget -O
  
  In the existing script, if a download fails, (i.e. if geofile.dat is not downloaded for any reason, wget -O creates 
  an empty file by the same name and Xray will crash and won't recover and there's no way to know why.

- Current script gives the user an option to restart or not. It shouldn't be optional. That is fixed.

- Function restart() has already been defined in the script. There's no reason to use several lines for each
  restart. We're now using the existing function

- Unrelated: I took the liberty to brighten up the colours for the menu. If that's not what you like, please
  feel free to revert it back.

* Update x-ui.sh

- Removed Iran.dat as it no longer will be supported in the new version.
- Removed the notice about additional 2 files.
- changed restart() to confirm_restart()
- Reverted back to original colours.
2023-12-10 15:39:27 +01:00
Tara Rostami
78fb3844fe Update xq.css 2023-12-10 18:09:04 +03:30
Alireza Ahmadi
9452f4fc15 [log] modal prettifier 2023-12-10 14:02:57 +01:00
Alireza Ahmadi
5996f92fe5 [log] combine with xray logs 2023-12-10 13:08:11 +01:00
Alireza Ahmadi
4cabe80462 [xray] show xray errors #730 2023-12-10 12:57:06 +01:00
Tara Rostami
1cf0d52433 Update custom.css (#732)
* Update login.html

* Update custom.css
2023-12-09 12:46:23 +01:00
Alireza Ahmadi
3cef5142d9 Merge pull request #731 from shahin-io/main
Update readme.md for better reflection of features
2023-12-09 12:20:34 +01:00
shahin-io
ac8af25cef Add files via upload 2023-12-09 05:58:31 +00:00
shahin-io
aee2107f30 Delete README.md 2023-12-09 05:57:49 +00:00
Alireza Ahmadi
7971082beb better tcp/udp display 2023-12-08 22:51:46 +01:00
Alireza Ahmadi
d60290d0a1 Merge pull request #726 from TaraRostami/main
Update custom.css
2023-12-08 12:44:26 +01:00
Tara Rostami
0b1bc1908b Update custom.css 2023-12-08 15:09:29 +03:30
Alireza Ahmadi
a342ef9e90 remove duplicate version_change
Plus fix remove submit button in user/pass change page
2023-12-08 12:26:36 +01:00
Alireza Ahmadi
317e4f1fdd add translates 2023-12-08 11:42:33 +01:00
Alireza Ahmadi
fd82e701b6 small color fixes 2023-12-08 11:19:22 +01:00
Tara Rostami
046be5dd0f Optimized CSS (#722)
* Optimized custom.css

* Optimized <Style>

* Update custom.css

* Update custom.css
2023-12-08 11:18:20 +01:00
Alireza Ahmadi
fa4c954444 show id in confirm modal title 2023-12-08 01:36:43 +01:00
Alireza Ahmadi
03e1434051 Update DB WAL before backup 2023-12-08 01:26:51 +01:00
Alireza Ahmadi
5725420197 [feature] customizable remark #692 2023-12-08 00:44:36 +01:00
Alireza Ahmadi
fd64ae5c85 [feature] import-export inbound #699 2023-12-07 12:58:19 +01:00
Alireza Ahmadi
ff59bb60ce fix user-pass setting style 2023-12-07 12:56:06 +01:00
Alireza Ahmadi
7ec646fd0d Bump actions/setup-go from 4 to 5 #715 2023-12-07 12:55:09 +01:00
Alireza Ahmadi
902368fc03 css correction 2023-12-07 12:54:45 +01:00
Tara Rostami
57827225b4 Minor UI fixes (#713)
* Update custom.css

* Update login.html

* Update custom.css

* Update custom.css

* Update custom.css
2023-12-06 21:59:40 +01:00
Alireza Ahmadi
d406d2925a [xray] fix adding empty inbound 2023-12-06 16:08:33 +01:00
Alireza Ahmadi
2f2876ec90 fix scroll-x display 2023-12-06 15:20:23 +01:00
Alireza Ahmadi
20d00d31a1 fix small design problem 2023-12-06 14:36:37 +01:00
Alireza Ahmadi
48b327ccb5 Merge branch 'main' of https://github.com/alireza0/x-ui 2023-12-06 14:35:25 +01:00
Alireza Ahmadi
9cc893a396 [bug] fix routing dns strategy #668 2023-12-06 14:35:17 +01:00
shahin-io
91e9c2d6b2 Update README.md (#711)
* Update README.md

* Update README.md
2023-12-06 12:08:21 +01:00
Alireza Ahmadi
6bfaad48fd Merge pull request #707 from alireza0/dependabot/go_modules/github.com/nicksnyder/go-i18n/v2-2.3.0
Bump github.com/nicksnyder/go-i18n/v2 from 2.2.2 to 2.3.0
2023-12-06 11:28:07 +01:00
shahin-io
10779201f5 minor edit (#706)
* v1.6.1

* v1.6.1

* Update x-ui.sh

* Update x-ui.sh

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update x-ui.sh

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

---------

Co-authored-by: Alireza Ahmadi <alireza7@gmail.com>
2023-12-06 11:27:51 +01:00
Tara Rostami
5b20505515 UI improvements (#708)
* Improved login page

* Improved login page

* Update inbound_client_table.html

* Update external_proxy.html

* Update custom.css
2023-12-06 11:27:20 +01:00
Alireza Ahmadi
ed5db9390d Merge pull request #701 from Shellgate/main
Advanced Geo updater x-ui.sh
2023-12-06 11:26:31 +01:00
Shellgate
5ea3333367 Fix loop x-ui.sh
Fix Options and loop
2023-12-06 04:48:09 +03:30
Shellgate
9a95530742 Merge branch 'alireza0:main' into main 2023-12-06 04:05:53 +03:30
Alireza Ahmadi
b5eb368b89 [sub] fix typo 2023-12-05 23:09:24 +01:00
Alireza Ahmadi
1f026d0039 outbound tag velidation 2023-12-05 23:03:53 +01:00
Alireza Ahmadi
056de927da [theme] small fixes 2023-12-05 22:57:24 +01:00
dependabot[bot]
4596a981d6 Bump github.com/nicksnyder/go-i18n/v2 from 2.2.2 to 2.3.0
Bumps [github.com/nicksnyder/go-i18n/v2](https://github.com/nicksnyder/go-i18n) from 2.2.2 to 2.3.0.
- [Release notes](https://github.com/nicksnyder/go-i18n/releases)
- [Changelog](https://github.com/nicksnyder/go-i18n/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nicksnyder/go-i18n/compare/v2.2.2...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/nicksnyder/go-i18n/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-05 21:56:18 +00:00
Alireza Ahmadi
5cebf8faef fix fallback link for nonTLS 2023-12-05 22:45:54 +01:00
Alireza Ahmadi
2cf2da8ae2 fix small typos 2023-12-05 19:23:31 +01:00
Alireza Ahmadi
da82d14c18 [bug] fix error in deepSearch #698 2023-12-05 19:23:02 +01:00
Alireza Ahmadi
8da966a7f7 Merge pull request #703 from vuong2023/main
add : add Vietnamese option for Vietnamese users!!
2023-12-05 18:38:19 +01:00
Alireza Ahmadi
81b96507d0 Merge pull request #700 from sly-fresh/patch-1
Fixed a few typos
2023-12-05 18:26:15 +01:00
vuong2023
0986791fb3 Update langs.js
add : add Vietnamese option for Vietnamese users!!
2023-12-05 21:04:17 +07:00
vuong2023
d4317a0a62 Create translate.vi_VN.toml
add : add Vietnamese option for Vietnamese users
2023-12-05 21:01:15 +07:00
Shellgate
5fc7f132a1 Fix values x-ui.sh 2023-12-05 06:08:29 +03:30
Shellgate
bdb371367e Add Restart request x-ui.sh
Add Restart request
2023-12-05 05:23:07 +03:30
Shellgate
407bebad05 Advanced Geo updater x-ui.sh 2023-12-05 04:42:13 +03:30
sly-fresh
10d85f9855 Fixed a few typos 2023-12-04 23:46:17 +01:00
Alireza Ahmadi
98c11dd83e Merge branch 'main' of https://github.com/alireza0/x-ui 2023-12-04 22:28:38 +01:00
Alireza Ahmadi
86f6050697 [bug] fix outbound link errors #683 2023-12-04 22:28:31 +01:00
shahin-io
e488dc18b1 x-ui menu edit typo (#680)
* Update README.md
* Update x-ui.sh

---------

Co-authored-by: Shahin-IO <115543613+shahin-io@users.noreply.github.com>
2023-12-04 20:29:36 +01:00
Tara Rostami
7ed106a0f0 Minor UI bug fixes (#689)
* minor css modification
* JSON Editor color correction
* Added Line-Hover class
* Update web/assets/css/custom.css
* Update web/assets/css/custom.css

Co-authored-by: Shellgate <128194280+Shellgate@users.noreply.github.com>
2023-12-04 20:18:55 +01:00
52 changed files with 1933 additions and 638 deletions

View File

@@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: build linux amd64 version
@@ -28,10 +28,11 @@ jobs:
cd bin
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.6/Xray-linux-64.zip
unzip Xray-linux-64.zip
rm -f Xray-linux-64.zip geoip.dat geosite.dat iran.dat
rm -f Xray-linux-64.zip geoip.dat geosite.dat LICENSE README.md
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
wget https://github.com/MasterKia/iran-hosted-domains/releases/latest/download/iran.dat
wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
mv xray xray-linux-amd64
cd ..
cd ..
@@ -51,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: build linux arm64 version
@@ -69,10 +70,11 @@ jobs:
cd bin
wget https://github.com/xtls/xray-core/releases/download/v1.8.6/Xray-linux-arm64-v8a.zip
unzip Xray-linux-arm64-v8a.zip
rm -f Xray-linux-64.zip geoip.dat geosite.dat iran.dat
rm -f Xray-linux-arm64-v8a.zip geoip.dat geosite.dat LICENSE README.md
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
wget https://github.com/Masterkia/iran-hosted-domains/releases/latest/download/iran.dat
wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
mv xray xray-linux-arm64
cd ..
cd ..
@@ -92,7 +94,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: build linux s390x version
@@ -110,10 +112,11 @@ jobs:
cd bin
wget https://github.com/xtls/xray-core/releases/download/v1.8.6/Xray-linux-s390x.zip
unzip Xray-linux-s390x.zip
rm -f Xray-linux-64.zip geoip.dat geosite.dat iran.dat
rm -f Xray-linux-s390x.zip geoip.dat geosite.dat LICENSE README.md
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
wget https://github.com/Masterkia/iran-hosted-domains/releases/latest/download/iran.dat
wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
mv xray xray-linux-s390x
cd ..
cd ..

View File

@@ -13,9 +13,10 @@ mkdir -p build/bin
cd build/bin
wget "https://github.com/XTLS/Xray-core/releases/download/v1.8.6/Xray-linux-${ARCH}.zip"
unzip "Xray-linux-${ARCH}.zip"
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat iran.dat
rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat LICENSE README.md
mv xray "xray-linux-${FNAME}"
wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
wget "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat"
wget "https://github.com/Masterkia/iran-hosted-domains/releases/latest/download/iran.dat"
wget -O geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
wget -O geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
cd ../../

View File

@@ -3,7 +3,9 @@ WORKDIR /app
ARG TARGETARCH
RUN apk --no-cache --update add build-base gcc wget unzip
COPY . .
RUN env CGO_ENABLED=1 go build -o build/x-ui main.go
ENV CGO_ENABLED=1
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
RUN go build -o build/x-ui main.go
RUN ./DockerInitFiles.sh "$TARGETARCH"
FROM alpine

183
README.md
View File

@@ -1,4 +1,5 @@
# x-ui
# X-UI
**Advanced GUI panel based on Xray Core supports multiple protocols and languages**
![](https://img.shields.io/github/v/release/alireza0/x-ui.svg)
![](https://img.shields.io/docker/pulls/alireza7/x-ui.svg)
@@ -8,37 +9,41 @@
> **Disclaimer: This project is only for personal learning and communication, please do not use it for illegal purposes, please do not use it in a production environment**
xray panel supporting multi-protocol, **Multi-lang (English,Farsi,Chinese,Russian)**
| Features | Enable? |
| ------------------------------------ | :----------------: |
| Multi-lang | :heavy_check_mark: |
| Dark/Light Theme | :heavy_check_mark: |
| Search in deep | :heavy_check_mark: |
| Inbound Multi User | :heavy_check_mark: |
| Multi User Traffic & Expiration time | :heavy_check_mark: |
| REST API | :heavy_check_mark: |
| Telegram BOT (admin + clients) | :heavy_check_mark: |
| Backup database using Telegram BOT | :heavy_check_mark: |
| Subscription link + userInfo | :heavy_check_mark: |
| Calculate expire date on first usage | :heavy_check_mark: |
| Show Online Clients | :heavy_check_mark: |
**If you think this project is helpful to you, you may wish to give a** :star2:
**Buy Me a Coffee :**
- Tron USDT (TRC20): `TYTq73Gj6dJ67qe58JVPD9zpjW2cc9XgVz`
- Tezos (XTZ): tz2Wnh2SsY1eezXrcLChu6idWpgdHzUFQcts
- USDT Tron (TRC20): `TYTq73Gj6dJ67qe58JVPD9zpjW2cc9XgVz`
- Tezos (XTZ):
`tz2Wnh2SsY1eezXrcLChu6idWpgdHzUFQcts`
# Install & Upgrade to latest version
## Quick Look
| Features | Enable? |
| -------------------------------------- | :----------------: |
| Multi-Protocol | :heavy_check_mark: |
| Multi-Language | :heavy_check_mark: |
| Multi-User Inbounds | :heavy_check_mark: |
| Advanced Traffic Routing | :heavy_check_mark: |
| REST API | :heavy_check_mark: |
|Show Online Users | :heavy_check_mark: |
| Manage Users Traffic Data & Expiry Date| :heavy_check_mark: |
| Apply Expiry Date based on First Usage | :heavy_check_mark: |
| Telegram Bot (admin + clients) | :heavy_check_mark: |
| Database Backup using Telegram Bot | :heavy_check_mark: |
| Subscription Link + UserInfo | :heavy_check_mark: |
| Search in Deep | :heavy_check_mark: |
| Dark/Light Theme | :heavy_check_mark: |
## Install & Upgrade to Latest Version
```sh
bash <(curl -Ls https://raw.githubusercontent.com/alireza0/x-ui/master/install.sh)
```
## Install custom version
## Install Custom Version
To install your desired version you can add the version to the end of install command. Example for ver `0.5.2`:
@@ -46,7 +51,7 @@ To install your desired version you can add the version to the end of install co
bash <(curl -Ls https://raw.githubusercontent.com/alireza0/x-ui/master/install.sh) 0.5.2
```
## Manual install & upgrade
## Manual Install & Upgrade
1. First download the latest compressed package from https://github.com/alireza0/x-ui/releases, generally choose Architecture `amd64`
2. Then upload the compressed package to the server's `/root/` directory and login to the server with user `root`
@@ -68,15 +73,15 @@ systemctl enable x-ui
systemctl restart x-ui
```
## Install using docker
## Install Using Docker
1. install docker
1. Install Docker
```shell
curl -fsSL https://get.docker.com | sh
```
2. install x-ui
2. Install X-UI
```shell
mkdir x-ui && cd x-ui
@@ -95,33 +100,54 @@ docker run -itd \
docker build -t x-ui .
```
# Features
## Languages
- System Status Monitoring
- Search within all inbounds and clients
- Support Dark/Light theme UI
- Support multi-user multi-protocol, web page visualization operation
- Support multi-domain configuration and multi-certificate inbounds
- Supported protocols: vmess, vless, trojan, shadowsocks, dokodemo-door, socks, http
- Support for configuring more transport configurations
- Traffic statistics, limit traffic, limit expiration time
- Customizable xray configuration templates
- Support subscription ( multi ) link
- Detect users which are expiring or exceed traffic limit soon
- Support https access panel (self-provided domain name + ssl certificate)
- Support one-click SSL certificate application and automatic renewal
- For more advanced configuration items, please refer to the panel
- Support export/import database from panel
- English
- Chinese
- Farsi
- Russian
- Vietnamese
## Features
- Supported protocols: VMess, VLESS, Trojan, Shadowsocks, Dokodemo-door, SOCKS, HTTP
- Support XTLS native encryptions (Vision, REALITY)
- Support advanced JSON editor GUI for Xray-Core configuration
- Support advanced GUI for routing traffic (Reverse and Transparent proxy, Multi-Domain, Multi-Certificate, Multi-Port per inbound)
- Support Multi-User per inbound
- Support applying traffic data limits and expiry dates per user/inbound
- Support system status monitoring
- Support deep database search
- Show traffic statistics
- Show online users
- Show users with expired date or exceeded traffic limits
- Support subscription (multi) link
- Support import/export database
- Support One-Click SSL certificate application and automatic renewal
- Support HTTPS for panel (self-provided domain name + SSL certificate)
- Support Dark/Light theme UI
## suggestion system
## Recommended OS
- CentOS 8+
- Ubuntu 20+
- Debian 10+
- Fedora 36+
## API routes
## Screenshots
![inbounds](./media/inbounds.png)
![Dark inbounds](./media/inbounds-dark.png)
![outbounds](./media/outbounds.png)
![rules](./media/rules.png)
## API Routes
<details>
<summary>Click for details</summary>
### Usage
- `/login` with `PUSH` user data: `{username: '', password: ''}` for login
- `/xui/API/inbounds` base for following actions:
@@ -132,25 +158,32 @@ docker build -t x-ui .
| `GET` | `"/get/:id"` | Get inbound with inbound.id |
| `GET` | `"/createbackup"` | Telegram bot sends backup to admins |
| `POST` | `"/add"` | Add inbound |
| `POST` | `"/del/:id"` | Delete Inbound |
| `POST` | `"/update/:id"` | Update Inbound |
| `POST` | `"/addClient/"` | Add Client to inbound |
| `POST` | `"/:id/delClient/:clientId"` | Delete Client by clientId\* |
| `POST` | `"/updateClient/:clientId"` | Update Client by clientId\* |
| `GET` | `"/getClientTraffics/:email"` | Get Client's Traffic |
| `POST` | `"/:id/resetClientTraffic/:email"` | Reset Client's Traffic |
| `POST` | `"/del/:id"` | Delete inbound |
| `POST` | `"/update/:id"` | Update inbound |
| `POST` | `"/addClient/"` | Add client to inbound |
| `POST` | `"/:id/delClient/:clientId"` | Delete client by clientId\* |
| `POST` | `"/updateClient/:clientId"` | Update client by clientId\* |
| `GET` | `"/getClientTraffics/:email"` | Get client's traffic |
| `POST` | `"/:id/resetClientTraffic/:email"` | Reset client's traffic |
| `POST` | `"/resetAllTraffics"` | Reset traffics of all inbounds |
| `POST` | `"/resetAllClientTraffics/:id"` | Reset inbound clients traffics (-1: all) |
| `POST` | `"/delDepletedClients/:id"` | Delete inbound depleted clients (-1: all) |
| `POST` | `"/onlines"` | Get Online users ( list of emails ) |
| `POST` | `"/onlines"` | Get online users ( list of emails ) |
\*- The field `clientId` should be filled by:
- `client.id` for VMESS and VLESS
- `client.password` for TROJAN
- `client.id` for VMess and VLESS
- `client.password` for Trojan
- `client.email` for Shadowsocks
# Environment Variables
</details>
## Environment Variables
<details>
<summary>Click for details</summary>
### Usage
| Variable | Type | Default |
| -------------- | :--------------------------------------------: | :------------ |
@@ -159,14 +192,9 @@ docker build -t x-ui .
| XUI_BIN_FOLDER | `string` | `"bin"` |
| XUI_DB_FOLDER | `string` | `"/etc/x-ui"` |
# Screenshots
</details>
![inbounds](./media/inbounds.png)
![Dark inbounds](./media/inbounds-dark.png)
![outbounds](./media/outbounds.png)
![rules](./media/rules.png)
## SSL certificate application
## SSL Certificate
<details>
<summary>Click for details</summary>
@@ -183,11 +211,13 @@ certbot certonly --standalone --register-unsafely-without-email --non-interactiv
</details>
## Tg robot use
## Telegram Bot
<details>
<summary>Click for details</summary>
### Usage
X-UI supports daily traffic notification, panel login reminder and other functions through the Tg robot. To use the Tg robot, you need to apply for the specific application tutorial. You can refer to the [blog](https://coderfan.net/how-to-use-telegram-bot-to-alarm-you-when-someone-login-into-your-vps.html)
Set the robot-related parameters in the panel background, including:
@@ -207,7 +237,7 @@ Reference syntax:
- @daily // Daily notification (00:00 in the morning)
- @every 8h // notify every 8 hours
### Telegram Bot Features
### Features
- Report periodic
- Login notification
@@ -224,18 +254,23 @@ Reference syntax:
- Multi language bot
</details>
# T-Shoots:
## Troubleshoots
**If you upgrade from an old version or other forks, for enable traffic for users you should do :**
<details>
<summary>Click for details</summary>
find this in config :
### Enable Traffic Usage
Please be aware if you upgrade from an old X-UI version or other forks, by default data traffic usage for users may not work! it's recommended to follow below steps for enabeling:
1. Find this section in config file
```json
"policy": {
"system": {
```
**and add this just after ` "policy": {` :**
2. Add below section just after ` "policy": {` :
```json
"levels": {
@@ -246,7 +281,7 @@ find this in config :
},
```
**the final output is like :**
- The final output is like:
```json
"policy": {
@@ -265,20 +300,20 @@ find this in config :
"routing": {
```
restart panel
3. Save and restart panel
</details>
# a special thanks to
## a Special Thanks to
- [HexaSoftwareTech](https://github.com/HexaSoftwareTech/)
- [MHSanaei](https://github.com/MHSanaei)
# Acknowledgment
## Acknowledgment
- [Iran Hosted Domains](https://github.com/bootmortis/iran-hosted-domains) (License: **MIT**): _A comprehensive list of Iranian domains and services that are hosted within the country._
- [PersianBlocker](https://github.com/MasterKia/PersianBlocker) (License: **AGPLv3**): _An optimal and extensive list to block ads and trackers on Persian websites._
- [Loyalsoldier](https://github.com/Loyalsoldier/v2ray-rules-dat) (License: **GPL-3.0**): _The enhanced version of V2Ray routing rule._
- [Iran v2ray rules](https://github.com/chocolate4u/Iran-v2ray-rules) (License: **GPL-3.0**): _Enhanced v2ray/xray and v2ray/xray-clients routing rules with built-in Iranian domains and a focus on security and adblocking._
## Stargazers over time
## Stargazers over Time
[![Stargazers over time](https://starchart.cc/alireza0/x-ui.svg)](https://starchart.cc/alireza0/x-ui)

View File

@@ -1 +1 @@
1.6.1
1.6.2

View File

@@ -110,3 +110,12 @@ func IsSQLiteDB(file io.Reader) (bool, error) {
}
return bytes.Equal(buf, signature), nil
}
func Checkpoint() error {
// Update WAL
err := db.Exec("PRAGMA wal_checkpoint;").Error
if err != nil {
return err
}
return nil
}

2
go.mod
View File

@@ -8,7 +8,7 @@ require (
github.com/gin-gonic/gin v1.9.1
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
github.com/goccy/go-json v0.10.2
github.com/nicksnyder/go-i18n/v2 v2.2.2
github.com/nicksnyder/go-i18n/v2 v2.3.0
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/pelletier/go-toml/v2 v2.1.0
github.com/robfig/cron/v3 v3.0.1

21
go.sum
View File

@@ -8,9 +8,8 @@ dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/Workiva/go-datastructures v1.1.1 h1:9G5u1UqKt6ABseAffHGNfbNQd7omRlWE5QaxNruzhE0=
github.com/Workiva/go-datastructures v1.1.1/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A=
github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sxfOI=
@@ -192,8 +191,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/nicksnyder/go-i18n/v2 v2.2.2 h1:Iv/FL6pvYmDqybEZkr4TrOv8jSHezwpE77K68kcaft8=
github.com/nicksnyder/go-i18n/v2 v2.2.2/go.mod h1:fF2++lPHlo+/kPaj3nB0uxtPwzlPm+BlgwGX7MkeGj0=
github.com/nicksnyder/go-i18n/v2 v2.3.0 h1:2NPsCsNFCVd7i+Su0xYsBrIhS3bE2XMv5gNTft2O+PQ=
github.com/nicksnyder/go-i18n/v2 v2.3.0/go.mod h1:nxYSZE9M0bf3Y70gPQjN9ha7XNHX7gMc814+6wVyEI4=
github.com/onsi/ginkgo/v2 v2.13.1 h1:LNGfMbR2OVGBfXjvRZIZ2YCTQdGKtPLvuI1rMCCj3OU=
github.com/onsi/ginkgo/v2 v2.13.1/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
@@ -316,7 +315,6 @@ github.com/xtls/reality v0.0.0-20231112171332-de1173cf2b19/go.mod h1:dm4y/1QwzjG
github.com/xtls/xray-core v1.8.6 h1:tr3nk/fZnFfCsmgZv7B3RC72N5qUC88oMGVLlybDey8=
github.com/xtls/xray-core v1.8.6/go.mod h1:hj2EB8rtcLdlTC8zxiWm5xL+C0k2Aie9Pk0mXtDEP6U=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
@@ -337,7 +335,6 @@ golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -347,7 +344,6 @@ golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -362,7 +358,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -376,7 +371,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -394,8 +388,6 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -404,14 +396,11 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -425,7 +414,6 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -470,7 +458,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -19,8 +19,9 @@ import (
type SubService struct {
address string
showInfo bool
remarkModel string
inboundService service.InboundService
settingServics service.SettingService
settingService service.SettingService
}
func (s *SubService) GetSubs(subId string, host string, showInfo bool) ([]string, []string, error) {
@@ -34,6 +35,10 @@ func (s *SubService) GetSubs(subId string, host string, showInfo bool) ([]string
if err != nil {
return nil, nil, err
}
s.remarkModel, err = s.settingService.GetRemarkModel()
if err != nil {
s.remarkModel = "-ieo"
}
for _, inbound := range inbounds {
clients, err := s.inboundService.GetClients(inbound)
if err != nil {
@@ -88,7 +93,7 @@ func (s *SubService) GetSubs(subId string, host string, showInfo bool) ([]string
}
}
headers = append(headers, fmt.Sprintf("upload=%d; download=%d; total=%d; expire=%d", traffic.Up, traffic.Down, traffic.Total, traffic.ExpiryTime/1000))
updateInterval, _ := s.settingServics.GetSubUpdates()
updateInterval, _ := s.settingService.GetSubUpdates()
headers = append(headers, fmt.Sprintf("%d", updateInterval))
headers = append(headers, subId)
return result, headers, nil
@@ -396,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 {
@@ -578,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
}
}
}
}
@@ -793,17 +788,30 @@ func (s *SubService) genShadowsocksLink(inbound *model.Inbound, email string) st
}
func (s *SubService) genRemark(inbound *model.Inbound, email string, extra string) string {
var remark []string
separationChar := string(s.remarkModel[0])
orderChars := s.remarkModel[1:]
orders := map[byte]string{
'i': "",
'e': "",
'o': "",
}
if len(email) > 0 {
if len(inbound.Remark) > 0 {
remark = append(remark, inbound.Remark)
orders['e'] = email
}
if len(inbound.Remark) > 0 {
orders['i'] = inbound.Remark
}
if len(extra) > 0 {
orders['o'] = extra
}
var remark []string
for i := 0; i < len(orderChars); i++ {
char := orderChars[i]
order, exists := orders[char]
if exists && order != "" {
remark = append(remark, order)
}
remark = append(remark, email)
if len(extra) > 0 {
remark = append(remark, extra)
}
} else {
return inbound.Remark
}
if s.showInfo {
@@ -820,7 +828,7 @@ func (s *SubService) genRemark(inbound *model.Inbound, email string, extra strin
// Get remained days
if statsExist {
if !stats.Enable {
return fmt.Sprintf("⛔N/A-%s", strings.Join(remark, "-"))
return fmt.Sprintf("⛔N/A%s%s", separationChar, strings.Join(remark, separationChar))
}
if vol := stats.Total - (stats.Up + stats.Down); vol > 0 {
remark = append(remark, fmt.Sprintf("%s%s", common.FormatTraffic(vol), "📊"))
@@ -834,7 +842,7 @@ func (s *SubService) genRemark(inbound *model.Inbound, email string, extra strin
}
}
}
return strings.Join(remark, "-")
return strings.Join(remark, separationChar)
}
func searchKey(data interface{}, key string) (interface{}, bool) {

View File

@@ -1741,7 +1741,7 @@
// is needed on Webkit to be able to get line-level bounding
// rectangles for it (in measureChar).
var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null);
var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
var builder = {pre: eltP("pre", [content], "CodeMirror-line Line-Hover"), content: content,
col: 0, pos: 0, cm: cm,
trailingSpace: false,
splitSpaces: cm.getOption("lineWrapping")};

View File

@@ -21,17 +21,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
.cm-s-xq.CodeMirror { border-radius: 1.5rem; border: 1px solid #d9d9d9; height: auto; }
.cm-s-xq.CodeMirror:hover { background-color: #edf4fa; border-color: #2f67c2; transition: all .3s; }
.cm-s-xq .CodeMirror-gutters { border-right: 1px solid #ddd; background-color: rgb(221 221 221 / 20%); white-space: nowrap; }
.cm-s-xq span.cm-keyword { line-height: 1em; font-weight: bold; color: #5A5CAD; }
.cm-s-xq span.cm-atom { color: #6C8CD5; }
.cm-s-xq span.cm-number { color: #164; }
.cm-s-xq span.cm-atom { color: #7A316F; font-weight:bold; }
.cm-s-xq span.cm-number { color: #389E0D; }
.cm-s-xq span.cm-def { text-decoration:underline; }
.cm-s-xq span.cm-variable { color: black; }
.cm-s-xq span.cm-variable-2 { color:black; }
.cm-s-xq span.cm-variable-3, .cm-s-xq span.cm-type { color: black; }
.cm-s-xq span.cm-property {}
.cm-s-xq span.cm-property { color: #0e49b5; }
.cm-s-xq span.cm-operator {}
.cm-s-xq span.cm-comment { color: #0080FF; font-style: italic; }
.cm-s-xq span.cm-string { color: #e04141; }
.cm-s-xq span.cm-comment { color: #bbbbbb; font-style: italic; }
.cm-s-xq span.cm-string {}
.cm-s-xq span.cm-meta { color: yellow; }
.cm-s-xq span.cm-qualifier { color: grey; }
.cm-s-xq span.cm-builtin { color: #7EA656; }
@@ -44,26 +46,27 @@ THE SOFTWARE.
.cm-s-xq .CodeMirror-matchingbracket { outline:1px solid grey;color:black !important;background:yellow; }
.dark .cm-s-xq.CodeMirror { background-color: #222D42; border-color: #2c3950; color: rgb(255 255 255 / 65%); }
.dark .cm-s-xq div.CodeMirror-selected { background: #27007A; }
.dark .cm-s-xq.CodeMirror:hover { background-color: #0e2040; border-color: #0e49b5; transition: all .3s; }
.dark .cm-s-xq div.CodeMirror-selected { background: rgba(0, 0, 0, 0.5); }
.dark .cm-s-xq .CodeMirror-line::selection, .dark .cm-s-xq .CodeMirror-line > span::selection, .dark .cm-s-xq .CodeMirror-line > span > span::selection { background: rgba(39, 0, 122, 0.99); }
.dark .cm-s-xq .CodeMirror-line::-moz-selection, .dark .cm-s-xq .CodeMirror-line > span::-moz-selection, .dark .cm-s-xq .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 0, 122, 0.99); }
.dark .cm-s-xq .CodeMirror-gutters { background: #222D42; border-right: 1px solid #2c3950; }
.dark .cm-s-xq .CodeMirror-gutters { background: rgb(0 0 0 / 30%); border-right: 1px solid #2c3950; }
.dark .cm-s-xq .CodeMirror-guttermarker { color: #FFBD40; }
.dark .cm-s-xq .CodeMirror-guttermarker-subtle { color: #f8f8f8; }
.dark .cm-s-xq .CodeMirror-linenumber { color: #f8f8f8; }
.dark .cm-s-xq .CodeMirror-guttermarker-subtle { color: rgb(255 255 255 / 70%); }
.dark .cm-s-xq .CodeMirror-linenumber { color: rgb(255 255 255 / 50%); }
.dark .cm-s-xq .CodeMirror-cursor { border-left: 1px solid white; }
.dark .cm-s-xq span.cm-keyword { color: #FFBD40; }
.dark .cm-s-xq span.cm-atom { color: #6C8CD5; }
.dark .cm-s-xq span.cm-number { color: #164; }
.dark .cm-s-xq span.cm-atom { color: #c099ff; }
.dark .cm-s-xq span.cm-number { color: #9ccfd8; }
.dark .cm-s-xq span.cm-def { color: #FFF; text-decoration:underline; }
.dark .cm-s-xq span.cm-variable { color: #FFF; }
.dark .cm-s-xq span.cm-variable-2 { color: #EEE; }
.dark .cm-s-xq span.cm-variable-3, .dark .cm-s-xq span.cm-type { color: #DDD; }
.dark .cm-s-xq span.cm-property {}
.dark .cm-s-xq span.cm-property { color: #f6c177 }
.dark .cm-s-xq span.cm-operator {}
.dark .cm-s-xq span.cm-comment { color: gray; }
.dark .cm-s-xq span.cm-string { color: #9FEE00; }
.dark .cm-s-xq span.cm-string {}
.dark .cm-s-xq span.cm-meta { color: yellow; }
.dark .cm-s-xq span.cm-qualifier { color: #FFF700; }
.dark .cm-s-xq span.cm-builtin { color: #30a; }
@@ -73,4 +76,11 @@ THE SOFTWARE.
.dark .cm-s-xq span.cm-error { color: #e04141; }
.dark .cm-s-xq .CodeMirror-activeline-background { background: #27282E; }
.dark .cm-s-xq .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
.dark .cm-s-xq .CodeMirror-matchingbracket { outline:1px solid grey; color:white !important; }
.Line-Hover{transition: all .2s;}
.Line-Hover:hover{ background-color: rgb(4 48 143 / 5%) !important; }
.dark .Line-Hover:hover{ background-color: rgb(0 0 0 / 20%) !important; }
.CodeMirror-foldmarker { color: #fc8800; text-shadow: #ffd8aa 1px 1px 2px, #ffd8aa -1px -1px 2px, #ffd8aa 1px -1px 2px, #ffd8aa -1px 1px 2px; font-family: arial; line-height: .3; cursor: pointer; }
.dark .CodeMirror-foldmarker { color: #ffffff; text-shadow: #bbb 1px 1px 2px, #bbb -1px -1px 2px, #bbb 1px -1px 2px, #bbb -1px 1px 2px; font-family: arial; line-height: .3; cursor: pointer; }

View File

@@ -8,7 +8,7 @@ body {
}
body {
color: rgba(0,0,0,.65);
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
@@ -21,12 +21,12 @@ html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-ms-overflow-style: scrollbar;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
::selection {
color: #0e49b5;
background-color: #0e49b530;
background-color: #d2ddf1;
}
#app {
@@ -41,7 +41,8 @@ html {
overflow: auto;
}
.ant-layout, .ant-layout * {
.ant-layout,
.ant-layout * {
box-sizing: border-box;
}
@@ -52,16 +53,17 @@ html {
style attribute {
text-align: center;
}
.ant-table-tbody>tr>td, .ant-table-thead>tr>th {
padding: 16px;
.ant-table-tbody > tr > td,
.ant-table-thead > tr > th {
padding: 12px 16px;
overflow-wrap: break-word;
}
.ant-table-thead>tr>th {
color: rgba(0,0,0,.85);
.ant-table-thead > tr > th {
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
text-align: left;
border-bottom: 1px solid #e8e8e8;
transition: background .3s ease;
transition: background 0.3s ease;
}
.ant-table-row-cell-break-word {
word-wrap: break-word;
@@ -79,7 +81,7 @@ style attribute {
box-sizing: border-box;
margin: 0;
padding: 0;
color: rgba(0,0,0,.65);
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
@@ -88,6 +90,9 @@ style attribute {
position: relative;
clear: both;
}
.ant-table-body {
overflow-x: auto !important;
}
.ant-card-hoverable {
cursor: auto;
cursor: pointer;
@@ -96,16 +101,16 @@ style attribute {
box-sizing: border-box;
margin: 0;
padding: 0;
color: rgba(0,0,0,.65);
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
list-style: none;
font-feature-settings: "tnum";
position: relative;
background: #fff;
background-color: #fff;
border-radius: 2px;
transition: all .3s;
transition: all 0.3s;
}
.ant-space {
@@ -121,11 +126,11 @@ style attribute {
display: none;
}
.ant-card {
margin: .5rem;
margin: 0.5rem;
}
.ant-tabs {
margin: .5rem;
padding: .5rem;
margin: 0.5rem;
padding: 0.5rem;
}
}
@@ -142,7 +147,7 @@ style attribute {
cursor: auto;
}
.ant-card+.ant-card {
.ant-card + .ant-card {
margin-top: 20px;
}
@@ -159,7 +164,7 @@ style attribute {
display: flex;
justify-content: center;
align-items: center;
background: #fff;
background-color: #fff;
right: -40px;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
border-radius: 0 4px 4px 0;
@@ -167,27 +172,45 @@ style attribute {
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
background-color: #04308f !important;
background-image: linear-gradient( 270deg, rgba(123, 199, 77, 0) 30%, #2f67c2, rgba(123, 199, 77, 0) 100% );
background-image: linear-gradient(
270deg,
rgba(123, 199, 77, 0) 30%,
#2f67c2,
rgba(123, 199, 77, 0) 100%
);
background-repeat: no-repeat;
animation: ma-bg-move linear 6.6s infinite;
color: #fff;
border-radius: 0.5rem
border-radius: 0.5rem;
}
@-webkit-keyframes ma-bg-move {
0% {background-position: -500px 0;}
100% {background-position: 1000px 0;}
0% {
background-position: -500px 0;
}
100% {
background-position: 1000px 0;
}
}
@keyframes ma-bg-move {
0% {background-position: -500px 0;}
50% {background-position: 1000px 0;}
100% {background-position: 1000px 0;}
0% {
background-position: -500px 0;
}
50% {
background-position: 1000px 0;
}
100% {
background-position: 1000px 0;
}
}
.ant-menu-item-active,
.ant-menu-item:hover,
.ant-menu-submenu-active,
.ant-menu-submenu-title:hover,
.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{
color:#0e49b5;
.ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open {
color: #0e49b5;
background-color: #dce9f5;
border-radius: 0.5rem;
}
@@ -202,13 +225,13 @@ style attribute {
}
.ant-layout-sider-children,
.ant-pagination ul {
margin-top:-.1px;
padding:0.5rem
margin-top: -0.1px;
padding: 0.5rem;
}
.ant-dropdown-menu,
.ant-select-dropdown-menu {
padding: .5rem;
padding: 0.5rem;
}
.ant-dropdown-menu-item,
.ant-dropdown-menu-item:hover,
@@ -216,7 +239,7 @@ style attribute {
.ant-select-dropdown-menu-item:hover,
.ant-select-dropdown-menu-item-selected,
.ant-select-selection--multiple .ant-select-selection__choice {
border-radius: .5rem;
border-radius: 0.5rem;
margin-bottom: 2px;
}
@@ -237,98 +260,130 @@ style attribute {
.fade-in-linear-enter,
.fade-in-linear-leave,
.fade-in-linear-leave-active {
opacity: 0
opacity: 0;
}
.fade-in-linear-enter-active, .fade-in-linear-leave-active {
-webkit-transition: opacity .2s linear;
transition: opacity .2s linear
.fade-in-linear-enter-active,
.fade-in-linear-leave-active {
-webkit-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.fade-in-linear-enter-active, .fade-in-linear-leave-active {
-webkit-transition: opacity .2s linear;
transition: opacity .2s linear
.fade-in-linear-enter-active,
.fade-in-linear-leave-active {
-webkit-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.fade-in-enter-active, .fade-in-leave-active {
-webkit-transition: all .3s cubic-bezier(.55, 0, .1, 1);
transition: all .3s cubic-bezier(.55, 0, .1, 1)
.fade-in-enter-active,
.fade-in-leave-active {
-webkit-transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
}
.zoom-in-center-enter-active, .zoom-in-center-leave-active {
-webkit-transition: all .3s cubic-bezier(.55, 0, .1, 1);
transition: all .3s cubic-bezier(.55, 0, .1, 1)
.zoom-in-center-enter-active,
.zoom-in-center-leave-active {
-webkit-transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
}
.zoom-in-center-enter, .zoom-in-center-leave-active {
.zoom-in-center-enter,
.zoom-in-center-leave-active {
opacity: 0;
-webkit-transform: scaleX(0);
transform: scaleX(0)
transform: scaleX(0);
}
.zoom-in-top-enter-active, .zoom-in-top-leave-active {
.zoom-in-top-enter-active,
.zoom-in-top-leave-active {
opacity: 1;
-webkit-transform: scaleY(1);
transform: scaleY(1);
-webkit-transition: opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
transition: opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
transition: transform .3s cubic-bezier(.23, 1, .32, 1), opacity .3s cubic-bezier(.23, 1, .32, 1);
transition: transform .3s cubic-bezier(.23, 1, .32, 1), opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
-webkit-transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
-webkit-transform-origin: center top;
transform-origin: center top
transform-origin: center top;
}
.zoom-in-top-enter, .zoom-in-top-leave-active {
.zoom-in-top-enter,
.zoom-in-top-leave-active {
opacity: 0;
-webkit-transform: scaleY(0);
transform: scaleY(0)
transform: scaleY(0);
}
.zoom-in-bottom-enter-active, .zoom-in-bottom-leave-active {
.zoom-in-bottom-enter-active,
.zoom-in-bottom-leave-active {
opacity: 1;
-webkit-transform: scaleY(1);
transform: scaleY(1);
-webkit-transition: opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
transition: opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
transition: transform .3s cubic-bezier(.23, 1, .32, 1), opacity .3s cubic-bezier(.23, 1, .32, 1);
transition: transform .3s cubic-bezier(.23, 1, .32, 1), opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
-webkit-transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
-webkit-transform-origin: center bottom;
transform-origin: center bottom
transform-origin: center bottom;
}
.zoom-in-bottom-enter, .zoom-in-bottom-leave-active {
.zoom-in-bottom-enter,
.zoom-in-bottom-leave-active {
opacity: 0;
-webkit-transform: scaleY(0);
transform: scaleY(0)
transform: scaleY(0);
}
.zoom-in-left-enter-active, .zoom-in-left-leave-active {
.zoom-in-left-enter-active,
.zoom-in-left-leave-active {
opacity: 1;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
-webkit-transition: opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
transition: opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
transition: transform .3s cubic-bezier(.23, 1, .32, 1), opacity .3s cubic-bezier(.23, 1, .32, 1);
transition: transform .3s cubic-bezier(.23, 1, .32, 1), opacity .3s cubic-bezier(.23, 1, .32, 1), -webkit-transform .3s cubic-bezier(.23, 1, .32, 1);
-webkit-transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1);
transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
-webkit-transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
-webkit-transform-origin: top left;
transform-origin: top left
transform-origin: top left;
}
.zoom-in-left-enter, .zoom-in-left-leave-active {
.zoom-in-left-enter,
.zoom-in-left-leave-active {
opacity: 0;
-webkit-transform: scale(.45, .45);
transform: scale(.45, .45)
-webkit-transform: scale(0.45, 0.45);
transform: scale(0.45, 0.45);
}
.list-enter-active, .list-leave-active {
-webkit-transition: all .3s;
transition: all .3s
.list-enter-active,
.list-leave-active {
-webkit-transition: all 0.3s;
transition: all 0.3s;
}
.list-enter, .list-leave-active {
.list-enter,
.list-leave-active {
opacity: 0;
-webkit-transform: translateY(-30px);
transform: translateY(-30px)
transform: translateY(-30px);
}
.ant-tooltip-inner {
min-height: 0;
}
.ant-list-item-meta-title {
@@ -336,19 +391,14 @@ style attribute {
}
.ant-progress-inner {
background-color: #EBEEF5;
background-color: #ebeef5;
}
.deactive-client .ant-collapse-header{
color:rgb(255, 255, 255) !important;
.deactive-client .ant-collapse-header {
color: rgb(255, 255, 255) !important;
background-color: rgb(255, 127, 127);
}
.ant-table-tbody>tr>td,
.ant-table-thead>tr>th{
padding:16px 5px;
}
.ant-table-expand-icon-th,
.ant-table-row-expand-icon-cell {
width: 30px;
@@ -393,18 +443,18 @@ style attribute {
}
.ant-tag-orange,
.ant-alert-warning {
background-color:#fff6E6;
background-color: #fff6e6;
border-color: #ffd98c;
color: #ffa031;
}
.ant-tag-red,
.ant-alert-error {
background-color:#fff0f0;
background-color: #fff0f0;
border-color: #fb9d9d;
color: #e04141;
}
.ant-input::placeholder{
.ant-input::placeholder {
opacity: 0.5;
}
@@ -414,11 +464,11 @@ style attribute {
}
.delete-icon:hover {
color: #E04141;
color: #e04141;
}
.normal-icon:hover {
color: #0E49B5;
color: #0e49b5;
}
/* DARK THEME */
@@ -440,18 +490,18 @@ style attribute {
.dark .ant-table,
.dark .ant-collapse-content,
.dark .ant-tabs {
background-color: #151F31;
background-color: #151f31;
color: #ffffffa6;
}
.dark .ant-card-hoverable:hover,
.dark .ant-space-item>.ant-tabs:hover {
.dark .ant-space-item > .ant-tabs:hover {
box-shadow: 0 1px 10px -1px rgb(154 175 238 / 80%);
}
.dark>.ant-layout,
.dark > .ant-layout,
.dark .drawer-handle,
.dark .ant-table-thead>tr>th,
.dark .ant-table-thead > tr > th,
.dark .ant-table-expanded-row,
.dark .ant-table-expanded-row:hover,
.dark .ant-table-expanded-row .ant-table-tbody,
@@ -460,7 +510,7 @@ style attribute {
color: rgb(255 255 255 /65%);
}
.dark .ant-table-expanded-row .ant-table-thead>tr:first-child>th {
.dark .ant-table-expanded-row .ant-table-thead > tr:first-child > th {
border-radius: 0;
}
@@ -471,27 +521,27 @@ style attribute {
.dark .ant-table-bordered,
.dark .ant-table-bordered.ant-table-empty .ant-table-placeholder,
.dark .ant-table-bordered .ant-table-body>table,
.dark .ant-table-bordered .ant-table-body > table,
.dark .ant-table-bordered .ant-table-fixed-left table,
.dark .ant-table-bordered .ant-table-fixed-right table,
.dark .ant-table-bordered .ant-table-header>table,
.dark .ant-table-bordered .ant-table-thead>tr:not(:last-child)>th,
.dark .ant-table-bordered .ant-table-tbody>tr>td,
.dark .ant-table-bordered .ant-table-thead>tr>th {
border-color: #2C3950;
.dark .ant-table-bordered .ant-table-header > table,
.dark .ant-table-bordered .ant-table-thead > tr:not(:last-child) > th,
.dark .ant-table-bordered .ant-table-tbody > tr > td,
.dark .ant-table-bordered .ant-table-thead > tr > th {
border-color: #2c3950;
}
.dark .ant-table-tbody>tr>td,
.dark .ant-table-thead>tr>th,
.dark .ant-table-tbody > tr > td,
.dark .ant-table-thead > tr > th,
.dark .ant-card-head,
.dark .ant-modal-header,
.dark .ant-collapse>.ant-collapse-item,
.dark .ant-collapse > .ant-collapse-item,
.dark .ant-tabs-bar,
.dark .ant-list-split .ant-list-item,
.dark .ant-popover-title,
.dark .ant-calendar-header,
.dark .ant-calendar-input-wrap {
border-bottom-color: #2C3950;
border-bottom-color: #2c3950;
}
.dark .ant-modal-footer,
@@ -505,8 +555,7 @@ style attribute {
.dark .ant-progress-text,
.dark .ant-card-head,
.dark .ant-form,
.dark .ant-collapse>.ant-collapse-item>.ant-collapse-header,
.dark .ant-form-item i,
.dark .ant-collapse > .ant-collapse-item > .ant-collapse-header,
.dark .ant-modal-close-x,
.dark .ant-pagination-item a,
.dark li:not(.ant-pagination-disabled) i,
@@ -522,17 +571,30 @@ style attribute {
.dark .ant-divider-inner-text,
.dark .ant-popover-title,
.dark .ant-popover-inner-content,
.dark h2 {
color: rgb(255 255 255 / 65%);
.dark h2,
.dark .ant-modal-title,
.dark .ant-form-item-label > label,
.dark .ant-checkbox-wrapper,
.dark .ant-form-item,
.dark .ant-calendar-footer .ant-calendar-today-btn,
.dark .ant-calendar-footer .ant-calendar-time-picker-btn,
.dark .ant-calendar-day-select,
.dark .ant-calendar-month-select,
.dark .ant-calendar-year-select,
.dark .ant-calendar-date,
.dark .ant-calendar-year-panel-year,
.dark .ant-calendar-month-panel-month,
.dark .ant-calendar-decade-panel-decade {
color: rgba(255, 255, 255, 0.65);
}
.dark .ant-list-item-meta-description {
color: rgb(255 255 255 / 45%);
color: rgba(255, 255, 255, 0.45);
}
.dark .ant-pagination-disabled i,
.dark .ant-tabs-tab-btn-disabled {
color: rgb(255 255 255 / 25%);
color: rgba(255, 255, 255, 0.25);
}
.dark .ant-input,
@@ -553,9 +615,9 @@ style attribute {
.dark .client-table-header,
.dark .ant-select-selection--multiple .ant-select-selection__choice,
.dark .ant-calendar-time-picker-inner {
background-color: #222D42;
background-color: #222d42;
border-color: #2c3950;
color: rgb(255 255 255 / 65%);
color: rgba(255, 255, 255, 0.65);
}
.dark .ant-select-selection:hover,
@@ -564,13 +626,13 @@ style attribute {
.dark .ant-input-number:focus,
.dark .ant-input:hover,
.dark .ant-input:focus {
background-color: rgb(14 73 181 / 30%);
border-color: #0E49B5;
background-color: rgba(14, 73, 181, 0.3);
border-color: #0e49b5;
}
.dark .ant-btn:not(.ant-btn-primary):not(.ant-btn-danger) {
color: rgb(255 255 255 / 65%);
background-color: rgb(14 73 181 / 30%);
color: rgba(255, 255, 255, 0.65);
background-color: rgba(14, 73, 181, 0.3);
border: 1px solid #0e49b5;
}
@@ -581,21 +643,25 @@ style attribute {
border-color: #0e49b5;
}
.dark .ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger) ,
.dark .ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) {
color: #ffffff;
.dark .ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger),
.dark .ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) {
color: #fff;
background-color: rgb(14 73 181 / 50%);
border-color: #0e49b5;
}
.dark .ant-btn-primary[disabled],
.dark .ant-btn-danger[disabled],
.dark .ant-calendar-ok-btn-disabled {
color: rgb(255 255 255 / 35%);
background-color: #2c3950;
border-color: #42516c;
}
.dark .ant-table-tbody>tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)>td,
.dark
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td,
.dark .client-table-odd-row {
background-color: #122444;
}
@@ -612,10 +678,7 @@ style attribute {
border-color: #0e49b5;
}
.dark .ant-switch:not(.ant-switch-checked) {
background-color: #2C3950;
}
.dark .ant-switch:not(.ant-switch-checked),
.dark .ant-progress-line .ant-progress-inner {
background-color: #2c3950;
}
@@ -626,11 +689,11 @@ style attribute {
.ant-dropdown-menu-dark,
.dark .ant-popover-inner {
background-color: #222D42;
background-color: #222d42;
}
.dark>.ant-popover-content>.ant-popover-arrow {
border-color: #222D42;
.dark > .ant-popover-content > .ant-popover-arrow {
border-color: #222d42;
}
.ant-dropdown-menu-dark .ant-dropdown-menu-item:hover,
@@ -645,11 +708,11 @@ style attribute {
}
.dark .ant-alert-message {
color: rgb(255 255 255 /85%);
color: rgba(255, 255, 255, 0.85);
}
.dark .ant-tag {
color: rgb(255 255 255 / 65%);
color: rgba(255, 255, 255, 0.65);
background-color: #ffffff0a;
border-color: #344461;
}
@@ -663,7 +726,7 @@ style attribute {
.dark .ant-tag-red,
.dark .ant-alert-error {
background-color: #291515;
border-color: #5C2626;
border-color: #5c2626;
color: #e04141;
}
@@ -683,7 +746,7 @@ style attribute {
.dark .ant-tag-purple {
background-color: #2c1e32;
border-color: #49394e;
color: #f2eaf1;
color: #cfb9cc;
}
.dark .ant-modal-content,
@@ -691,19 +754,6 @@ style attribute {
background-color: #181f2c;
}
.dark .ant-modal-title,
.dark .ant-form-item-label>label,
.dark .ant-checkbox-wrapper,
.dark .ant-form-item,
.dark .ant-calendar-footer .ant-calendar-today-btn,
.dark .ant-calendar-footer .ant-calendar-time-picker-btn,
.dark .ant-calendar-day-select,
.dark .ant-calendar-month-select,
.dark .ant-calendar-year-select,
.dark .ant-calendar-date {
color: rgb(255 255 255 / 65%);
}
.dark .ant-calendar-next-month-btn-day .ant-calendar-date,
.dark .ant-calendar-last-month-cell .ant-calendar-date {
color: #2c3950;
@@ -727,28 +777,264 @@ style attribute {
}
.dark .ant-calendar-time-picker-select li:focus {
color: #ffffff;
color: #fff;
font-weight: 600;
outline: none;
background-color: #0e49b5;
}
.dark .ant-calendar-time-picker-select {
border-right-color: #2C3950;
border-right-color: #2c3950;
}
.has-warning .ant-input,
.has-warning .ant-input:hover {
background-color: #fff6e6;
border-color: #ffd98c;
}
.has-warning .ant-input::placeholder {
color: #faad14;
}
.has-warning .ant-input:not([disabled]):hover {
border-color: #ffd98c;
}
.dark .has-warning .ant-input,
.dark .has-warning .ant-input:hover {
border-color: #784e1d;
background: rgb(49, 35, 19);
}
.dark .has-warning .ant-input::placeholder {
color: rgb(255 160 49 / 70%);
}
.dark .has-warning .anticon {
color: #ffa031;
}
.dark .has-success .anticon {
color: #61bf39;
animation-name: diffZoomIn1 !important;
}
.dark .anticon-close-circle {
color: #E04141;
color: #e04141;
}
.dark .ant-spin-nested-loading>div>.ant-spin .ant-spin-text {
.dark .ant-spin-nested-loading > div > .ant-spin .ant-spin-text {
text-shadow: 0 1px 2px #00000077;
}
.dark .ant-spin {
color: #ffffff;
color: #fff;
}
.dark .ant-spin-dot-item {
background-color: #ffffffff;
}
background-color: #fff;
}
.ant-menu,
.ant-radio-button-wrapper {
user-select: none;
}
.ant-calendar-date:hover {
background-color: #dae9f5;
}
.ant-calendar-date:active {
background-color: #dae9f5;
color: rgba(0, 0, 0, 0.65);
}
.ant-calendar-today .ant-calendar-date {
color: #0e49b5;
font-weight: 700;
border-color: #0e49b5;
}
.dark .ant-calendar-today .ant-calendar-date {
color: #fff;
font-weight: 700;
border-color: #0e49b5;
}
.ant-calendar-selected-day .ant-calendar-date {
background: #0e49b5;
color: #ffffff;
}
li.ant-select-dropdown-menu-item:empty:after {
content: "None";
font-weight: normal;
color: rgba(0, 0, 0, 0.25);
}
.dark li.ant-select-dropdown-menu-item:empty:after {
content: "None";
font-weight: normal;
color: rgba(255, 255, 255, 0.3);
}
.ant-select-dropdown.ant-select-dropdown--multiple
.ant-select-dropdown-menu-item:hover
.ant-select-selected-icon {
color: rgba(0, 0, 0, 0.87);
}
.dark.ant-select-dropdown.ant-select-dropdown--multiple
.ant-select-dropdown-menu-item:hover
.ant-select-selected-icon {
color: rgb(255, 255, 255);
}
.ant-select-dropdown.ant-select-dropdown--multiple
.ant-select-dropdown-menu-item-selected
.ant-select-selected-icon,
.ant-select-dropdown.ant-select-dropdown--multiple
.ant-select-dropdown-menu-item-selected:hover
.ant-select-selected-icon {
color: #3c89e8;
}
.ant-select-selection:hover,
.ant-input-number-focused,
.ant-input-number:hover {
background-color: #edf4fa;
}
.dark .ant-input-number-handler:active {
background-color: #0e49b5;
}
.dark .ant-input-number-handler:hover .ant-input-number-handler-down-inner,
.dark .ant-input-number-handler:hover .ant-input-number-handler-up-inner {
color: #fff;
}
.dark .ant-input-number-handler-down {
border-top: 1px solid rgba(217, 217, 217, 0.3);
}
.dark .ant-calendar-year-panel-header .ant-calendar-year-panel-century-select,
.dark .ant-calendar-year-panel-header .ant-calendar-year-panel-decade-select,
.dark .ant-calendar-year-panel-header .ant-calendar-year-panel-month-select,
.dark
.ant-calendar-year-panel-header
.ant-calendar-year-panel-year-select
.dark
.ant-calendar-month-panel-header
.ant-calendar-month-panel-century-select,
.dark .ant-calendar-month-panel-header .ant-calendar-month-panel-decade-select,
.dark .ant-calendar-month-panel-header .ant-calendar-month-panel-month-select,
.dark .ant-calendar-month-panel-header .ant-calendar-month-panel-year-select {
color: rgba(255, 255, 255, 0.85);
}
.dark .ant-calendar-year-panel-header {
border-bottom: 1px solid #222d42;
}
.dark .ant-calendar-year-panel-last-decade-cell .ant-calendar-year-panel-year,
.dark .ant-calendar-year-panel-next-decade-cell .ant-calendar-year-panel-year {
color: rgba(255, 255, 255, 0.35);
}
.dark .ant-calendar-year-panel-year:hover,
.dark .ant-calendar-month-panel-month:hover,
.dark .ant-calendar-decade-panel-decade:hover {
background-color: #222d42;
}
.dark .ant-calendar-header a:hover {
color: #fff;
}
.dark .ant-calendar-month-panel-header {
background-color: #101828;
border-bottom: 1px solid #222d42;
}
.dark .ant-calendar-year-panel,
.dark .ant-calendar table {
background-color: #101828;
}
.dark .ant-calendar-year-panel-selected-cell .ant-calendar-year-panel-year,
.dark
.ant-calendar-year-panel-selected-cell
.ant-calendar-year-panel-year:hover,
.dark .ant-calendar-month-panel-selected-cell .ant-calendar-month-panel-month,
.dark
.ant-calendar-month-panel-selected-cell
.ant-calendar-month-panel-month:hover,
.dark
.ant-calendar-decade-panel-selected-cell
.ant-calendar-decade-panel-decade,
.dark
.ant-calendar-decade-panel-selected-cell
.ant-calendar-decade-panel-decade:hover {
color: #fff;
background-color: #0e49b5;
}
.dark .ant-calendar-last-month-cell .ant-calendar-date,
.dark .ant-calendar-last-month-cell .ant-calendar-date:hover,
.dark .ant-calendar-next-month-btn-day .ant-calendar-date,
.dark .ant-calendar-next-month-btn-day .ant-calendar-date:hover {
color: rgb(255 255 255 / 25%);
background: transparent;
border-color: transparent;
}
.dark .ant-calendar-today .ant-calendar-date:hover {
color: #fff;
border-color: #0e49b5;
background-color: #0e49b5;
}
.dark
.ant-calendar-decade-panel-last-century-cell
.ant-calendar-decade-panel-decade,
.dark
.ant-calendar-decade-panel-next-century-cell
.ant-calendar-decade-panel-decade {
color: rgb(255 255 255 / 25%);
}
.dark .ant-calendar-decade-panel-header {
border-bottom: 1px solid #222d42;
background-color: #101828;
}
.dark .ant-checkbox-inner {
background-color: rgba(14, 73, 181, 0.3);
border-color: rgba(14, 73, 181, 0.3);
}
.dark .ant-checkbox-checked .ant-checkbox-inner {
background-color: #0e49b5;
border-color: #0e49b5;
}
.dark .ant-calendar-input {
background-color: #101828;
}
.dark .ant-calendar-input::placeholder {
color: rgba(255, 255, 255, 0.25);
}
.ant-input-number-handler-wrap {
border-radius: 0;
}
.ant-input-number-handler {
border-radius: 0;
}
.ant-input-number {
overflow: clip;
}

View File

@@ -19,6 +19,11 @@ const supportLangs = [
value: 'ru-RU',
icon: '🇷🇺',
},
{
name: 'Tiếng Việt',
value: 'vi-VN',
icon: '🇻🇳',
},
];
function getLang() {
@@ -60,4 +65,4 @@ function isSupportLang(lang) {
}
return false;
}
}

View File

@@ -137,8 +137,8 @@ class DBInbound {
}
}
get genInboundLinks() {
genInboundLinks(remarkModel) {
const inbound = this.toInbound();
return inbound.genInboundLinks(this.remark);
return inbound.genInboundLinks(this.remark,remarkModel);
}
}

View File

@@ -581,6 +581,7 @@ class Outbound extends CommonClass {
if (!match) return null;
let [, protocol, userData, address, port, ] = match;
port *= 1;
if(protocol == 'ss') {
protocol = 'shadowsocks';
userData = atob(userData).split(':');
@@ -746,12 +747,13 @@ Outbound.VmessSettings = class extends CommonClass {
}
};
Outbound.VLESSSettings = class extends CommonClass {
constructor(address, port, id, flow) {
constructor(address, port, id, flow, encryption='none') {
super();
this.address = address;
this.port = port;
this.id = id;
this.flow = flow;
this.encryption = encryption
}
static fromJson(json={}) {
@@ -761,6 +763,7 @@ Outbound.VLESSSettings = class extends CommonClass {
json.vnext[0].port,
json.vnext[0].users[0].id,
json.vnext[0].users[0].flow,
json.vnext[0].users[0].encryption,
);
}
@@ -769,7 +772,7 @@ Outbound.VLESSSettings = class extends CommonClass {
vnext: [{
address: this.address,
port: this.port,
users: [{id: this.id, flow: this.flow}],
users: [{id: this.id, flow: this.flow, encryption: 'none',}],
}],
};
}
@@ -812,7 +815,7 @@ Outbound.ShadowsocksSettings = class extends CommonClass {
}
static fromJson(json={}) {
servers = json.servers;
let servers = json.servers;
if(ObjectUtil.isArrEmpty(servers)) servers=[{}];
return new Outbound.ShadowsocksSettings(
servers[0].address,

View File

@@ -11,6 +11,7 @@ class AllSetting {
this.pageSize = 0;
this.expireDiff = "";
this.trafficDiff = "";
this.remarkModel = "-ieo";
this.tgBotEnable = false;
this.tgBotToken = "";
this.tgBotChatId = "";

View File

@@ -1352,20 +1352,28 @@ class Inbound extends XrayCommonClass {
}
}
genAllLinks(remark='', client){
genAllLinks(remark='', remarkModel = '-ieo', client){
let result = [];
let email = client ? client.email : '';
let addr = !ObjectUtil.isEmpty(this.listen) && this.listen !== "0.0.0.0" ? this.listen : location.hostname;
let port = this.port
let port = this.port;
const separationChar = remarkModel.charAt(0);
const orderChars = remarkModel.slice(1);
let orders = {
'i': remark,
'e': client ? client.email : '',
'o': '',
};
if(ObjectUtil.isArrEmpty(this.stream.externalProxy)){
let r = [remark, email].filter(x => x.length > 0).join('-');
let r = orderChars.split('').map(char => orders[char]).filter(x => x.length > 0).join(separationChar);
result.push({
remark: r,
link: this.genLink(addr, port, 'same', r, client)
});
} else {
this.stream.externalProxy.forEach((ep) => {
let r = [remark, email, ep.remark].filter(x => x.length > 0).join('-')
orders['o'] = ep.remark;
let r = orderChars.split('').map(char => orders[char]).filter(x => x.length > 0).join(separationChar);
result.push({
remark: r,
link: this.genLink(ep.dest, ep.port, ep.forceTls, r, client)
@@ -1375,11 +1383,11 @@ class Inbound extends XrayCommonClass {
return result;
}
genInboundLinks(remark = '') {
genInboundLinks(remark = '', remarkModel = '-ieo') {
if(this.clients){
let links = [];
this.clients.forEach((client) => {
this.genAllLinks(remark,client).forEach(l => {
this.genAllLinks(remark,remarkModel,client).forEach(l => {
links.push(l.link);
})
});
@@ -1555,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;
}
@@ -1687,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);
}

View File

@@ -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 "#ffa031";
return "#f37b24"; // Orange
default:
return "#e04141";
return "#e04141"; // red
}
}

View File

@@ -177,7 +177,7 @@ class ObjectUtil {
}
}
} else {
return obj.toString().toLowerCase().indexOf(key.toLowerCase()) >= 0;
return this.isEmpty(obj) ? false : obj.toString().toLowerCase().indexOf(key.toLowerCase()) >= 0;
}
return false;
}

View File

@@ -1,6 +1,7 @@
package controller
import (
"encoding/json"
"fmt"
"strconv"
"x-ui/database/model"
@@ -35,6 +36,7 @@ func (a *InboundController) initRouter(g *gin.RouterGroup) {
g.POST("/resetAllTraffics", a.resetAllTraffics)
g.POST("/resetAllClientTraffics/:id", a.resetAllClientTraffics)
g.POST("/delDepletedClients/:id", a.delDepletedClients)
g.POST("/import", a.importInbound)
g.POST("/onlines", a.onlines)
}
@@ -254,6 +256,31 @@ func (a *InboundController) delDepletedClients(c *gin.Context) {
jsonMsg(c, "All delpeted clients are deleted", nil)
}
func (a *InboundController) importInbound(c *gin.Context) {
inbound := &model.Inbound{}
err := json.Unmarshal([]byte(c.PostForm("data")), inbound)
if err != nil {
jsonMsg(c, "Something went wrong!", err)
return
}
user := session.GetLoginUser(c)
inbound.Id = 0
inbound.UserId = user.Id
inbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port)
for index := range inbound.ClientStats {
inbound.ClientStats[index].Id = 0
inbound.ClientStats[index].Enable = true
}
needRestart := false
inbound, needRestart, err = a.inboundService.AddInbound(inbound)
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.create"), inbound, err)
if err == nil && needRestart {
a.xrayService.SetToNeedRestart()
}
}
func (a *InboundController) onlines(c *gin.Context) {
jsonObj(c, a.inboundService.GetOnlineClinets(), nil)
}

View File

@@ -10,6 +10,7 @@ type XraySettingController struct {
XraySettingService service.XraySettingService
SettingService service.SettingService
InboundService service.InboundService
XrayService service.XrayService
}
func NewXraySettingController(g *gin.RouterGroup) *XraySettingController {
@@ -23,6 +24,7 @@ func (a *XraySettingController) initRouter(g *gin.RouterGroup) {
g.POST("/", a.getXraySetting)
g.POST("/update", a.updateSetting)
g.GET("/getXrayResult", a.getXrayResult)
g.GET("/getDefaultJsonConfig", a.getDefaultXrayConfig)
}
@@ -55,3 +57,7 @@ func (a *XraySettingController) getDefaultXrayConfig(c *gin.Context) {
}
jsonObj(c, defaultJsonConfig, nil)
}
func (a *XraySettingController) getXrayResult(c *gin.Context) {
jsonObj(c, a.XrayService.GetXrayResult(), nil)
}

View File

@@ -25,6 +25,7 @@ type AllSetting struct {
PageSize int `json:"pageSize" form:"pageSize"`
ExpireDiff int `json:"expireDiff" form:"expireDiff"`
TrafficDiff int `json:"trafficDiff" form:"trafficDiff"`
RemarkModel string `json:"remarkModel" form:"remarkModel"`
TgBotEnable bool `json:"tgBotEnable" form:"tgBotEnable"`
TgBotToken string `json:"tgBotToken" form:"tgBotToken"`
TgBotChatId string `json:"tgBotChatId" form:"tgBotChatId"`

View File

@@ -32,7 +32,7 @@
this.client = client;
this.subId = '';
this.qrcodes = [];
this.inbound.genAllLinks(this.dbInbound.remark, client).forEach(l => {
this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, client).forEach(l => {
this.qrcodes.push({
remark: l.remark,
link: l.link

View File

@@ -30,7 +30,10 @@
this.clipboard = new ClipboardJS('#txt-modal-ok-btn', {
text: () => this.content,
});
this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}'));
this.clipboard.on('success', () => {
app.$message.success('{{ i18n "copied" }}')
this.close();
});
}
});
},

View File

@@ -2,112 +2,229 @@
<html lang="en">
{{template "head" .}}
<style>
h1 {
text-align: center;
margin: 20px 0 50px 0;
h1 {
text-align: center;
margin: 20px 0 50px 0;
}
.ant-btn,
.ant-input {
height: 50px;
border-radius: 30px;
}
.ant-input-group-addon {
border-radius: 0 30px 30px 0;
width: 50px;
font-size: 18px;
}
.ant-input-affix-wrapper .ant-input-prefix {
left: 23px;
}
.ant-input-affix-wrapper .ant-input:not(:first-child) {
padding-left: 50px;
}
.centered {
display: flex;
text-align: center;
align-items: center;
justify-content: center;
}
.title {
font-size: 32px;
font-weight: bold;
}
#app {
overflow: hidden;
}
#login {
animation: charge 0.5s both;
background-color: #fff;
border-radius: 2rem;
padding: 3rem;
transition: all 0.3s;
}
#login:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}
@keyframes charge {
from {
transform: translateY(5rem);
opacity: 0;
}
.ant-btn, .ant-input {
height: 50px;
border-radius: 30px;
to {
transform: translateY(0);
opacity: 1;
}
.ant-input-group-addon {
border-radius: 0 30px 30px 0;
width: 50px;
font-size: 18px;
}
@keyframes wave {
from {
transform: rotate(0deg);
}
.ant-input-affix-wrapper .ant-input-prefix {
left: 23px;
to {
transform: rotate(360deg);
}
.ant-input-affix-wrapper .ant-input:not(:first-child) {
padding-left: 50px;
}
.wave {
opacity: 0.6;
position: absolute;
bottom: 40%;
left: 50%;
width: 6000px;
height: 6000px;
background-color: rgba(14, 73, 181, 0.08);
margin-left: -3000px;
transform-origin: 50% 48%;
border-radius: 46%;
animation: wave 72s infinite linear;
pointer-events: none;
}
.wave2 {
animation: wave 88s infinite linear;
opacity: 0.3;
}
.wave3 {
animation: wave 80s infinite linear;
opacity: 0.1;
}
.under {
background-color: #dce9f5;
}
.dark .wave {
background: rgba(14, 73, 181, 0.2);
}
.dark .under {
background-color: #101828;
}
.dark #login {
background-color: #151f31;
}
.dark h1 {
color: rgba(255, 255, 255, 0.85);
}
.ant-btn-primary-login {
color: #0e49b5;
background-color: #edf4fa;
border-color: #a9c5e7;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
box-shadow: none;
width: 100%;
}
.ant-btn-primary-login:focus,
.ant-btn-primary-login:hover {
color: #fff;
background-color: #0c3f9d;
border-color: #0e49b5;
background-image: linear-gradient(
270deg,
rgba(123, 199, 77, 0) 30%,
#2f67c2,
rgba(123, 199, 77, 0) 100%
);
background-repeat: no-repeat;
animation: ma-bg-move ease-in-out 5s infinite;
background-position-x: -500px;
width: 95%;
animation-delay: -0.5s;
box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}
.ant-btn-primary-login.active,
.ant-btn-primary-login:active {
color: #fff;
background-color: #04308f;
border-color: #04308f;
}
@keyframes ma-bg-move {
0% {
background-position: -500px 0;
}
.centered {
display: flex;
text-align: center;
align-items: center;
justify-content: center;
50% {
background-position: 1000px 0;
}
.title {
font-size: 32px;
font-weight: bold;
100% {
background-position: 1000px 0;
}
#app {
overflow: hidden;
}
#login {
animation: charge .5s both;
background-color: #fff;
border-radius: 2rem;
padding: 3rem;
}
#login:hover {
box-shadow: 0 2px 8px rgba(0,0,0,.09);
}
@keyframes charge {
from {transform: translateY(5rem);opacity: 0}
to {transform: translateY(0);opacity: 1}
}
@keyframes wave {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
.wave {
opacity: .6;
position: absolute;
bottom: 40%;
left: 50%;
width: 6000px;
height: 6000px;
background: #000;
margin-left: -3000px;
transform-origin: 50% 48%;
border-radius: 46%;
animation: wave 72s infinite linear;
pointer-events: none;
}
.wave2 {
animation: wave 88s infinite linear;
opacity: .3;
}
.wave3 {
animation: wave 80s infinite linear;
opacity: .1;
}
.wave {
background: #0e49b515;
}
.under {
background-color: #dce9f5;
}
.dark .wave {
background: rgb(14 73 181 / 20%);
}
.dark .under {
background-color: #101828;
}
.dark #login {
background-color: #151F31;
}
.dark h1 {
color: rgb(255 255 255 / 85%);
}
.wave-btn-bg {
position: relative;
border-radius: 25px;
width: 100%;
}
.dark .wave-btn-bg {
color: #fff;
position: relative;
background-color: #0e49b5;
border: 2px double transparent;
background-origin: border-box;
background-clip: padding-box, border-box;
background-size: 300%;
animation: wave-btn-tara 4s ease infinite;
transition: all 0.5s ease;
width: 100%;
}
.dark .wave-btn-bg-cl {
background-image: linear-gradient(rgba(13, 14, 33, 0), rgba(13, 14, 33, 0)),
radial-gradient(circle at left top, #0e49b5, #387eff, #0e49b5) !important;
border-radius: 3em;
}
.dark .wave-btn-bg-cl:hover {
width: 95%;
}
.dark .wave-btn-bg-cl:before {
position: absolute;
content: "";
top: -5px;
left: -5px;
bottom: -5px;
right: -5px;
z-index: -1;
background: inherit;
background-size: inherit;
border-radius: 4em;
opacity: 0;
transition: 0.5s;
}
.dark .wave-btn-bg-cl:hover::before {
opacity: 1;
filter: blur(20px);
animation: wave-btn-tara 8s linear infinite;
}
@keyframes wave-btn-tara {
to {
background-position: 300%;
}
}
.dark .ant-btn-primary-login {
font-size: 14px;
color: #fff;
text-align: center;
background-image: linear-gradient(
rgba(13, 14, 33, 0.45),
rgba(13, 14, 33, 0.35)
);
border-radius: 2rem;
border: none;
outline: none;
background-color: transparent;
height: 46px;
position: relative;
white-space: nowrap;
cursor: pointer;
touch-action: manipulation;
padding: 0 15px;
width: 100%;
animation: none;
background-position-x: 0;
box-shadow: none;
}
</style>
<body>
<a-layout id="app" v-cloak :class="themeSwitcher.currentTheme">
<transition name="list" appear>
<a-layout-content class="under">
<a-layout-content class="under" style="min-height: 0;">
<div class='wave'></div>
<div class='wave wave2'></div>
<div class='wave wave3'></div>
<a-row type="flex" justify="center" align="middle" style="height: 100%;">
<a-col :xs="22" :sm="20" :md="14" :lg="10" :xl="6" id="login">
<a-row type="flex" justify="center" align="middle" style="height: 100%; overflow: auto;">
<a-col :xs="22" :sm="20" :md="14" :lg="10" :xl="8" :xxl="6" id="login" style="margin: 3rem 0;">
<a-row type="flex" justify="center">
<a-col>
<h1 class="title">{{ i18n "pages.login.title" }}</h1>
@@ -129,10 +246,12 @@
</a-form-item>
<a-form-item>
<a-row justify="center" class="centered">
<a-button type="primary" :loading="loading" @click="login" :icon="loading ? 'poweroff' : undefined"
:style="loading ? { width: '50px' } : { display: 'block', width: '100%' }">
[[ loading ? '' : '{{ i18n "login" }}' ]]
</a-button>
<div class="wave-btn-bg wave-btn-bg-cl">
<a-button class="ant-btn-primary-login" type="primary" :loading="loading" @click="login" :icon="loading ? 'poweroff' : undefined"
:style="loading ? { width: '50px' } : { display: 'inline-block' }">
[[ loading ? '' : '{{ i18n "login" }}' ]]
</a-button>
</div>
</a-row>
</a-form-item>
<a-form-item>
@@ -175,11 +294,6 @@
this.password = "";
}
}
const State = {
Running: "running",
Stop: "stop",
Error: "error",
}
const app = new Vue({
delimiters: ['[[', ']]'],
@@ -206,4 +320,4 @@
});
</script>
</body>
</html>
</html>

View File

@@ -17,8 +17,8 @@
<tr>
<td>{{ i18n "pages.xray.outbound.tag" }}</td>
<td>
<a-form-item>
<a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" :style="outModal.duplicateTag? 'border-color: red;' : ''"></a-input>
<a-form-item has-feedback :validate-status="outModal.duplicateTag? 'warning' : 'success'">
<a-input v-model.trim="outbound.tag" style="width: 250px" @change="outModal.check()" placeholder='{{ i18n "pages.xray.outbound.tagDesc" }}'></a-input>
</a-form-item>
</td>
</tr>
@@ -126,7 +126,7 @@
<td>{{ i18n "pages.inbounds.port" }}</td>
<td>
<a-form-item>
<a-input-number v-model.number="outbound.settings.port"></a-input-number>
<a-input-number v-model.number="outbound.settings.port" :min="1" :max="65532"></a-input-number>
</a-form-item>
</td>
</tr>
@@ -529,7 +529,6 @@
</td>
</tr>
</template>
</template>
</template>
</table>
</a-form>

View File

@@ -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>

View File

@@ -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>

View File

@@ -5,10 +5,10 @@
<a-switch v-model="externalProxy"></a-switch>
<a-button v-if="externalProxy" type="primary" style="margin-left: 10px" size="small" @click="inbound.stream.externalProxy.push({forceTls: 'same', dest: '', port: 443, remark: ''})">+</a-button>
</a-form-item>
<table width="100%" class="ant-table-tbody" v-if="externalProxy">
<table width="100%" class="ant-table-tbody" v-if="externalProxy" style="margin-bottom:5px">
<tr style="line-height: 40px;">
<td width="100%">
<a-input-group style="margin-top:5px;" compact v-for="(row, index) in inbound.stream.externalProxy">
<a-input-group style="margin: 0 5px;" compact v-for="(row, index) in inbound.stream.externalProxy">
<template>
<a-tooltip title="Force TLS">
<a-select v-model="row.forceTls" style="width:20%; margin: 0px" :dropdown-class-name="themeSwitcher.currentTheme">
@@ -29,4 +29,4 @@
</tr>
</table>
</a-form>
{{end}}
{{end}}

View File

@@ -32,7 +32,7 @@
</td>
</tr>
<tr>
<td>{{ i18n "pages.inbounds.stream.tcp.requestPath" }}
<td style="vertical-align: top; padding-top: 10px;">{{ i18n "pages.inbounds.stream.tcp.requestPath" }}
<a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
</td>
<td>

View File

@@ -19,8 +19,8 @@
:overlay-class-name="themeSwitcher.currentTheme"
ok-text='{{ i18n "reset"}}'
cancel-text='{{ i18n "cancel"}}'>
<a-icon slot="icon" type="question-circle-o" style="color: blue"></a-icon>
<a-icon style="font-size: 24px;" class="normal-icon" type="retweet" v-if="client.email.length > 0"></a-icon>
<a-icon slot="icon" type="question-circle-o" :style="themeSwitcher.isDarkTheme ? 'color: #3c89e8' : 'color: blue'"></a-icon>
<a-icon style="font-size: 24px; cursor: pointer;" class="normal-icon" type="retweet" v-if="client.email.length > 0"></a-icon>
</a-popconfirm>
</a-tooltip>
<a-tooltip>
@@ -32,7 +32,7 @@
ok-type="danger"
cancel-text='{{ i18n "cancel"}}'>
<a-icon slot="icon" type="question-circle-o" style="color: #e04141"></a-icon>
<a-icon style="font-size: 24px" class="delete-icon" type="delete" v-if="isRemovable(record.id)"></a-icon>
<a-icon style="font-size: 24px; cursor: pointer;" class="delete-icon" type="delete" v-if="isRemovable(record.id)"></a-icon>
</a-popconfirm>
</a-tooltip>
</template>
@@ -265,4 +265,4 @@
</a-badge>
</a-popover>
</template>
{{end}}
{{end}}

View File

@@ -263,7 +263,7 @@
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) : [];
this.links = this.inbound.genAllLinks(this.dbInbound.remark, this.clientSettings);
this.links = this.inbound.genAllLinks(this.dbInbound.remark, app.remarkModel, this.clientSettings);
if (this.clientSettings) {
if (this.clientSettings.subId) {
this.subLink = this.genSubLink(this.clientSettings.subId);

View File

@@ -125,6 +125,10 @@
<template v-if="!isMobile">{{ i18n "pages.inbounds.generalActions" }}</template>
</a-button>
<a-menu slot="overlay" @click="a => generalActions(a)" :theme="themeSwitcher.currentTheme">
<a-menu-item key="import">
<a-icon type="import"></a-icon>
{{ i18n "pages.inbounds.importInbound" }}
</a-menu-item>
<a-menu-item key="export">
<a-icon type="export"></a-icon>
{{ i18n "pages.inbounds.export" }}
@@ -226,6 +230,10 @@
<a-menu-item key="resetTraffic">
<a-icon type="retweet"></a-icon> {{ i18n "pages.inbounds.resetTraffic" }}
</a-menu-item>
<a-menu-item key="clipboard">
<a-icon type="copy"></a-icon>
{{ i18n "pages.inbounds.copyToClipboard" }}
</a-menu-item>
<a-menu-item key="clone">
<a-icon type="block"></a-icon> {{ i18n "pages.inbounds.clone"}}
</a-menu-item>
@@ -415,7 +423,7 @@
:columns="isMobile ? innerMobileColumns : innerColumns"
:data-source="getInboundClients(record)"
:pagination=pagination(getInboundClients(record))
:style="isMobile ? 'margin: -16px -5px -17px;' : 'margin-left: 10px;'">
style="margin: -12px -6px -13px;">
{{template "client_table"}}
</a-table>
</template>
@@ -546,6 +554,7 @@
enable : false,
subURI : ''
},
remarkModel: '-ieo',
tgBotEnable: false,
showAlert: false,
pageSize: 0,
@@ -591,6 +600,7 @@
subURI: subURI
};
this.pageSize = pageSize;
this.remarkModel = remarkModel;
}
},
setInbounds(dbInbounds) {
@@ -707,6 +717,9 @@
},
generalActions(action) {
switch (action.key) {
case "import":
this.importInbound();
break;
case "export":
this.exportAllLinks();
break;
@@ -741,6 +754,9 @@
case "export":
this.inboundLinks(dbInbound.id);
break;
case "clipboard":
this.copyToClipboard(dbInbound.id);
break;
case "resetTraffic":
this.resetTraffic(dbInbound.id);
break;
@@ -792,7 +808,7 @@
this.$confirm({
title: '{{ i18n "pages.inbounds.cloneInbound"}} \"' + dbInbound.remark + '\"',
content: '{{ i18n "pages.inbounds.cloneInboundContent"}}',
okText: '{{ i18n "pages.inbounds.update"}}',
okText: '{{ i18n "pages.inbounds.clone"}}',
class: themeSwitcher.currentTheme,
cancelText: '{{ i18n "cancel" }}',
onOk: () => {
@@ -928,7 +944,7 @@
resetTraffic(dbInboundId) {
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
this.$confirm({
title: '{{ i18n "pages.inbounds.resetTraffic"}}',
title: '{{ i18n "pages.inbounds.resetTraffic"}}' + ' #' + dbInboundId,
content: '{{ i18n "pages.inbounds.resetTrafficContent"}}',
class: themeSwitcher.currentTheme,
okText: '{{ i18n "reset"}}',
@@ -943,7 +959,7 @@
},
delInbound(dbInboundId) {
this.$confirm({
title: '{{ i18n "pages.inbounds.deleteInbound"}}',
title: '{{ i18n "pages.inbounds.deleteInbound"}}' + ' #' + dbInboundId,
content: '{{ i18n "pages.inbounds.deleteInboundContent"}}',
class: themeSwitcher.currentTheme,
okText: '{{ i18n "delete"}}',
@@ -956,7 +972,7 @@
clientId = this.getClientId(dbInbound.protocol, client);
if (confirmation){
this.$confirm({
title: '{{ i18n "pages.inbounds.deleteClient"}}',
title: '{{ i18n "pages.inbounds.deleteClient"}}' + ' ' + client.email,
content: '{{ i18n "pages.inbounds.deleteClientContent"}}',
class: themeSwitcher.currentTheme,
okText: '{{ i18n "delete"}}',
@@ -978,7 +994,7 @@
newDbInbound = new DBInbound(dbInbound);
if (dbInbound.listen.startsWith("@")){
rootInbound = this.inbounds.find((i) =>
i.stream.isTls &&
i.isTcp &&
['trojan','vless'].includes(i.protocol) &&
i.settings.fallbacks.find(f => f.dest === dbInbound.listen)
);
@@ -1037,7 +1053,7 @@
resetClientTraffic(client, dbInboundId, confirmation = true) {
if (confirmation){
this.$confirm({
title: '{{ i18n "pages.inbounds.resetTraffic"}}',
title: '{{ i18n "pages.inbounds.resetTraffic"}}' + ' ' + client.email,
content: '{{ i18n "pages.inbounds.resetTrafficContent"}}',
class: themeSwitcher.currentTheme,
okText: '{{ i18n "reset"}}',
@@ -1159,15 +1175,31 @@
inboundLinks(dbInboundId) {
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
newDbInbound = this.checkFallback(dbInbound);
txtModal.show('{{ i18n "pages.inbounds.export"}}', newDbInbound.genInboundLinks, newDbInbound.remark);
txtModal.show('{{ i18n "pages.inbounds.export"}}', newDbInbound.genInboundLinks(this.remarkModel), newDbInbound.remark);
},
importInbound() {
promptModal.open({
title: '{{ i18n "pages.inbounds.importInbound" }}',
type: 'textarea',
value: '',
okText: '{{ i18n "pages.inbounds.import" }}',
confirm: async (dbInboundText) => {
await this.submit('/xui/inbound/import', {data: dbInboundText}, promptModal);
promptModal.close();
},
});
},
exportAllLinks() {
let copyText = [];
for (const dbInbound of this.dbInbounds) {
copyText.push(dbInbound.genInboundLinks);
copyText.push(dbInbound.genInboundLinks(this.remarkModel));
}
txtModal.show('{{ i18n "pages.inbounds.export"}}', copyText.join('\r\n'), 'All-Inbounds');
},
copyToClipboard(dbInboundId) {
dbInbound = this.dbInbounds.find(row => row.id === dbInboundId);
txtModal.show('{{ i18n "pages.inbounds.inboundData" }}', JSON.stringify(dbInbound, null, 2));
},
async startDataRefreshLoop() {
while (this.isRefreshEnabled) {
try {

View File

@@ -85,7 +85,10 @@
<a-col :sm="24" :md="12">
<a-card hoverable>
X-UI: <a href="https://github.com/alireza0/x-ui/releases" target="_blank"><a-tag color="blue">{{ .cur_ver }}</a-tag></a>
Xray: <a-tag color="blue" style="cursor: pointer;" @click="openSelectV2rayVersion">[[ status.xray.version ]]</a-tag>
Xray:
<a-tooltip title='{{ i18n "pages.index.xraySwitch" }}'>
<a-tag color="blue" style="cursor: pointer;" @click="openSelectV2rayVersion">[[ status.xray.version ]]</a-tag>
</a-tooltip>
</a-card>
</a-col>
<a-col :sm="24" :md="12">
@@ -107,15 +110,18 @@
<a-card hoverable>
{{ i18n "pages.index.xrayStatus" }}:
<a-tag :color="status.xray.color">[[ status.xray.state ]]</a-tag>
<a-tooltip v-if="status.xray.state === State.Error">
<template slot="title">
<p v-for="line in status.xray.errorMsg.split('\n')">[[ line ]]</p>
<a-popover v-if="status.xray.state === State.Error"
:overlay-class-name="themeSwitcher.currentTheme">
<span slot="title" style="font-size: 12pt">Error in running xray-core
<a-tag color="purple" style="cursor: pointer; float: right;" @click="openLogs()">{{ i18n "pages.index.logs" }}</a-tag>
</span>
<template slot="content">
<p style="max-width: 400px" v-for="line in status.xray.errorMsg.split('\n')">[[ line ]]</p>
</template>
<a-icon type="question-circle" theme="filled"></a-icon>
</a-tooltip>
</a-popover>
<a-tag color="purple" style="cursor: pointer;" @click="stopXrayService">{{ i18n "pages.index.stopXray" }}</a-tag>
<a-tag color="purple" style="cursor: pointer;" @click="restartXrayService">{{ i18n "pages.index.restartXray" }}</a-tag>
<a-tag color="purple" style="cursor: pointer;" @click="openSelectV2rayVersion">{{ i18n "pages.index.xraySwitch" }}</a-tag>
</a-card>
</a-col>
<a-col :sm="24" :md="12">
@@ -162,13 +168,26 @@
</a-col>
<a-col :sm="24" :md="12">
<a-card hoverable>
{{ i18n "pages.index.connectionCount" }}: TCP: [[ status.tcpCount ]] UDP: [[ status.udpCount ]]
<a-tooltip>
<template slot="title">
{{ i18n "pages.index.connectionCountDesc" }}
</template>
<a-icon type="question-circle" theme="filled"></a-icon>
</a-tooltip>
<a-row>
<a-col :span="12">
TCP: [[ status.tcpCount ]]
<a-tooltip>
<template slot="title">
{{ i18n "pages.index.connectionTcpCountDesc" }}
</template>
<a-icon type="question-circle" theme="filled"></a-icon>
</a-tooltip>
</a-col>
<a-col :span="12">
UDP: [[ status.udpCount ]]
<a-tooltip>
<template slot="title">
{{ i18n "pages.index.connectionUdpCountDesc" }}
</template>
<a-icon type="question-circle" theme="filled"></a-icon>
</a-tooltip>
</a-col>
</a-row>
</a-card>
</a-col>
<a-col :sm="24" :md="12">
@@ -242,7 +261,7 @@
</template>
</a-modal>
<a-modal id="log-modal" v-model="logModal.visible" title="X-UI logs"
<a-modal id="log-modal" v-model="logModal.visible" title="Logs"
:closable="true" @ok="() => logModal.visible = false" @cancel="() => logModal.visible = false"
:class="themeSwitcher.currentTheme"
width="800px"
@@ -272,7 +291,7 @@
<a-checkbox v-model="logModal.syslog" @change="openLogs()"></a-checkbox>
</a-form-item>
<a-form-item>
<button class="ant-btn ant-btn-primary" @click="openLogs()"><a-icon type="sync"></a-icon> Reload</button>
<a-button class="ant-btn ant-btn-primary" :loading="logModal.loading" @click="openLogs()"><a-icon :spin="logModal.loading" type="sync"></a-icon> Reload</a-button>
</a-form-item>
<a-form-item>
<a-button type="primary" style="margin-bottom: 10px;"
@@ -281,7 +300,7 @@
</a-button>
</a-form-item>
</a-form>
<div v-model="logModal.logs" class="ant-input" style="height: 400px; overflow: scroll;"><pre>[[ logModal.logs ]]</pre></div>
<div class="ant-input" style="height: auto; max-height: 500px; overflow: auto;" v-html="logModal.logs"></div>
</a-modal>
<a-modal id="backup-modal" v-model="backupModal.visible" :title="backupModal.title"
@@ -411,9 +430,46 @@
rows: 20,
level: 'info',
syslog: false,
loading: false,
show(logs) {
this.visible = true;
this.logs = logs? logs.join("\n"): "No Record...";
this.logs = logs? this.formatLogs(logs) : "No Record...";
},
formatLogs(logs) {
let formattedLogs = '';
const levels = ["DEBUG","INFO","WARNING","ERROR"];
const levelColors = ["#3c89e8","#008771","#f37b24","#e04141","#bcbcbc"];
logs.forEach((log, index) => {
let [data, message] = log.split(" - ",2);
const parts = data.split(" ")
if(index>0) formattedLogs += '<br>';
if (parts.length === 3) {
const d = parts[0];
const t = parts[1];
const level = parts[2];
const levelIndex = levels.indexOf(level,levels) || 4;
//formattedLogs += `<span style="color: gray;">${index + 1}.</span>`;
formattedLogs += `<span style="color: ${levelColors[0]};">${d} ${t}</span> `;
formattedLogs += `<span style="color: ${levelColors[levelIndex]}">${level}</span>`;
} else {
const levelIndex = levels.indexOf(data,levels) || 4;
formattedLogs += `<span style="color: ${levelColors[levelIndex]}">${data}</span>`;
}
if(message){
if(message.startsWith("XRAY:"))
message = "<b>XRAY: </b>" + message.substring(5);
else
message = "<b>X-UI: </b>" + message;
}
formattedLogs += message ? ' - ' + message : '';
});
return formattedLogs;
},
hide() {
this.visible = false;
@@ -512,13 +568,14 @@
}
},
async openLogs(){
this.loading(true);
logModal.loading = true;
const msg = await HttpUtil.post('server/logs/'+logModal.rows,{level: logModal.level, syslog: logModal.syslog});
this.loading(false);
if (!msg.success) {
return;
}
logModal.show(msg.obj);
await PromiseUtil.sleep(500);
logModal.loading = false;
},
async openConfig() {
this.loading(true);

View File

@@ -77,6 +77,28 @@
<a-tabs default-active-key="1">
<a-tab-pane key="1" tab='{{ i18n "pages.settings.panelConfig"}}'>
<a-list item-layout="horizontal">
<a-list-item>
<a-row style="padding: 20px">
<a-col :lg="24" :xl="12">
<a-list-item-meta title='{{ i18n "pages.settings.remarkModel"}}'>
<template slot="description">{{ i18n "pages.settings.sampleRemark"}}: <i>#[[ remarkSample ]]</i></template>
</a-list-item-meta>
</a-col>
<a-col :lg="24" :xl="12">
<a-input-group style="width: 100%;">
<a-select style="padding-right: .5rem; min-width: 80%; width: auto;"
mode="multiple"
v-model="remarkModel"
:dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option v-for="(value, key) in remarkModels" :value="key">[[ value ]]</a-select-option>
</a-select>
<a-select style="width: 20%;" v-model="remarkSeparator" :dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option v-for="key in remarkSeparators" :value="key">[[ key ]]</a-select-option>
</a-select>
</a-input-group>
</a-col>
</a-row>
</a-list-item>
<setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningIP"}}' desc='{{ i18n "pages.settings.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item>
<setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningDomain"}}' desc='{{ i18n "pages.settings.panelListeningDomainDesc"}}' v-model="allSetting.webDomain"></setting-list-item>
<setting-list-item type="number" title='{{ i18n "pages.settings.panelPort"}}' desc='{{ i18n "pages.settings.panelPortDesc"}}' v-model.number="allSetting.webPort"></setting-list-item>
@@ -93,7 +115,6 @@
<a-col :lg="24" :xl="12">
<a-list-item-meta title="Language"/>
</a-col>
<a-col :lg="24" :xl="12">
<template>
<a-select
@@ -113,22 +134,42 @@
</a-list>
</a-tab-pane>
<a-tab-pane key="2" tab='{{ i18n "pages.settings.userSettings"}}'>
<a-form style="padding: 20px;">
<a-form-item label='{{ i18n "pages.settings.oldUsername"}}'>
<a-input v-model="user.oldUsername" style="max-width: 300px"></a-input>
</a-form-item>
<a-form-item label='{{ i18n "pages.settings.currentPassword"}}'>
<password-input v-model="user.oldPassword" style="max-width: 300px"></password-input>
</a-form-item>
<a-form-item label='{{ i18n "pages.settings.newUsername"}}'>
<a-input v-model="user.newUsername" style="max-width: 300px"></a-input>
</a-form-item>
<a-form-item label='{{ i18n "pages.settings.newPassword"}}'>
<password-input v-model="user.newPassword" style="max-width: 300px"></password-input>
</a-form-item>
<a-form-item>
<a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button>
</a-form-item>
<a-form style="padding: 20px;" layout="inline">
<table cellpadding="2">
<tr>
<td>{{ i18n "pages.settings.oldUsername"}}:</td>
<td>
<a-form-item>
<a-input v-model="user.oldUsername" style="width: 200px"></a-input>
</a-form-item>
</td>
</tr>
<tr>
<td>{{ i18n "pages.settings.currentPassword"}}:</td>
<td>
<a-form-item>
<password-input v-model="user.oldPassword" style="width: 200px"></password-input>
</a-form-item>
</td>
</tr>
<tr>
<td>{{ i18n "pages.settings.newUsername"}}:</td>
<td>
<a-form-item>
<a-input v-model="user.newUsername" style="width: 200px"></a-input>
</a-form-item>
</td>
</tr>
<tr>
<td>{{ i18n "pages.settings.newPassword"}}:</td>
<td>
<a-form-item>
<password-input v-model="user.newPassword" style="width: 200px"></password-input>
</a-form-item>
</td>
</tr>
</table>
<a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button>
</a-form>
</a-tab-pane>
<a-tab-pane key="3" tab='{{ i18n "pages.settings.TGBotSettings"}}'>
@@ -152,8 +193,7 @@
ref="selectBotLang"
v-model="allSetting.tgLang"
style="width: 100%"
:dropdown-class-name="themeSwitcher.currentTheme"
>
:dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs">
<span role="img" aria-label="l.name" v-text="l.icon"></span>
&nbsp;&nbsp;<span v-text="l.name"></span>
@@ -205,7 +245,31 @@
saveBtnDisable: true,
user: {},
lang: getLang(),
showAlert: false
showAlert: false,
remarkModels: {i:'Inbound',e:'Email',o:'Other'},
remarkSeparators: [' ','-','_','@',':','~','|',',','.','/'],
remarkSample: '',
get remarkModel() {
rm = this.allSetting.remarkModel;
return rm.length>1 ? rm.substring(1).split('') : [];
},
set remarkModel(value) {
rs = this.allSetting.remarkModel[0];
this.allSetting.remarkModel = rs + value.join('');
this.changeRemarkSample();
},
get remarkSeparator() {
return this.allSetting.remarkModel.length > 1 ? this.allSetting.remarkModel.charAt(0) : '-';
},
set remarkSeparator(value) {
this.allSetting.remarkModel = value + this.allSetting.remarkModel.substring(1);
this.changeRemarkSample();
},
changeRemarkSample(){
sample = []
this.remarkModel.forEach(r => sample.push(this.remarkModels[r]));
this.remarkSample = sample.length == 0 ? '' : sample.join(this.remarkSeparator);
}
},
methods: {
loading(spinning = true) {
@@ -218,6 +282,7 @@
if (msg.success) {
this.oldAllSetting = new AllSetting(msg.obj);
this.allSetting = new AllSetting(msg.obj);
app.changeRemarkSample();
this.saveBtnDisable = true;
}
},

View File

@@ -74,6 +74,14 @@
<a-space direction="horizontal">
<a-button type="primary" :disabled="saveBtnDisable" @click="updateXraySetting">{{ i18n "pages.xray.save" }}</a-button>
<a-button type="danger" :disabled="!saveBtnDisable" @click="restartXray">{{ i18n "pages.xray.restart" }}</a-button>
<a-popover v-if="restartResult"
:overlay-class-name="themeSwitcher.currentTheme">
<span slot="title" style="font-size: 12pt">Error in running xray-core</span>
<template slot="content">
<p style="max-width: 400px" v-for="line in restartResult.split('\n')">[[ line ]]</p>
</template>
<a-icon type="question-circle" theme="filled"></a-icon>
</a-popover>
</a-space>
</a-col>
<a-col :xs="24" :sm="16">
@@ -143,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>
@@ -459,6 +467,7 @@
xraySetting: '',
inboundTags: [],
saveBtnDisable: true,
restartResult: '',
showAlert: false,
isMobile: window.innerWidth <= 768,
advSettings: 'xraySetting',
@@ -503,13 +512,13 @@
ips: {
local: ["geoip:private"],
cn: ["geoip:cn"],
ir: ["geoip:ir"],
ir: ["ext:geoip_IR.dat:ir","ext:geoip_IR.dat:arvancloud","ext:geoip_IR.dat:derakcloud","ext:geoip_IR.dat:iranserver"],
ru: ["geoip:ru"],
},
domains: {
ads: [
"geosite:category-ads-all",
"ext:iran.dat:ads"
"ext:geosite_IR.dat:category-ads-all"
],
google: ["geosite:google"],
netflix: ["geosite:netflix"],
@@ -523,9 +532,8 @@
],
ir: [
"regexp:.*\\.ir$",
"ext:iran.dat:ir",
"ext:iran.dat:other",
"geosite:category-ir"
"regexp:.*\\.xn--mgba3a4f16a$", // .ایران
"ext:geosite_IR.dat:ir" // have rules to bypass all .ir domains.
]
},
familyProtectDNS: {
@@ -567,8 +575,19 @@
async restartXray() {
this.loading(true);
const msg = await HttpUtil.post("server/restartXrayService");
if (msg.success) {
await PromiseUtil.sleep(500);
await this.getXrayResult();
}
this.loading(false);
},
async getXrayResult() {
const msg = await HttpUtil.get("/xui/xray/getXrayResult");
if(msg.success){
this.restartResult=msg.obj;
if(msg.obj.length > 1) Vue.prototype.$message.error(msg.obj);
}
},
async resetXrayConfigToDefault() {
this.loading(true);
const msg = await HttpUtil.get("/xui/xray/getDefaultJsonConfig");
@@ -700,7 +719,8 @@
}
outModal.close();
},
isEdit: false
isEdit: false,
tags: this.templateSettings.outbounds.map(obj => obj.tag)
});
},
editOutbound(index){
@@ -713,7 +733,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){
@@ -836,6 +857,7 @@
this.showAlert = true;
}
await this.getXraySetting();
await this.getXrayResult();
while (true) {
await PromiseUtil.sleep(1000);
this.saveBtnDisable = this.oldXraySetting === this.xraySetting;
@@ -923,15 +945,17 @@
freedomStrategy: {
get: function () {
if (!this.templateSettings) return "AsIs";
freedomOutbound = this.templateSettings.outbounds.find((o) => o.protocol === "freedom" && !o.tag);
freedomOutbound = this.templateSettings.outbounds.find((o) => o.protocol === "freedom" && o.tag == "direct");
if (!freedomOutbound) return "AsIs";
if (!freedomOutbound.settings || !freedomOutbound.settings.domainStrategy) return "AsIs";
return freedomOutbound.settings.domainStrategy;
},
set: function (newValue) {
newTemplateSettings = this.templateSettings;
freedomOutboundIndex = newTemplateSettings.outbounds.findIndex((o) => o.protocol === "freedom" && !o.tag);
if (!newTemplateSettings.outbounds[freedomOutboundIndex].settings) {
freedomOutboundIndex = newTemplateSettings.outbounds.findIndex((o) => o.protocol === "freedom" && o.tag == "direct");
if(freedomOutboundIndex == -1){
newTemplateSettings.outbounds.push({protocol: "freedom", tag: "direct", settings: { "domainStrategy": newValue }});
} else if (!newTemplateSettings.outbounds[freedomOutboundIndex].settings) {
newTemplateSettings.outbounds[freedomOutboundIndex].settings = { "domainStrategy": newValue };
} else {
newTemplateSettings.outbounds[freedomOutboundIndex].settings.domainStrategy = newValue;

View File

@@ -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 {

View File

@@ -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;

View File

@@ -3,9 +3,9 @@
:confirm-loading="ruleModal.confirmLoading" :closable="true" :mask-closable="false"
:ok-text="ruleModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme">
<a-form layout="inline">
<table width="100%" class="ant-table-tbody">
<tr>
<td>Domain Matcher</td>
<table width="100%" class="ant-table-tbody">
<tr>
<td style="width: 30%;">Domain Matcher</td>
<td>
<a-form-item>
<a-select v-model="ruleModal.rule.domainMatcher" style="width: 250px;" :dropdown-class-name="themeSwitcher.currentTheme">
@@ -158,6 +158,7 @@
isEdit: false,
confirm: null,
rule: {
type: "field",
domainMatcher: "",
domain: "",
ip: "",
@@ -214,9 +215,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));
@@ -235,6 +236,7 @@
value = ruleModal.rule;
rule = {};
newRule = {};
rule.type = "field";
rule.domainMatcher = value.domainMatcher;
rule.domain = value.domain.length>0 ? value.domain.split(',') : [];
rule.ip = value.ip.length>0 ? value.ip.split(',') : [];

View File

@@ -168,9 +168,13 @@ func (s *InboundService) AddInbound(inbound *model.Inbound) (*model.Inbound, boo
err = tx.Save(inbound).Error
if err == nil {
for _, client := range clients {
s.AddClientStat(tx, inbound.Id, &client)
if len(inbound.ClientStats) == 0 {
for _, client := range clients {
s.AddClientStat(tx, inbound.Id, &client)
}
}
} else {
return inbound, false, err
}
needRestart := false
@@ -1285,7 +1289,8 @@ func (s *InboundService) GetInboundTags() (string, error) {
if err != nil && err != gorm.ErrRecordNotFound {
return "", err
}
return "[\"" + strings.Join(inboundTags, "\", \"") + "\"]", nil
tags, _ := json.Marshal(inboundTags)
return string(tags), nil
}
func (s *InboundService) MigrationRequirements() {

View File

@@ -363,14 +363,6 @@ func (s *ServerService) UpdateXray(version string) error {
if err != nil {
return err
}
err = copyZipFile("geosite.dat", xray.GetGeositePath())
if err != nil {
return err
}
err = copyZipFile("geoip.dat", xray.GetGeoipPath())
if err != nil {
return err
}
return nil
@@ -418,6 +410,11 @@ func (s *ServerService) GetConfigJson() (interface{}, error) {
}
func (s *ServerService) GetDb() ([]byte, error) {
// Update by manually trigger a checkpoint operation
err := database.Checkpoint()
if err != nil {
return nil, err
}
// Open the file for reading
file, err := os.Open(config.GetDBPath())
if err != nil {

View File

@@ -34,6 +34,7 @@ var defaultValueMap = map[string]string{
"pageSize": "0",
"expireDiff": "0",
"trafficDiff": "0",
"remarkModel": "-ieo",
"timeLocation": "Asia/Tehran",
"tgBotEnable": "false",
"tgBotToken": "",
@@ -295,6 +296,10 @@ func (s *SettingService) GetSessionMaxAge() (int, error) {
return s.getInt("sessionMaxAge")
}
func (s *SettingService) GetRemarkModel() (string, error) {
return s.getString("remarkModel")
}
func (s *SettingService) GetSecret() ([]byte, error) {
secret, err := s.getString("secret")
if secret == defaultValueMap["secret"] {
@@ -433,6 +438,7 @@ func (s *SettingService) GetDefaultSettings(host string) (interface{}, error) {
"tgBotEnable": func() (interface{}, error) { return s.GetTgbotenabled() },
"subEnable": func() (interface{}, error) { return s.GetSubEnable() },
"subURI": func() (interface{}, error) { return s.GetSubURI() },
"remarkModel": func() (interface{}, error) { return s.GetRemarkModel() },
}
result := make(map[string]interface{})

View File

@@ -9,6 +9,7 @@ import (
"strings"
"time"
"x-ui/config"
"x-ui/database"
"x-ui/database/model"
"x-ui/logger"
"x-ui/util/common"
@@ -697,12 +698,18 @@ func (t *Tgbot) sendBackup(chatId int64) {
return
}
// Update by manually trigger a checkpoint operation
err := database.Checkpoint()
if err != nil {
logger.Warning("Error in trigger a checkpoint operation: ", err)
}
output := t.I18nBot("tgbot.messages.backupTime", "Time=="+time.Now().Format("2006-01-02 15:04:05"))
t.SendMsgToTgbot(chatId, output)
file := tgbotapi.FilePath(config.GetDBPath())
msg := tgbotapi.NewDocument(chatId, file)
_, err := bot.Send(msg)
_, err = bot.Send(msg)
if err != nil {
logger.Warning("Error in uploading backup: ", err)
}

View File

@@ -86,8 +86,8 @@
"operationHours" = "Operation Hours"
"operationHoursDesc" = "System uptime: time since startup."
"systemLoad" = "System Load"
"connectionCount" = "Connection Count"
"connectionCountDesc" = "Total connections across all network cards."
"connectionTcpCountDesc" = "Total TCP connections across all network cards."
"connectionUdpCountDesc" = "Total UDP connections across all network cards."
"upSpeed" = "Total upload speed for all network cards."
"downSpeed" = "Total download speed for all network cards."
"totalSent" = "Total upload traffic of all network cards since system startup."
@@ -170,6 +170,10 @@
"subscriptionDesc" = "You can find your sub link on Details, also you can use the same name for several configurations"
"info" = "Info"
"same" = "Same"
"inboundData" = "Inbound's data"
"copyToClipboard" = "Copy to clipboard"
"import" = "Import"
"importInbound" = "Import an inbound"
[pages.client]
"add" = "Add Client"
@@ -233,6 +237,8 @@
"panelUrlPathDesc" = "Must start with '/' and end with '/'"
"pageSize" = "Pagination size"
"pageSizeDesc" = "Define page size for inbounds table. Set 0 to disable"
"remarkModel" = "Remark Model and Seperation charachter"
"sampleRemark" = "Sample remark"
"oldUsername" = "Current Username"
"currentPassword" = "Current Password"
"newUsername" = "New Username"
@@ -279,7 +285,7 @@
"subEncrypt" = "Encrypt configs"
"subEncryptDesc" = "Encrypt the returned configs in subscription"
"subShowInfo" = "Show usage info"
"subShowInfoDesc" = "Show remianed traffic and date after config name"
"subShowInfoDesc" = "Show remained traffic and date after config name"
"subURI" = "Reverse Proxy URI"
"subURIDesc" = "Change base URI of subscription URL for using on behind of proxies"
@@ -293,7 +299,7 @@
[pages.xray]
"title" = "Xray Settings"
"save" = "Save Settings"
"restart" = "Reastart Xray"
"restart" = "Restart Xray"
"basicTemplate" = "Basic Template"
"advancedTemplate" = "Advanced Template"
"generalConfigs" = "General Configs"
@@ -374,6 +380,7 @@
"editOutbound" = "Edit outbound"
"editReverse" = "Edit reverse"
"tag" = "Tag"
"tagDesc" = "Unique tag"
"address" = "Address"
"reverse" = "Reverse"
"domain" = "Domain"
@@ -403,7 +410,7 @@
"usage" = "❗ Please provide a text to search!"
"getID" = "🆔 Your ID: <code>{{ .ID }}</code>"
"helpAdminCommands" = "Search for a client email:\r\n<code>/usage [Email]</code>\r\n \r\nSearch for inbounds (with client stats):\r\n<code>/inbound [Remark]</code>"
"helpClientCommands" = "To search for statistics, just use folowing command:\r\n \r\n<code>/usage [UUID|Password]</code>\r\n \r\nUse UUID for vmess/vless and Password for Trojan."
"helpClientCommands" = "To search for statistics, just use the following command:\r\n \r\n<code>/usage [UUID|Password]</code>\r\n \r\nUse UUID for vmess/vless and Password for Trojan."
[tgbot.messages]
"cpuThreshold" = "🔴 The CPU usage {{ .Percent }}% is more than threshold {{ .Threshold }}%"

View File

@@ -86,8 +86,8 @@
"operationHours" = "مدت فعالیت"
"operationHoursDesc" = "مدت فعالیت سیستم بعد از روشن شدن"
"systemLoad" = "بار روی سیستم"
"connectionCount" = "تعداد کانکشن ها"
"connectionCountDesc" = "تعداد کانکشن ها برای کل شبکه"
"connectionTcpCountDesc" = "مجموع اتصالات TCP در تمام کارت های شبکه"
"connectionUdpCountDesc" = "مجموع اتصالات UDP در تمام کارت های شبکه"
"upSpeed" = "سرعت آپلود در حال حاضر سیستم"
"downSpeed" = "سرعت دانلود در حال حاضر سیستم"
"totalSent" = "جمع کل ترافیک آپلود مصرفی"
@@ -148,7 +148,7 @@
"client" = "کاربر"
"export" = "استخراج لینک‌ها"
"clone" = "شبیه سازی"
"cloneInbound" = "ایجاد"
"cloneInbound" = "شبیه‌سازی سرویس"
"cloneInboundContent" = "همه موارد این ورودی بجز پورت ، ای پی و کلاینت ها شبیه سازی خواهند شد"
"resetAllTraffic" = "ریست ترافیک کل سرویس ها"
"resetAllTrafficTitle" = "ریست ترافیک کل سرویس ها"
@@ -169,6 +169,10 @@
"subscriptionDesc" = "می توانید ساب لینک خود را در جزئیات پیدا کنید، همچنین می توانید از همین نام برای چندین کانفیگ استفاده کنید"
"info" = "اطلاعات"
"same" = "همسان"
"inboundData" = "داده‌های سرویس"
"copyToClipboard" = "کپی در حافظه"
"import" = "وارد کردن"
"importInbound" = "وارد کردن یک سرویس"
[pages.client]
"add" = "کاربر جدید"
@@ -232,6 +236,8 @@
"panelUrlPathDesc" = "باید با '/' شروع شود و با '/' تمام شود"
"pageSize" = "اندازه صفحه بندی جدول"
"pageSizeDesc" = "اندازه صفحه را برای جدول سرویس ها تعریف کنید. 0: غیرفعال"
"remarkModel" = "نام کانفیگ و جداکننده"
"sampleRemark" = "نمونه نام"
"oldUsername" = "نام کاربری فعلی"
"currentPassword" = "رمز عبور فعلی"
"newUsername" = "نام کاربری جدید"
@@ -373,6 +379,7 @@
"editOutbound" = "ویرایش خروجی"
"editReverse" = "ویرایش معکوس"
"tag" = "برچسب"
"tagDesc" = "برچسب یگانه"
"address" = "آدرس"
"reverse" = "معکوس"
"domain" = "دامنه"
@@ -381,7 +388,6 @@
"portal" = "پرتال"
"intercon" = "اتصال میانی"
[tgbot]
"noResult" = "❗ نتیجه‌ای یافت نشد!"
"wentWrong" = "❌ مشکلی رخ داده است!"

View File

@@ -86,8 +86,8 @@
"operationHours" = "Время работы"
"operationHoursDesc" = "Время работы системы: время с момента запуска."
"systemLoad" = "Системная нагрузка"
"connectionCount" = "Количество соединений"
"connectionCountDesc" = "Всего подключений по всем сетям»"
"connectionTcpCountDesc" = "Всего подключений TCP по всем сетевым картам."
"connectionUdpCountDesc" = "Общее количество подключений UDP по всем сетевым картам."
"upSpeed" = "Общая скорость отдачи"
"downSpeed" = "Общая скорость получения"
"totalSent" = "Общий объем загруженных данных с момента запуска системы"
@@ -170,6 +170,10 @@
"subscriptionDesc" = "вы можете найти свою ссылку подписки в разделе «Подробнее», также вы можете использовать одно и то же имя для нескольких конфигов"
"info" = "Информация"
"same" = "Тот же"
"inboundData" = "Входящие данные"
"copyToClipboard" = "Копировать в буфер обмена"
"import" = "Импортировать"
"importInbound" = "Импортировать входящее сообщение"
[pages.client]
"add" = "Добавить клиента"
@@ -233,6 +237,8 @@
"panelUrlPathDesc" = "Должен начинаться с «/» и заканчиваться на «/»."
"pageSize" = "Размер нумерации страниц"
"pageSizeDesc" = "Определить размер страницы для входящей таблицы. Установите 0, чтобы отключить"
"remarkModel" = "Модель примечания и символ разделения"
"sampleRemark" = "Пример замечания"
"oldUsername" = "Текущее имя пользователя"
"currentPassword" = "Текущий пароль"
"newUsername" = "Новое имя пользователя"
@@ -374,6 +380,7 @@
"editOutbound" = "Изменить исходящий"
"editReverse" = "Редактировать реверс"
"tag" = "Тег"
"tagDesc" = "уникальный тег"
"address" = "Адрес"
"reverse" = "Обратный"
"domain" = "Домен"

View File

@@ -0,0 +1,466 @@
"username" = "Tên người dùng"
"password" = "Mật khẩu"
"login" = "Đăng nhập"
"confirm" = "Xác nhận"
"cancel" = "Hủy bỏ"
"close" = "Đóng"
"copy" = "Sao chép"
"copied" = "Đã sao chép"
"download" = "Tải xuống"
"remark" = "Ghi chú"
"enable" = "Kích hoạt"
"protocol" = "Giao thức"
"search" = "Tìm kiếm"
"filter" = "Bộ lọc"
"loading" = "Đang tải..."
"second" = "Giây"
"minute" = "Phút"
"hour" = "Giờ"
"day" = "Ngày"
"check" = "Kiểm tra"
"indefinite" = "Không xác định"
"unlimited" = "Không giới hạn"
"none" = "Không có"
"qrCode" = "Mã QR"
"info" = "Thông tin thêm"
"edit" = "Chỉnh sửa"
"delete" = "Xóa"
"reset" = "Đặt lại"
"copySuccess" = "Đã sao chép thành công"
"sure" = "Chắc chắn"
"encryption" = "Mã hóa"
"transmission" = "Truyền tải"
"host" = "Máy chủ"
"path" = "Đường dẫn"
"camouflage" = "Ngụy trang"
"status" = "Trạng thái"
"enabled" = "Đã kích hoạt"
"disabled" = "Đã tắt"
"depleted" = "Đã Dùng hết"
"depletingSoon" = "Sắp dùng hết"
"offline" = "Ngoại tuyến"
"online" = "Trực tuyến"
"domainName" = "Tên miền"
"monitor" = "Nghe IP"
"certificate" = "Chứng chỉ"
"fail" = " Thất bại"
"success" = " Thành công"
"getVersion" = "Lấy phiên bản"
"install" = "Cài đặt"
"clients" = "Khách hàng"
"usage" = "Sử dụng"
"remained" = "Còn lại"
"secAlertTitle" = "Cảnh báo an ninh-Tiếng Việt by Ohoang7"
"secAlertSsl" = "Kết nối này không an toàn; Vui lòng không nhập thông tin nhạy cảm cho đến khi TLS được kích hoạt để bảo vệ dữ liệu của Bạn"
"security" = "Bảo vệ"
[menu]
"dashboard" = "Trạng thái hệ thống"
"inbounds" = "Đầu Vào khách hàng"
"settings" = "Cài đặt bảng điều khiển"
"xray" = "Cài đặt Xray"
"logout" = "Đăng xuất"
"link" = "Khác"
[pages.login]
"title" = "Đăng nhập"
"loginAgain" = "Thời hạn đăng nhập đã hết, Vui lòng đăng nhập lại."
[pages.login.toasts]
"invalidFormData" = "Dạng dữ liệu nhập không hợp lệ."
"emptyUsername" = "Vui lòng nhập tên người dùng."
"emptyPassword" = "Vui lòng nhập mật khẩu."
"wrongUsernameOrPassword" = "Tên người dùng hoặc mật khẩu không đúng."
"successLogin" = "Đăng nhập thành công."
[pages.index]
"title" = "Trạng thái hệ thống"
"memory" = "Bộ nhớ"
"hard" = "Ổ cứng"
"xrayStatus" = "Trạng thái của Xray"
"stopXray" = "Dừng Xray"
"restartXray" = "Khởi động lại Xray"
"xraySwitch" = "Chuyển đổi phiên bản"
"xraySwitchClick" = "Chọn phiên bản mà bạn muốn chuyển đổi sang."
"xraySwitchClickDesk" = "Hãy lựa chọn thận trọng, vì các phiên bản cũ có thể không tương thích với các cấu hình hiện tại, của Bạn"
"operationHours" = "Thời gian hoạt động"
"operationHoursDesc" = "Thời gian hoạt động của hệ thống: thời gian kể từ khi khởi động."
"systemLoad" = "Tải hệ thống"
"connectionTcpCountDesc" = "Tổng số kết nối TCP trên tất cả các card mạng."
"connectionUdpCountDesc" = "Tổng số kết nối UDP trên tất cả các card mạng."
"upSpeed" = "Tổng tốc độ tải lên cho tất cả các thẻ mạng."
"downSpeed" = "Tổng tốc độ tải xuống cho tất cả các thẻ mạng."
"totalSent" = "Tổng lưu lượng tải lên của tất cả các thẻ mạng kể từ khi khởi động hệ thống."
"totalReceive" = "Tổng số dữ liệu tải xuống trên tất cả các thẻ mạng kể từ khi khởi động hệ thống."
"xraySwitchVersionDialog" = "Chuyển đổi phiên bản Xray"
"xraySwitchVersionDialogDesc" = "Bạn có chắc chắn muốn chuyển phiên bản Xray sang phiên bản khác"
"dontRefresh" = "Quá trình cài đặt đang diễn ra, vui lòng không làm mới trang này."
"logs" = "Nhật ký"
"config" = "Cấu hình"
"backup" = "Phục hồi dữ liệu đã lưu"
"backupTitle" = "Sao lưu và Khôi phục cơ sở dữ liệu"
"backupDescription" = "Bạn hãy nhớ sao lưu trước khi nhập cơ sở dữ liệu mới."
"exportDatabase" = "Tải xuống cơ sở dữ liệu"
"importDatabase" = "Tải lên cơ sở dữ liệu"
[pages.inbounds]
"title" = "Điểm vào (Inbounds)"
"totalDownUp" = "Tổng tải lên/tải xuống"
"totalUsage" = "Tổng sử dụng"
"inboundCount" = "Số lần vào"
"operate" = "Bảng Chọn"
"enable" = "Cho phép"
"remark" = "Nhận xét"
"protocol" = "Giao thức"
"port" = "Cổng"
"traffic" = "Lưu lượng"
"details" = "Chi tiết"
"transportConfig" = "Cấu hình vận chuyển"
"expireDate" = "Ngày hết hạn"
"resetTraffic" = "Đặt lại lưu lượng"
"addInbound" = "Thêm điểm vào"
"generalActions" = "Hành động chung"
"create" = "Tạo mới"
"update" = "Cập nhật"
"modifyInbound" = "Chỉnh sửa điểm vào (Inbound)"
"deleteInbound" = "Xóa điểm vào (Inbound)"
"deleteInboundContent" = "Xác nhận xóa điểm vào? (Inbound)"
"deleteClient" = "Xóa khách hàng"
"deleteClientContent" = "Bạn có chắc chắn muốn xóa khách hàng không?"
"resetTrafficContent" = "Bạn có chắc chắn muốn đặt lại lưu lượng truy cập không?"
"copyLink" = "Sao chép liên kết"
"address" = "Địa chỉ"
"network" = "Mạng"
"destinationPort" = "Cổng đích"
"targetAddress" = "Địa chỉ mục tiêu"
"monitorDesc" = "Mặc định để trống"
"meansNoLimit" = "Nghĩa là không giới hạn"
"totalFlow" = "Tổng lưu lượng"
"leaveBlankToNeverExpire" = "Để trống để không bao giờ hết hạn"
"noRecommendKeepDefault" = "Không yêu cầu đặc biệt để giữ nguyên cài đặt mặc định"
"certificatePath" = "Đường dẫn tập tin chứng chỉ"
"certificateContent" = "Nội dung tập tin chứng chỉ"
"publicKeyPath" = "Đường dẫn khóa công khai"
"publicKeyContent" = "Nội dung khóa công khai"
"keyPath" = "Đường dẫn khóa riêng tư"
"keyContent" = "Nội dung khóa riêng tư"
"clickOnQRcode" = "Nhấn vào Mã QR để sao chép"
"client" = "Khách hàng"
"export" = "Xuất liên kết"
"clone" = "Bản sao"
"cloneInbound" = "Nhân bản"
"cloneInboundContent" = "Tất cả cài đặt của điểm vào này, ngoại trừ Cổng, IP nghe và Máy khách, sẽ được áp dụng cho bản sao."
"cloneInboundOk" = "Bản sao"
"resetAllTraffic" = "Đặt lại tất cả lưu lượng truy cập"
"resetAllTrafficTitle" = "Đặt lại tất cả lưu lượng truy cập"
"resetAllTrafficContent" = "Bạn có chắc chắn muốn đặt lại lưu lượng cho tất cả điểm vào không?"
"resetInboundClientTraffics" = "Đặt lại lưu lượng cho các khách hàng của điểm vào"
"resetInboundClientTrafficTitle" = "Đặt lại tất cả lưu lượng truy cập của khách hàng"
"resetInboundClientTrafficContent" = "Bạn có chắc chắn muốn đặt lại tất cả lưu lượng cho các khách hàng của điểm vào này không?"
"resetAllClientTraffics" = "Đặt lại lưu lượng cho tất cả máy khách"
"resetAllClientTrafficTitle" = "Đặt lại lưu lượng cho tất cả các khách hàng"
"resetAllClientTrafficContent" = "Bạn có chắc chắn muốn đặt lại tất cả lưu lượng cho tất cả khách hàng không?"
"delDepletedClients" = "Xóa các máy khách đã cạn kiệt"
"delDepletedClientsTitle" = "Xóa các khách khách đã cạn kiệt"
"delDepletedClientsContent" = "Bạn có chắc chắn muốn xóa tất cả các máy khách đã cạn kiệt không??"
"email" = "Email"
"emailDesc" = "vui lòng cung cấp một địa chỉ email duy nhất."
"setDefaultCert" = "Đặt chứng chỉ từ bảng điều khiển"
"telegramDesc" = "Sử dụng ID Telegram không có @ hoặc ID trò chuyện (bạn có thể lấy nó tại đây @userinfobot hoặc sử dụng lệnh '/id' trong bot)"
"subscriptionDesc" = "Bạn có thể tìm thấy liên kết phụ của mình trên Chi tiết, bạn cũng có thể sử dụng cùng tên cho một số cấu hình"
"info" = "Thông tin"
"same" = "Như nhau"
"inboundData" = "Dữ liệu gửi đến"
"copyToClipboard" = "Sao chép vào bảng nhớ tạm"
"import" = "Nhập"
"importInbound" = "Nhập hàng gửi về"
[pages.client]
"add" = "Thêm máy khách"
"edit" = "Chỉnh sửa Máy khách"
"submitAdd" = "Thêm máy khách"
"submitEdit" = "Lưu thay đổi"
"clientCount" = "Số lượng khách hàng"
"bulk" = "Thêm số lượng lớn"
"method" = "Các thức"
"first" = "Ban đầu"
"last" = "Đến cùng"
"prefix" = "Tiền Tố (Được ưu đãi)"
"postfix" = "Hậu tố"
"delayedStart" = "Bắt đầu sau lần sử dụng đầu tiên"
"expireDays" = "Số ngày hết hạn"
"days" = "Ngày(s)"
"renew" = "Tự động gia hạn"
"renewDesc" = "Tự động gia hạn ngày sau khi hết hạn. 0 = tắt"
[pages.inbounds.toasts]
"obtain" = "Nhận được"
[pages.inbounds.stream.general]
"requestHeader" = "Tiêu đề yêu cầu"
"name" = "Tên"
"value" = "Giá trị"
[pages.inbounds.stream.tcp]
"requestVersion" = "Phiên bản yêu cầu"
"requestMethod" = "Phương thức yêu cầu"
"requestPath" = "Đường dẫn yêu cầu"
"responseVersion" = "Phiên bản phản hồi"
"responseStatus" = "Trạng thái phản hồi"
"responseStatusDescription" = "Mô tả trạng thái phản hồi"
"responseHeader" = "Tiêu đề phản hồi"
[pages.inbounds.stream.quic]
"encryption" = "Mã hóa"
[pages.settings]
"title" = "Cài đặt"
"save" = "Lưu"
"infoDesc" = "Mọi thay đổi được thực hiện ở đây cần phải được lưu. Vui lòng khởi động lại bảng điều khiển để áp dụng các thay đổi. bản dich bởi Ohoang7"
"restartPanel" = "Khởi động lại Bảng điều khiển"
"restartPanelDesc" = "Bạn có chắc chắn muốn khởi động lại bảng điều khiển? Nhấn OK để khởi động lại sau 3 giây. Nếu bạn không thể truy cập bảng điều khiển sau khi khởi động lại, vui lòng xem thông tin nhật ký của bảng điều khiển trên máy chủ."
"resetDefaultConfig" = "Đặt lại Cấu hình Mặc định"
"panelConfig" = "Cấu hình bảng điều khiển"
"userSettings" = "Thiết lập người dùng"
"TGBotSettings" = "Cài đặt Bot Telegram"
"panelListeningIP" = "IP Nghe của Bảng điều khiển"
"panelListeningIPDesc" = "Mặc định để trống để nghe tất cả các IP."
"panelListeningDomain" = "Tên miền của nghe Bảng điều khiển"
"panelListeningDomainDesc" = "Mặc định để trống để nghe tất cả các tên miền và IP"
"panelPort" = "Cổng Bảng điều khiển"
"panelPortDesc" = "Cổng được sử dụng để hiển thị bảng điều khiển này"
"publicKeyPath" = "Đường dẫn tập tin khóa công khai Chứng chỉ Bảng điều khiển"
"publicKeyPathDesc" = "Điền vào đường dẫn tuyệt đối bắt đầu với."
"privateKeyPath" = "Đường dẫn tập tin khóa riêng tư Chứng chỉ Bảng điều khiển"
"privateKeyPathDesc" = "Điền vào đường dẫn tuyệt đối bắt đầu với."
"panelUrlPath" = "Đường dẫn gốc URL Bảng điều khiển"
"panelUrlPathDesc" = "Phải bắt đầu bằng '/' và kết thúc bằng."
"pageSize" = "Kích thước phân trang"
"pageSizeDesc" = "Xác định kích thước trang cho bảng gửi đến. Đặt 0 để tắt"
"remarkModel" = "Ghi chú mô hình và ký tự phân tách"
"sampleRemark" = "Nhận xét mẫu"
"oldUsername" = "Tên người dùng hiện tại"
"currentPassword" = "Mật khẩu hiện tại"
"newUsername" = "Tên người dùng mới"
"newPassword" = "Mật khẩu mới"
"telegramBotEnable" = "Bật Bot Telegram"
"telegramBotEnableDesc" = "Kết nối với các tính năng của bảng điều khiển này thông qua bot Telegram"
"telegramToken" = "Token Telegram"
"telegramTokenDesc" = "Bạn phải nhận token từ quản lý bot Telegram @botfather"
"telegramChatId" = "Chat ID Telegram của quản trị viên"
"telegramChatIdDesc" = "Nhiều Chat ID phân tách bằng dấu phẩy. Sử dụng @userinfobot hoặc sử dụng lệnh '/id' trong bot để lấy Chat ID của bạn."
"telegramNotifyTime" = "Thời gian thông báo của bot Telegram"
"telegramNotifyTimeDesc" = "Sử dụng định dạng thời gian Crontab."
"tgNotifyBackup" = "Sao lưu Cơ sở dữ liệu"
"tgNotifyBackupDesc" = "Bao gồm tệp sao lưu cơ sở dữ liệu với thông báo báo cáo."
"tgNotifyLogin" = "Thông báo Đăng nhập"
"tgNotifyLoginDesc" = "Hiển thị tên người dùng, địa chỉ IP và thời gian khi ai đó cố gắng đăng nhập vào bảng điều khiển của bạn."
"sessionMaxAge" = "Tuổi tối đa của phiên"
"sessionMaxAgeDesc" = "Thời gian của phiên đăng nhập (đơn vị: phút)"
"expireTimeDiff" = "Ngưỡng hết hạn cho thông báo"
"expireTimeDiffDesc" = "Nhận thông báo về việc hết hạn tài khoản trước ngưỡng này (đơn vị: ngày)"
"trafficDiff" = "Ngưỡng lưu lượng cho thông báo"
"trafficDiffDesc" = "Nhận thông báo về việc cạn kiệt lưu lượng trước khi đạt đến ngưỡng này (đơn vị: GB)"
"tgNotifyCpu" = "Ngưỡng cảnh báo tỷ lệ CPU"
"tgNotifyCpuDesc" = "Nhận thông báo nếu tỷ lệ sử dụng CPU vượt quá ngưỡng này (đơn vị: %)"
"timeZone" = "Múi giờ"
"timeZoneDesc" = "Các tác vụ được lên lịch chạy theo thời gian trong múi giờ này."
"subSettings" = "Đăng ký"
"subEnable" = "Bật dịch vụ"
"subEnableDesc" = "Tính năng đăng ký với cấu hình riêng"
"subListen" = "Listening IP"
"subListenDesc" = "Mặc định để trống để nghe tất cả các IP"
"subPort" = "Cổng Đăng ký"
"subPortDesc" = "Số cổng dịch vụ đăng ký phải chưa được sử dụng trên máy chủ"
"subCertPath" = "Đường dẫn tập tin khóa công khai Chứng chỉ Đăng ký"
"subCertPathDesc" = "Điền vào đường dẫn tuyệt đối bắt đầu với '/'"
"subKeyPath" = "Đường dẫn tập tin khóa riêng tư Chứng chỉ Đăng ký"
"subKeyPathDesc" = "Điền vào đường dẫn tuyệt đối bắt đầu với '/'"
"subPath" = "Đường dẫn gốc URL Đăng ký"
"subPathDesc" = "Phải bắt đầu bằng '/' và kết thúc bằng '/'"
"subDomain" = "Tên miền con"
"subDomainDesc" = "Mặc định để trống để nghe tất cả các tên miền và IP"
"subUpdates" = "Khoảng thời gian cập nhật đăng ký"
"subUpdatesDesc" = "Số giờ giữa các cập nhật trong ứng dụng khách"
"subEncrypt" = "Mã hóa cấu hình"
"subEncryptDesc" = "Mã hóa các cấu hình được trả về trong đăng ký"
"subShowInfo" = "Hiển thị thông tin sử dụng"
"subShowInfoDesc" = "Hiển thị lưu lượng truy cập còn lại và ngày sau tên cấu hình"
"subURI" = "URI proxy ngược"
"subURIDesc" = "Thay đổi URI cơ sở của URL đăng ký để sử dụng ở phía sau proxy"
[pages.settings.toasts]
"modifySettings" = "Sửa đổi cài đặt"
"getSettings" = "Nhận cài đặt "
"modifyUser" = "Sửa đổi người dùng"
"originalUserPassIncorrect" = "Tên người dùng hoặc mật khẩu ban đầu không chính xác"
"userPassMustBeNotEmpty" = "Tên người dùng mới và mật khẩu mới không được để trống"
[pages.xray]
"title" = "Cài đặt Xray"
"save" = "Lưu các thiết lập"
"restart" = "Khởi động lại Xray"
"basicTemplate" = "Mẫu cơ bản"
"advancedTemplate" = "Mẫu nâng cao"
"generalConfigs" = "Cấu hình Chung"
"generalConfigsDesc" = "Những tùy chọn này sẽ cung cấp điều chỉnh tổng quát."
"blockConfigs" = "Cấu hình Chặn"
"blockConfigsDesc" = "Những tùy chọn này sẽ ngăn người dùng kết nối đến các giao thức và trang web cụ thể."
"blockCountryConfigs" = "Cấu hình Chặn Quốc gia"
"blockCountryConfigsDesc" = "Những tùy chọn này sẽ ngăn người dùng kết nối đến các tên miền quốc gia cụ thể."
"directCountryConfigs" = "Cấu hình Kết nối Trực tiếp Quốc gia"
"directCountryConfigsDesc" = "Những tùy chọn này sẽ kết nối người dùng trực tiếp đến các tên miền quốc gia cụ thể."
"ipv4Configs" = "Cấu hình IPv4"
"ipv4ConfigsDesc" = "Những tùy chọn này sẽ chỉ định kết nối đến các tên miền mục tiêu qua IPv4."
"Template" = "Mẫu cấu hình Xray"
"TemplateDesc" = "Tạo tệp cấu hình Xray cuối cùng dựa trên mẫu này."
"FreedomStrategy" = "Cấu hình chiến lược cho giao thức tự do"
"FreedomStrategyDesc" = "Đặt chiến lược đầu ra của mạng trong Giao thức Tự do."
"RoutingStrategy" = "Định cấu hình chiến lược định tuyến tên miền"
"RoutingStrategyDesc" = "Đặt chiến lược định tuyến tổng thể để phân giải DNS."
"Torrent" = "Cấm sử dụng BitTorrent"
"TorrentDesc" = "Thay đổi mẫu cấu hình để tránh việc người dùng sử dụng BitTorrent."
"PrivateIp" = "Cấm dãy IP riêng để kết nối"
"PrivateIpDesc" = "Thay đổi mẫu cấu hình để tránh kết nối với dải IP riêng."
"Ads" = "Chặn quảng cáo"
"AdsDesc" = "Thay đổi mẫu cấu hình để chặn quảng cáo"
"Family" = "Kích hoạt cấu hình thân thiện với gia đình"
"FamilyDesc" = "Tránh kết nối đến các trang web không an toàn để bảo vệ gia đình."
"IRIp" = "Vô hiệu hóa kết nối với dải IP Iran"
"IRIpDesc" = "Thay đổi mẫu cấu hình để tránh kết nối với dãy IP Iran."
"IRDomain" = "Vô hiệu hóa kết nối với tên miền Iran"
"IRDomainDesc" = "Thay đổi mẫu cấu hình để tránh kết nối với tên miền Iran."
"ChinaIp" = "Vô hiệu hóa kết nối với dải IP Trung Quốc"
"ChinaIpDesc" = "Thay đổi mẫu cấu hình để tránh kết nối tới dãy IP Trung Quốc."
"ChinaDomain" = "Vô hiệu hóa kết nối với tên miền Trung Quốc"
"ChinaDomainDesc" = "Thay đổi mẫu cấu hình để tránh kết nối với miền Trung Quốc."
"RussiaIp" = "Vô hiệu hóa kết nối với dải IP của Nga"
"RussiaIpDesc" = "Thay đổi mẫu cấu hình để tránh kết nối với dãy IP của Nga."
"RussiaDomain" = "Vô hiệu hóa kết nối với tên miền của Nga"
"RussiaDomainDesc" = "Thay đổi mẫu cấu hình để tránh kết nối với miền Nga."
"DirectIRIp" = "Kết nối trực tiếp tới dãy IP Iran"
"DirectIRIpDesc" = "Thay đổi mẫu cấu hình để kết nối trực tiếp với dải IP Iran."
"DirectIRDomain" = "Kết nối trực tiếp tới các miền của Iran"
"DirectIRDomainDesc" = "Thay đổi mẫu cấu hình để kết nối trực tiếp với miền Iran."
"DirectChinaIp" = "Thay đổi mẫu cấu hình để kết nối trực tiếp với miền Iran."
"DirectChinaIpDesc" = "Thay đổi mẫu cấu hình để kết nối trực tiếp với dải IP Trung Quốc."
"DirectChinaDomain" = "Kết nối trực tiếp tới các miền Trung Quốc"
"DirectChinaDomainDesc" = "Kết nối trực tiếp tới các miền Trung Quốc"
"DirectRussiaIp" = "Kết nối trực tiếp tới dãy IP của Nga"
"DirectRussiaIpDesc" = "Thay đổi mẫu cấu hình để kết nối trực tiếp với dải IP của Nga."
"DirectRussiaDomain" = "Kết nối trực tiếp tới các miền của Nga"
"DirectRussiaDomainDesc" = "Thay đổi mẫu cấu hình để kết nối trực tiếp với miền Nga."
"GoogleIPv4" = "Sử dụng IPv4 cho Google"
"GoogleIPv4Desc" = "Thêm định tuyến để Google kết nối với IPv4."
"NetflixIPv4" = "Sử dụng IPv4 cho Netflix"
"NetflixIPv4Desc" = "Thêm định tuyến cho Netflix để kết nối với IPv4."
"completeTemplate" = "Tất cả"
"Inbounds" = "Đầu vào"
"Outbounds" = "Đầu ra"
"Routings" = "Quy tắc định tuyến"
"RoutingsDesc" = "Mức độ ưu tiên của mỗi quy tắc là quan trọng!"
[pages.xray.rules]
"first" = "Đầu tiên"
"last" = "Cuối cùng"
"up" = "hướng lên"
"down" = "Xuống"
"source" = "Nguồn"
"dest" = "Điểm đến"
"inbound" = "Đầu vào"
"outbound" = "Đầu ra"
"info" = "Thông tin"
"add" = "Thêm quy tắc"
"edit" = "Chỉnh sửa quy tắc"
"useComma" = "Các mục được phân tách bằng dấu phẩy"
[pages.xray.outbound]
"addOutbound" = "Thêm Đầu vào"
"addReverse" = "Thêm đảo ngược"
"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"
"type" = "Kiểu"
"bridge" = "Liên kết"
"portal" = "Cổng thông tin"
"intercon" = "Kết nối"
[tgbot]
"noResult" = "❗ Không có kết quả!"
"wentWrong" = "❌ Đã xảy ra lỗi!"
"noInbounds" = "❗ Không tìm thấy inbound!"
"unlimited" = "♾ Không giới hạn"
"day" = "Ngày"
"days" = "hôm nay"
"unknown" = "không xác định"
"inbounds" = "Đầu vào"
"clients" = "Khách hàng"
[tgbot.commands]
"unknown" = "❗ Lệnh không rõ"
"pleaseChoose" = "👇 Vui lòng chọn:\r\n"
"help" = "🤖 Chào mừng bạn đến với bot này! Bot được thiết kế để cung cấp cho bạn dữ liệu cụ thể từ máy chủ và cho phép bạn thực hiện các thay đổi cần thiết.\r\n\r\n"
"start" = "👋 Xin chào <i>{{ .Firstname }}</i>.\r\n"
"welcome" = "🤖 Chào mừng đến với bot quản lý của <b>{{ .Hostname }}</b>.\r\n"
"status" = "✅ Bot hoạt động bình thường!"
"usage" = "❗ Vui lòng cung cấp văn bản để tìm kiếm!"
"getID" = "🆔 ID của bạn: <code>{{ .ID }}</code>"
"helpAdminCommands" = "Tìm kiếm email của khách hàng:\r\n<code>/usage [Email]</code>\r\n \r\nTìm kiếm inbounds (với thống kê của khách hàng):\r\n<code>/inbound [Ghi chú]</code>"
"helpClientCommands" = "Để tìm kiếm thống kê, hãy sử dụng lệnh sau:\r\n \r\n<code>/usage [UUID|Mật khẩu]</code>\r\n \r\nSử dụng UUID cho vmess/vless và Mật khẩu cho Trojan."
[tgbot.messages]
"cpuThreshold" = "🔴 Sử dụng CPU {{ .Percent }}% vượt quá ngưỡng {{ .Threshold }}%"
"loginSuccess" = "✅ Đăng nhập thành công vào bảng điều khiển.\r\n"
"loginFailed" = "❗️ Đăng nhập vào bảng không thành công.\r\n"
"report" = "🕰 Báo cáo theo lịch trình: {{ .RunTime }}\r\n"
"datetime" = "⏰ Ngày-Giờ: {{ .DateTime }}\r\n"
"hostname" = "💻 Tên máy chủ: {{ .Hostname }}\r\n"
"version" = "🚀 Phiên bản X-UI: {{ .Version }}\r\n"
"ipv6" = "🌐 IPv6: {{ .IPv6 }}\r\n"
"ipv4" = "🌐 IPv4: {{ .IPv4 }}\r\n"
"ip" = "🌐 IP: {{ .IP }}\r\n"
"serverUpTime" = "⏳ Thời gian hoạt động của máy chủ: {{ .UpTime }} {{ .Unit }}\r\n"
"serverLoad" = "📈 Tải máy chủ: {{ .Load1 }}, {{ .Load2 }}, {{ .Load3 }}\r\n"
"serverMemory" = "📋 Bộ nhớ máy chủ: {{ .Current }}/{{ .Total }}\r\n"
"tcpCount" = "🔹 TcpCount: {{ .Count }}\r\n"
"udpCount" = "🔸 UdpCount: {{ .Count }}\r\n"
"traffic" = "🚦 Giao thông: {{ .Total }} (↑{{ .Upload }},↓{{ .Download }})\r\n"
"xrayStatus" = " Tình trạng Xray: {{ .State }}\r\n"
"username" = "👤 Tên tài khoản: {{ .Username }}\r\n"
"time" = "⏰ Thời gian: {{ .Time }}\r\n"
"inbound" = "📍 Điểm vào: {{ .Remark }}\r\n"
"port" = "🔌 Cổng: {{ .Port }}\r\n"
"expire" = "📅 Hạn sử dụng: {{ .DateTime }}\r\n \r\n"
"expireIn" = "📅 Hết hạn vào: {{ .Time }}\r\n \r\n"
"active" = "💡 Có hiệu lực {{ .Enable }}\r\n"
"online" = "🌐 Tình trạng kết nối: {{ .Status }}\r\n"
"email" = "📧 Email: {{ .Email }}\r\n"
"upload" = "🔼 Tải lên↑: {{ .Upload }}\r\n"
"download" = "🔽 Tải xuống↓: {{ .Download }}\r\n"
"total" = "🔄 Tổng cộng: {{ .UpDown }} / {{ .Total }}\r\n"
"exhaustedMsg" = "🚨 Đã cạn kiệt {{ .Type }}:\r\n"
"exhaustedCount" = "🚨 Đã cạn kiệt {{ .Type }} count:\r\n"
"onlinesCount" = "🌐 Số lượng khách hàng trực tuyến: {{ .Count }}\r\n"
"disabled" = "🛑 Cấm sử dụng {{ .Disabled }}\r\n"
"depleteSoon" = "🔜 Sớm cạn kiệt: {{ .Deplete }}\r\n \r\n"
"backupTime" = "🗄 Thời gian sao lưu: {{ .Time }}\r\n"
"yes" = "✅ Yes"
"no" = "❌ No"
[tgbot.buttons]
"dbBackup" = "Tải Backup DB"
"serverUsage" = "Sử Dụng Máy Chủ"
"getInbounds" = "Lấy Inbounds"
"depleteSoon" = "Sắp Cạn Kiệt"
"clientUsage" = "Lấy Sử Dụng"
"onlines" = "Khách hàng trực tuyến"
"commands" = "Lệnh"
[tgbot.answers]
"getInboundsFailed" = "❌ Không vào được"
"askToAddUser" = "Không tìm thấy cấu hình của bạn!\r\nBạn nên định cấu hình tên người dùng telegram của mình và yêu cầu Quản trị viên thêm nó vào cấu hình của bạn."
"askToAddUserName" = "Không tìm thấy cấu hình của bạn!\r\nVui lòng yêu cầu Quản trị viên của bạn sử dụng tên người dùng telegram trong cấu hình của bạn(s).\r\n\r\nTên người dùng của bạn: <b>@{{ .TgUserName }}</b>"

View File

@@ -86,8 +86,8 @@
"operationHours" = "运行时间"
"operationHoursDesc" = "系统自启动以来的运行时间"
"systemLoad" = "系统负载"
"connectionCount" = "连接数"
"connectionCountDesc" = "所有网卡的总连接数"
"connectionTcpCountDesc" = "所有网卡的总 TCP 连接数"
"connectionUdpCountDesc" = "所有网卡的总 UDP 连接数"
"upSpeed" = "所有网卡的总上传速度"
"downSpeed" = "所有网卡的总下载速度"
"totalSent" = "系统启动以来所有网卡的总上传流量"
@@ -170,6 +170,10 @@
"subscriptionDesc" = "您可以在详细信息上找到您的子链接,也可以对多个配置使用相同的名称"
"info" = "信息"
"same" = "相同"
"inboundData" = "入站数据"
"copyToClipboard" = "复制到剪贴板"
"import"="导入"
"importInbound" = "导入入站"
[pages.client]
"add" = "添加客户端"
@@ -233,6 +237,8 @@
"panelUrlPathDesc" = "必须以 '/' 开头,以 '/' 结尾"
"pageSize" = "分页大小"
"pageSizeDesc" = "定义入站表的页面大小。设置 0 表示禁用"
"remarkModel" = "备注模型和分隔符"
"sampleRemark" = "备注示例"
"oldUsername" = "原用户名"
"currentPassword" = "原密码"
"newUsername" = "新用户名"
@@ -374,6 +380,7 @@
"editOutbound" = "编辑出站"
"editReverse" = "编辑反向"
"tag" = "标签"
"tagDesc" = "独特的标签"
"address" = "地址"
"rreverse" = "反转"
"domain" = "域名"

77
x-ui.sh
View File

@@ -612,28 +612,67 @@ ssl_cert_issue_CF() {
fi
}
update_geo() {
cd /usr/local/x-ui/bin
echo -e "${green}\t1.${plain} Update Geofiles [Recommended choice] "
echo -e "${green}\t2.${plain} Download from optional jsDelivr CDN "
echo -e "${green}\t0.${plain} Back To Main Menu "
read -p "Select: " select
case "$select" in
0)
show_menu
;;
1)
wget -N "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
wget -N "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
wget "https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat" -O /tmp/wget && mv /tmp/wget geoip_IR.dat && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
wget "https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat" -O /tmp/wget && mv /tmp/wget geosite_IR.dat && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
echo -e "${green}Files are updated.${plain}"
confirm_restart
;;
2)
wget -N "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat" && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
wget -N "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat" && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
wget "https://cdn.jsdelivr.net/gh/chocolate4u/Iran-v2ray-rules@release/geoip.dat" -O /tmp/wget && mv /tmp/wget geoip_IR.dat && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
wget "https://cdn.jsdelivr.net/gh/chocolate4u/Iran-v2ray-rules@release/geosite.dat" -O /tmp/wget && mv /tmp/wget geosite_IR.dat && echo -e "${green}Success${plain}\n" || echo -e "${red}Failure${plain}\n"
echo -e "${green}Files are updated.${plain}"
confirm_restart
;;
*)
LOGE "Please enter a correct number [0-2]\n"
update_geo
;;
esac
}
show_usage() {
echo "x-ui control menu usages: "
echo "X-UI Control Menu Usage"
echo "------------------------------------------"
echo "x-ui - Enter Admin menu"
echo "x-ui start - Start x-ui"
echo "x-ui stop - Stop x-ui"
echo "x-ui restart - Restart x-ui"
echo "x-ui status - Show x-ui status"
echo "x-ui enable - Enable x-ui on system startup"
echo "x-ui disable - Disable x-ui on system startup"
echo "x-ui log - Check x-ui logs"
echo "x-ui update - Update x-ui"
echo "x-ui install - Install x-ui"
echo "x-ui uninstall - Uninstall x-ui"
echo "SUBCOMMANDS:"
echo "x-ui - Admin management script"
echo "x-ui start - Start X-UI"
echo "x-ui stop - Stop X-UI"
echo "x-ui restart - Restart X-UI"
echo "x-ui status - Current X-UI status"
echo "x-ui enable - Enable X-UI on system startup"
echo "x-ui disable - Disable X-UI on system startup"
echo "x-ui log - Check X-UI logs"
echo "x-ui update - Update X-UI"
echo "x-ui install - Install X-UI"
echo "x-ui uninstall - Uninstall X-UI"
echo "x-ui help - Control menu usage"
echo "------------------------------------------"
}
show_menu() {
echo -e "
${green}X-UI Panel Management Script${plain}
${green}X-UI Admin Management Script ${plain}
————————————————
${green}0.${plain} Exit Script
${green}0.${plain} Exit
————————————————
${green}1.${plain} Install X-UI
${green}2.${plain} Update X-UI
@@ -646,7 +685,7 @@ show_menu() {
————————————————
${green}8.${plain} Start X-UI
${green}9.${plain} Stop X-UI
${green}10.${plain} Reboot X-UI
${green}10.${plain} Restart X-UI
${green}11.${plain} Check X-UI State
${green}12.${plain} Check X-UI Logs
————————————————
@@ -656,10 +695,11 @@ show_menu() {
${green}15.${plain} 一A Key Installation BBR (latest kernel)
${green}16.${plain} 一SSL Certificate Management
${green}17.${plain} 一Cloudflare SSL Certificate
${green}18.${plain} 一Update Geo files
————————————————
"
show_status
echo && read -p "Please enter your selection [0-17]: " num
echo && read -p "Please enter your selection [0-18]: " num
case "${num}" in
0)
@@ -716,8 +756,11 @@ show_menu() {
17)
ssl_cert_issue_CF
;;
18)
update_geo
;;
*)
LOGE "Please enter the correct number [0-16]"
LOGE "Please enter the correct number [0-18]"
;;
esac
}

53
xray/log_writer.go Normal file
View File

@@ -0,0 +1,53 @@
package xray
import (
"strings"
"x-ui/logger"
)
func NewLogWriter() *LogWriter {
return &LogWriter{}
}
type LogWriter struct {
lastLine string
}
func (lw *LogWriter) Write(m []byte) (n int, err error) {
// Convert the data to a string
message := strings.TrimSpace(string(m))
messages := strings.Split(message, "\n")
lw.lastLine = messages[len(messages)-1]
for _, msg := range messages {
// Remove timestamp
messageBody := strings.TrimSpace(strings.SplitN(msg, " ", 3)[2])
// Find level in []
startIndex := strings.Index(messageBody, "[")
endIndex := strings.Index(messageBody, "]")
if startIndex != -1 && endIndex != -1 {
level := strings.TrimSpace(messageBody[startIndex+1 : endIndex])
msgBody := "XRAY: " + strings.TrimSpace(messageBody[endIndex+1:])
// Map the level to the appropriate logger function
switch level {
case "Debug":
logger.Debug(msgBody)
case "Info":
logger.Info(msgBody)
case "Warning":
logger.Warning(msgBody)
case "Error":
logger.Error(msgBody)
default:
logger.Debug("XRAY: " + msg)
}
} else if msg != "" {
logger.Debug("XRAY: " + msg)
return len(m), nil
}
}
return len(m), nil
}

View File

@@ -1,7 +1,6 @@
package xray
import (
"bufio"
"bytes"
"encoding/json"
"errors"
@@ -10,13 +9,10 @@ import (
"os"
"os/exec"
"runtime"
"strings"
"syscall"
"time"
"x-ui/config"
"x-ui/util/common"
"github.com/Workiva/go-datastructures/queue"
)
func GetBinaryName() string {
@@ -62,7 +58,7 @@ type process struct {
onlineClients []string
config *Config
lines *queue.Queue
logWriter *LogWriter
exitErr error
startTime time.Time
}
@@ -71,7 +67,7 @@ func newProcess(config *Config) *process {
return &process{
version: "Unknown",
config: config,
lines: queue.New(100),
logWriter: NewLogWriter(),
startTime: time.Now(),
}
}
@@ -91,17 +87,10 @@ func (p *process) GetErr() error {
}
func (p *process) GetResult() string {
if p.lines.Empty() && p.exitErr != nil {
if len(p.logWriter.lastLine) == 0 && p.exitErr != nil {
return p.exitErr.Error()
}
items, _ := p.lines.TakeUntil(func(item interface{}) bool {
return true
})
lines := make([]string, 0, len(items))
for _, item := range items {
lines = append(lines, item.(string))
}
return strings.Join(lines, "\n")
return p.logWriter.lastLine
}
func (p *process) GetVersion() string {
@@ -176,50 +165,8 @@ func (p *process) Start() (err error) {
cmd := exec.Command(GetBinaryPath(), "-c", configPath)
p.cmd = cmd
stdReader, err := cmd.StdoutPipe()
if err != nil {
return err
}
errReader, err := cmd.StderrPipe()
if err != nil {
return err
}
go func() {
defer func() {
common.Recover("")
stdReader.Close()
}()
reader := bufio.NewReaderSize(stdReader, 8192)
for {
line, _, err := reader.ReadLine()
if err != nil {
return
}
if p.lines.Len() >= 100 {
p.lines.Get(1)
}
p.lines.Put(string(line))
}
}()
go func() {
defer func() {
common.Recover("")
errReader.Close()
}()
reader := bufio.NewReaderSize(errReader, 8192)
for {
line, _, err := reader.ReadLine()
if err != nil {
return
}
if p.lines.Len() >= 100 {
p.lines.Get(1)
}
p.lines.Put(string(line))
}
}()
cmd.Stdout = p.logWriter
cmd.Stderr = p.logWriter
go func() {
err := cmd.Run()