mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-27 02:24:40 +00:00
Compare commits
4 commits
b46a0b404b
...
0ffd27c0aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ffd27c0aa | ||
|
|
054cb1dea0 | ||
|
|
3757ae0b11 | ||
|
|
e3883fca87 |
57 changed files with 213 additions and 217 deletions
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
|
|
@ -11,4 +11,4 @@ issuehunt: # Replace with a single IssueHunt username
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
polar: # Replace with a single Polar username
|
polar: # Replace with a single Polar username
|
||||||
buy_me_a_coffee: mhsanaei
|
buy_me_a_coffee: mhsanaei
|
||||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
custom: https://nowpayments.io/donation/hsanaei
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,13 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.
|
||||||
|
|
||||||
**إذا كان هذا المشروع مفيدًا لك، فقد ترغب في إعطائه**:star2:
|
**إذا كان هذا المشروع مفيدًا لك، فقد ترغب في إعطائه**:star2:
|
||||||
|
|
||||||
<p align="left">
|
<a href="https://www.buymeacoffee.com/MHSanaei" target="_blank">
|
||||||
<a href="https://buymeacoffee.com/mhsanaei" target="_blank">
|
<img src="./media/default-yellow.png" alt="Buy Me A Coffee" style="height: 70px !important;width: 277px !important;" >
|
||||||
<img src="./media/buymeacoffe.png" alt="Image">
|
</a>
|
||||||
</a>
|
</br>
|
||||||
</p>
|
<a href="https://nowpayments.io/donation/hsanaei" target="_blank" rel="noreferrer noopener">
|
||||||
|
<img src="./media/donation-button-black.svg" alt="Crypto donation button by NOWPayments">
|
||||||
- USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
|
</a>
|
||||||
- POL (polygon): `0x41C9548675D044c6Bfb425786C765bc37427256A`
|
|
||||||
- LTC (Litecoin): `ltc1q2ach7x6d2zq0n4l0t4zl7d7xe2s6fs7a3vspwv`
|
|
||||||
|
|
||||||
## النجوم عبر الزمن
|
## النجوم عبر الزمن
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,14 @@ Para documentación completa, visita la [Wiki del proyecto](https://github.com/M
|
||||||
|
|
||||||
**Si este proyecto te es útil, puedes darle una**:star2:
|
**Si este proyecto te es útil, puedes darle una**:star2:
|
||||||
|
|
||||||
<p align="left">
|
<a href="https://www.buymeacoffee.com/MHSanaei" target="_blank">
|
||||||
<a href="https://buymeacoffee.com/mhsanaei" target="_blank">
|
<img src="./media/default-yellow.png" alt="Buy Me A Coffee" style="height: 70px !important;width: 277px !important;" >
|
||||||
<img src="./media/buymeacoffe.png" alt="Image">
|
</a>
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
- USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
|
</br>
|
||||||
- POL (polygon): `0x41C9548675D044c6Bfb425786C765bc37427256A`
|
<a href="https://nowpayments.io/donation/hsanaei" target="_blank" rel="noreferrer noopener">
|
||||||
- LTC (Litecoin): `ltc1q2ach7x6d2zq0n4l0t4zl7d7xe2s6fs7a3vspwv`
|
<img src="./media/donation-button-black.svg" alt="Crypto donation button by NOWPayments">
|
||||||
|
</a>
|
||||||
|
|
||||||
## Estrellas a lo Largo del Tiempo
|
## Estrellas a lo Largo del Tiempo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,14 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.
|
||||||
|
|
||||||
**اگر این پروژه برای شما مفید است، میتوانید به آن یک**:star2: بدهید
|
**اگر این پروژه برای شما مفید است، میتوانید به آن یک**:star2: بدهید
|
||||||
|
|
||||||
<p align="left">
|
<a href="https://www.buymeacoffee.com/MHSanaei" target="_blank">
|
||||||
<a href="https://buymeacoffee.com/mhsanaei" target="_blank">
|
<img src="./media/default-yellow.png" alt="Buy Me A Coffee" style="height: 70px !important;width: 277px !important;" >
|
||||||
<img src="./media/buymeacoffe.png" alt="Image">
|
</a>
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
- USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
|
</br>
|
||||||
- POL (polygon): `0x41C9548675D044c6Bfb425786C765bc37427256A`
|
<a href="https://nowpayments.io/donation/hsanaei" target="_blank" rel="noreferrer noopener">
|
||||||
- LTC (Litecoin): `ltc1q2ach7x6d2zq0n4l0t4zl7d7xe2s6fs7a3vspwv`
|
<img src="./media/donation-button-black.svg" alt="Crypto donation button by NOWPayments">
|
||||||
|
</a>
|
||||||
|
|
||||||
## ستارهها در طول زمان
|
## ستارهها در طول زمان
|
||||||
|
|
||||||
|
|
|
||||||
15
README.md
15
README.md
|
|
@ -41,15 +41,14 @@ For full documentation, please visit the [project Wiki](https://github.com/MHSan
|
||||||
|
|
||||||
**If this project is helpful to you, you may wish to give it a**:star2:
|
**If this project is helpful to you, you may wish to give it a**:star2:
|
||||||
|
|
||||||
<p align="left">
|
<a href="https://www.buymeacoffee.com/MHSanaei" target="_blank">
|
||||||
<a href="https://buymeacoffee.com/mhsanaei" target="_blank">
|
<img src="./media/default-yellow.png" alt="Buy Me A Coffee" style="height: 70px !important;width: 277px !important;" >
|
||||||
<img src="./media/buymeacoffe.png" alt="Image">
|
</a>
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
- USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
|
</br>
|
||||||
- POL (polygon): `0x41C9548675D044c6Bfb425786C765bc37427256A`
|
<a href="https://nowpayments.io/donation/hsanaei" target="_blank" rel="noreferrer noopener">
|
||||||
- LTC (Litecoin): `ltc1q2ach7x6d2zq0n4l0t4zl7d7xe2s6fs7a3vspwv`
|
<img src="./media/donation-button-black.svg" alt="Crypto donation button by NOWPayments">
|
||||||
|
</a>
|
||||||
|
|
||||||
## Stargazers over Time
|
## Stargazers over Time
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,14 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.
|
||||||
|
|
||||||
**Если этот проект полезен для вас, вы можете поставить ему**:star2:
|
**Если этот проект полезен для вас, вы можете поставить ему**:star2:
|
||||||
|
|
||||||
<p align="left">
|
<a href="https://www.buymeacoffee.com/MHSanaei" target="_blank">
|
||||||
<a href="https://buymeacoffee.com/mhsanaei" target="_blank">
|
<img src="./media/default-yellow.png" alt="Buy Me A Coffee" style="height: 70px !important;width: 277px !important;" >
|
||||||
<img src="./media/buymeacoffe.png" alt="Image">
|
</a>
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
- USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
|
</br>
|
||||||
- POL (polygon): `0x41C9548675D044c6Bfb425786C765bc37427256A`
|
<a href="https://nowpayments.io/donation/hsanaei" target="_blank" rel="noreferrer noopener">
|
||||||
- LTC (Litecoin): `ltc1q2ach7x6d2zq0n4l0t4zl7d7xe2s6fs7a3vspwv`
|
<img src="./media/donation-button-black.svg" alt="Crypto donation button by NOWPayments">
|
||||||
|
</a>
|
||||||
|
|
||||||
## Звезды с течением времени
|
## Звезды с течением времени
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,14 @@ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.
|
||||||
|
|
||||||
**如果这个项目对您有帮助,您可以给它一个**:star2:
|
**如果这个项目对您有帮助,您可以给它一个**:star2:
|
||||||
|
|
||||||
<p align="left">
|
<a href="https://www.buymeacoffee.com/MHSanaei" target="_blank">
|
||||||
<a href="https://buymeacoffee.com/mhsanaei" target="_blank">
|
<img src="./media/default-yellow.png" alt="Buy Me A Coffee" style="height: 70px !important;width: 277px !important;" >
|
||||||
<img src="./media/buymeacoffe.png" alt="Image">
|
</a>
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
- USDT (TRC20): `TXncxkvhkDWGts487Pjqq1qT9JmwRUz8CC`
|
</br>
|
||||||
- POL (polygon): `0x41C9548675D044c6Bfb425786C765bc37427256A`
|
<a href="https://nowpayments.io/donation/hsanaei" target="_blank" rel="noreferrer noopener">
|
||||||
- LTC (Litecoin): `ltc1q2ach7x6d2zq0n4l0t4zl7d7xe2s6fs7a3vspwv`
|
<img src="./media/donation-button-black.svg" alt="Crypto donation button by NOWPayments">
|
||||||
|
</a>
|
||||||
|
|
||||||
## 随时间变化的星标数
|
## 随时间变化的星标数
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
2.8.1
|
2.8.2
|
||||||
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/util/crypto"
|
"github.com/mhsanaei/3x-ui/util/crypto"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"gorm.io/driver/sqlite"
|
"gorm.io/driver/sqlite"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
@ -141,6 +141,9 @@ func InitDB(dbPath string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
isUsersEmpty, err := isTableEmpty("users")
|
isUsersEmpty, err := isTableEmpty("users")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if err := initUser(); err != nil {
|
if err := initUser(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ package model
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"x-ui/util/json_util"
|
"github.com/mhsanaei/3x-ui/util/json_util"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Protocol string
|
type Protocol string
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
||||||
module x-ui
|
module github.com/mhsanaei/3x-ui
|
||||||
|
|
||||||
go 1.25.1
|
go 1.25.1
|
||||||
|
|
||||||
|
|
|
||||||
16
main.go
16
main.go
|
|
@ -9,14 +9,14 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
_ "unsafe"
|
_ "unsafe"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/sub"
|
"github.com/mhsanaei/3x-ui/sub"
|
||||||
"x-ui/util/crypto"
|
"github.com/mhsanaei/3x-ui/util/crypto"
|
||||||
"x-ui/web"
|
"github.com/mhsanaei/3x-ui/web"
|
||||||
"x-ui/web/global"
|
"github.com/mhsanaei/3x-ui/web/global"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
"github.com/op/go-logging"
|
"github.com/op/go-logging"
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.1 KiB |
BIN
media/default-yellow.png
Normal file
BIN
media/default-yellow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
1
media/donation-button-black.svg
Normal file
1
media/donation-button-black.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 10 KiB |
14
sub/sub.go
14
sub/sub.go
|
|
@ -13,13 +13,13 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
webpkg "x-ui/web"
|
webpkg "github.com/mhsanaei/3x-ui/web"
|
||||||
"x-ui/web/locale"
|
"github.com/mhsanaei/3x-ui/web/locale"
|
||||||
"x-ui/web/middleware"
|
"github.com/mhsanaei/3x-ui/web/middleware"
|
||||||
"x-ui/web/network"
|
"github.com/mhsanaei/3x-ui/web/network"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"x-ui/config"
|
|
||||||
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/json_util"
|
"github.com/mhsanaei/3x-ui/util/json_util"
|
||||||
"x-ui/util/random"
|
"github.com/mhsanaei/3x-ui/util/random"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed default.json
|
//go:embed default.json
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@ import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/goccy/go-json"
|
"github.com/goccy/go-json"
|
||||||
|
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/util/random"
|
"github.com/mhsanaei/3x-ui/util/random"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SubService struct {
|
type SubService struct {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewErrorf(format string, a ...any) error {
|
func NewErrorf(format string, a ...any) error {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@ package controller
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/web/locale"
|
"github.com/mhsanaei/3x-ui/web/locale"
|
||||||
"x-ui/web/session"
|
"github.com/mhsanaei/3x-ui/web/session"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
"x-ui/web/session"
|
"github.com/mhsanaei/3x-ui/web/session"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,18 @@ import (
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
"x-ui/web/session"
|
"github.com/mhsanaei/3x-ui/web/session"
|
||||||
|
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LoginForm struct {
|
type LoginForm struct {
|
||||||
Username string `json:"username" form:"username"`
|
Username string `json:"username" form:"username"`
|
||||||
Password string `json:"password" form:"password"`
|
Password string `json:"password" form:"password"`
|
||||||
TwoFactorCode string `json:"twoFactorCode" form:"twoFactorCode"`
|
TwoFactorCode string `json:"twoFactorCode" form:"twoFactorCode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type IndexController struct {
|
type IndexController struct {
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/web/global"
|
"github.com/mhsanaei/3x-ui/web/global"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/util/crypto"
|
"github.com/mhsanaei/3x-ui/util/crypto"
|
||||||
"x-ui/web/entity"
|
"github.com/mhsanaei/3x-ui/web/entity"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
"x-ui/web/session"
|
"github.com/mhsanaei/3x-ui/web/session"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/web/entity"
|
"github.com/mhsanaei/3x-ui/web/entity"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Msg struct {
|
type Msg struct {
|
||||||
|
|
|
||||||
|
|
@ -431,12 +431,12 @@
|
||||||
CPU History
|
CPU History
|
||||||
<a-select size="small" v-model="cpuHistoryModal.bucket" class="ml-10" style="width: 80px"
|
<a-select size="small" v-model="cpuHistoryModal.bucket" class="ml-10" style="width: 80px"
|
||||||
@change="fetchCpuHistoryBucket">
|
@change="fetchCpuHistoryBucket">
|
||||||
<a-select-option :value="2">2s</a-select-option>
|
<a-select-option :value="2">2m</a-select-option>
|
||||||
<a-select-option :value="30">30s</a-select-option>
|
<a-select-option :value="30">30m</a-select-option>
|
||||||
<a-select-option :value="60">1m</a-select-option>
|
<a-select-option :value="60">1h</a-select-option>
|
||||||
<a-select-option :value="120">2m</a-select-option>
|
<a-select-option :value="120">2h</a-select-option>
|
||||||
<a-select-option :value="180">3m</a-select-option>
|
<a-select-option :value="180">3h</a-select-option>
|
||||||
<a-select-option :value="300">5m</a-select-option>
|
<a-select-option :value="300">5h</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
<div style="padding:16px">
|
<div style="padding:16px">
|
||||||
|
|
@ -1124,4 +1124,4 @@
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{{ template "page/body_end" .}}
|
{{ template "page/body_end" .}}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,10 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CheckClientIpJob struct {
|
type CheckClientIpJob struct {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/shirou/gopsutil/v4/cpu"
|
"github.com/shirou/gopsutil/v4/cpu"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package job
|
package job
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CheckHashStorageJob struct {
|
type CheckHashStorageJob struct {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package job
|
package job
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CheckXrayRunningJob struct {
|
type CheckXrayRunningJob struct {
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ClearLogsJob struct{}
|
type ClearLogsJob struct{}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package job
|
package job
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Period string
|
type Period string
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package job
|
package job
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LoginStatus byte
|
type LoginStatus byte
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,10 @@ package job
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"x-ui/logger"
|
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"github.com/valyala/fasthttp"
|
"github.com/valyala/fasthttp"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
@ -1953,7 +1953,6 @@ func (s *InboundService) GetClientTrafficByEmail(email string) (traffic *xray.Cl
|
||||||
if t != nil && client != nil {
|
if t != nil && client != nil {
|
||||||
t.Enable = client.Enable
|
t.Enable = client.Enable
|
||||||
t.SubId = client.SubID
|
t.SubId = client.SubID
|
||||||
t.UUID = client.ID
|
|
||||||
return t, nil
|
return t, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|
@ -1995,7 +1994,6 @@ func (s *InboundService) GetClientTrafficByID(id string) ([]xray.ClientTraffic,
|
||||||
if ct, client, e := s.GetClientByEmail(traffics[i].Email); e == nil && ct != nil && client != nil {
|
if ct, client, e := s.GetClientByEmail(traffics[i].Email); e == nil && ct != nil && client != nil {
|
||||||
traffics[i].Enable = client.Enable
|
traffics[i].Enable = client.Enable
|
||||||
traffics[i].SubId = client.SubID
|
traffics[i].SubId = client.SubID
|
||||||
traffics[i].UUID = client.ID
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return traffics, err
|
return traffics, err
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PanelService struct{}
|
type PanelService struct{}
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,12 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/util/sys"
|
"github.com/mhsanaei/3x-ui/util/sys"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/shirou/gopsutil/v4/cpu"
|
"github.com/shirou/gopsutil/v4/cpu"
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/util/random"
|
"github.com/mhsanaei/3x-ui/util/random"
|
||||||
"x-ui/util/reflect_util"
|
"github.com/mhsanaei/3x-ui/util/reflect_util"
|
||||||
"x-ui/web/entity"
|
"github.com/mhsanaei/3x-ui/web/entity"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed config.json
|
//go:embed config.json
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,14 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/web/global"
|
"github.com/mhsanaei/3x-ui/web/global"
|
||||||
"x-ui/web/locale"
|
"github.com/mhsanaei/3x-ui/web/locale"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/mymmrac/telego"
|
"github.com/mymmrac/telego"
|
||||||
|
|
@ -1581,23 +1581,6 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
||||||
)
|
)
|
||||||
prompt_message := t.I18nBot("tgbot.messages.comment_prompt", "ClientComment=="+client_Comment)
|
prompt_message := t.I18nBot("tgbot.messages.comment_prompt", "ClientComment=="+client_Comment)
|
||||||
t.SendMsgToTgbot(chatId, prompt_message, cancel_btn_markup)
|
t.SendMsgToTgbot(chatId, prompt_message, cancel_btn_markup)
|
||||||
default:
|
|
||||||
// dynamic callbacks
|
|
||||||
if strings.HasPrefix(callbackQuery.Data, "client_sub_links ") {
|
|
||||||
email := strings.TrimPrefix(callbackQuery.Data, "client_sub_links ")
|
|
||||||
t.sendClientSubLinks(chatId, email)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(callbackQuery.Data, "client_individual_links ") {
|
|
||||||
email := strings.TrimPrefix(callbackQuery.Data, "client_individual_links ")
|
|
||||||
t.sendClientIndividualLinks(chatId, email)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if strings.HasPrefix(callbackQuery.Data, "client_qr_links ") {
|
|
||||||
email := strings.TrimPrefix(callbackQuery.Data, "client_qr_links ")
|
|
||||||
t.sendClientQRLinks(chatId, email)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
case "add_client_ch_default_traffic":
|
case "add_client_ch_default_traffic":
|
||||||
inlineKeyboard := tu.InlineKeyboard(
|
inlineKeyboard := tu.InlineKeyboard(
|
||||||
tu.InlineKeyboardRow(
|
tu.InlineKeyboardRow(
|
||||||
|
|
@ -1813,6 +1796,22 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
||||||
t.SendMsgToTgbot(chatId, msg, tu.ReplyKeyboardRemove())
|
t.SendMsgToTgbot(chatId, msg, tu.ReplyKeyboardRemove())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
if after, ok := strings.CutPrefix(callbackQuery.Data, "client_sub_links "); ok {
|
||||||
|
email := after
|
||||||
|
t.sendClientSubLinks(chatId, email)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if after, ok := strings.CutPrefix(callbackQuery.Data, "client_individual_links "); ok {
|
||||||
|
email := after
|
||||||
|
t.sendClientIndividualLinks(chatId, email)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if after, ok := strings.CutPrefix(callbackQuery.Data, "client_qr_links "); ok {
|
||||||
|
email := after
|
||||||
|
t.sendClientQRLinks(chatId, email)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ package service
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"x-ui/database"
|
"github.com/mhsanaei/3x-ui/database"
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/crypto"
|
"github.com/mhsanaei/3x-ui/util/crypto"
|
||||||
|
|
||||||
"github.com/xlzd/gotp"
|
"github.com/xlzd/gotp"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
"x-ui/logger"
|
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WarpService struct {
|
type WarpService struct {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
|
|
||||||
"go.uber.org/atomic"
|
"go.uber.org/atomic"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/xray"
|
"github.com/mhsanaei/3x-ui/xray"
|
||||||
)
|
)
|
||||||
|
|
||||||
type XraySettingService struct {
|
type XraySettingService struct {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"x-ui/database/model"
|
"github.com/mhsanaei/3x-ui/database/model"
|
||||||
|
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
|
||||||
18
web/web.go
18
web/web.go
|
|
@ -14,15 +14,15 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
"x-ui/web/controller"
|
"github.com/mhsanaei/3x-ui/web/controller"
|
||||||
"x-ui/web/job"
|
"github.com/mhsanaei/3x-ui/web/job"
|
||||||
"x-ui/web/locale"
|
"github.com/mhsanaei/3x-ui/web/locale"
|
||||||
"x-ui/web/middleware"
|
"github.com/mhsanaei/3x-ui/web/middleware"
|
||||||
"x-ui/web/network"
|
"github.com/mhsanaei/3x-ui/web/network"
|
||||||
"x-ui/web/service"
|
"github.com/mhsanaei/3x-ui/web/service"
|
||||||
|
|
||||||
"github.com/gin-contrib/gzip"
|
"github.com/gin-contrib/gzip"
|
||||||
"github.com/gin-contrib/sessions"
|
"github.com/gin-contrib/sessions"
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
"math"
|
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
|
|
||||||
"github.com/xtls/xray-core/app/proxyman/command"
|
"github.com/xtls/xray-core/app/proxyman/command"
|
||||||
statsService "github.com/xtls/xray-core/app/stats/command"
|
statsService "github.com/xtls/xray-core/app/stats/command"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ type ClientTraffic struct {
|
||||||
InboundId int `json:"inboundId" form:"inboundId"`
|
InboundId int `json:"inboundId" form:"inboundId"`
|
||||||
Enable bool `json:"enable" form:"enable"`
|
Enable bool `json:"enable" form:"enable"`
|
||||||
Email string `json:"email" form:"email" gorm:"unique"`
|
Email string `json:"email" form:"email" gorm:"unique"`
|
||||||
UUID string `json:"uuid" form:"uuid" gorm:"unique;type:char(36)"`
|
|
||||||
SubId string `json:"subId" form:"subId" gorm:"-"`
|
SubId string `json:"subId" form:"subId" gorm:"-"`
|
||||||
Up int64 `json:"up" form:"up"`
|
Up int64 `json:"up" form:"up"`
|
||||||
Down int64 `json:"down" form:"down"`
|
Down int64 `json:"down" form:"down"`
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package xray
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"x-ui/util/json_util"
|
"github.com/mhsanaei/3x-ui/util/json_util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package xray
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
"x-ui/util/json_util"
|
"github.com/mhsanaei/3x-ui/util/json_util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InboundConfig struct {
|
type InboundConfig struct {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewLogWriter() *LogWriter {
|
func NewLogWriter() *LogWriter {
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"x-ui/config"
|
"github.com/mhsanaei/3x-ui/config"
|
||||||
"x-ui/logger"
|
"github.com/mhsanaei/3x-ui/logger"
|
||||||
"x-ui/util/common"
|
"github.com/mhsanaei/3x-ui/util/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetBinaryName() string {
|
func GetBinaryName() string {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue