Merge branch 'main' into 3x-ui
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"log": {
|
||||
"access": "none",
|
||||
"dnsLog": false,
|
||||
"error": "",
|
||||
"loglevel": "warning",
|
||||
"access": "./access.log",
|
||||
"dnsLog": true,
|
||||
"error": "./error.log",
|
||||
"loglevel": "debug",
|
||||
"maskAddress": ""
|
||||
},
|
||||
"api": {
|
||||
|
||||
@@ -397,6 +397,8 @@ func (s *InboundService) UpdateInbound(inbound *model.Inbound) (*model.Inbound,
|
||||
oldInbound.Remark = inbound.Remark
|
||||
oldInbound.Enable = inbound.Enable
|
||||
oldInbound.ExpiryTime = inbound.ExpiryTime
|
||||
// 中文注释:确保在更新数据时,将前端传来的 deviceLimit 值赋给从数据库中读出的旧对象。
|
||||
oldInbound.DeviceLimit = inbound.DeviceLimit
|
||||
oldInbound.Listen = inbound.Listen
|
||||
oldInbound.Port = inbound.Port
|
||||
oldInbound.Protocol = inbound.Protocol
|
||||
|
||||
@@ -47,7 +47,7 @@ var defaultValueMap = map[string]string{
|
||||
"tgBotBackup": "false",
|
||||
"tgBotLoginNotify": "true",
|
||||
"tgCpu": "80",
|
||||
"tgLang": "en-US",
|
||||
"tgLang": "zh-CN",
|
||||
"twoFactorEnable": "false",
|
||||
"twoFactorToken": "",
|
||||
"subEnable": "false",
|
||||
|
||||
@@ -26,10 +26,24 @@ type XrayService struct {
|
||||
xrayAPI xray.XrayAPI
|
||||
}
|
||||
|
||||
// IsXrayRunning 检查 Xray 是否正在运行
|
||||
func (s *XrayService) IsXrayRunning() bool {
|
||||
return p != nil && p.IsRunning()
|
||||
}
|
||||
|
||||
// 中文注释:
|
||||
// 新增 GetApiPort 函数。
|
||||
// 这个函数的作用是安全地返回当前 Xray 进程正在监听的 API 端口号。
|
||||
// 如果 Xray 没有运行 (p == nil),则返回 0。
|
||||
// 我们的后台任务将调用这个函数来获取端口号。
|
||||
func (s *XrayService) GetApiPort() int {
|
||||
if p == nil {
|
||||
return 0
|
||||
}
|
||||
return p.GetAPIPort()
|
||||
}
|
||||
|
||||
|
||||
func (s *XrayService) GetXrayErr() error {
|
||||
if p == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user