diff --git a/config/version b/config/version index bd4053bf..68167133 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -2.6.3 \ No newline at end of file +2.6.5 \ No newline at end of file diff --git a/install.sh b/install.sh index e5af427a..df086026 100644 --- a/install.sh +++ b/install.sh @@ -40,21 +40,22 @@ arch() { esac } +echo "Arch: $(arch)" echo "" -check_glibc_version() { - glibc_version=$(ldd --version | head -n1 | awk '{print $NF}') +# check_glibc_version() { +# glibc_version=$(ldd --version | head -n1 | awk '{print $NF}') - required_version="2.32" - if [[ "$(printf '%s\n' "$required_version" "$glibc_version" | sort -V | head -n1)" != "$required_version" ]]; then - echo -e "${red}------>>>GLIBC版本 $glibc_version 太旧了! 要求2.32或以上版本${plain}" - echo -e "${green}-------->>>>请升级到较新版本的操作系统以便获取更高版本的GLIBC${plain}" - exit 1 - fi - echo -e "${green}-------->>>>GLIBC版本: $glibc_version(符合高于2.32的要求)${plain}" -} -check_glibc_version +# required_version="2.32" +# if [[ "$(printf '%s\n' "$required_version" "$glibc_version" | sort -V | head -n1)" != "$required_version" ]]; then +# echo -e "${red}------>>>GLIBC版本 $glibc_version 太旧了! 要求2.32或以上版本${plain}" +# echo -e "${green}-------->>>>请升级到较新版本的操作系统以便获取更高版本的GLIBC${plain}" +# exit 1 +# fi +# echo -e "${green}-------->>>>GLIBC版本: $glibc_version(符合高于2.32的要求)${plain}" +# } +# check_glibc_version -echo "" +# echo "" echo -e "${yellow}---------->>>>>当前系统的架构为: $(arch)${plain}" echo "" last_version=$(curl -Ls "https://api.github.com/repos/xeefei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index e75385ea..99bec8ba 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -2312,12 +2312,14 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { protocol, address, port, + portMap = [], network = 'tcp,udp', followRedirect = false ) { super(protocol); this.address = address; this.port = port; + this.portMap = portMap; this.network = network; this.followRedirect = followRedirect; } @@ -2327,6 +2329,7 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { Protocols.DOKODEMO, json.address, json.port, + XrayCommonClass.toHeaders(json.portMap), json.network, json.followRedirect, ); @@ -2336,6 +2339,7 @@ Inbound.DokodemoSettings = class extends Inbound.Settings { return { address: this.address, port: this.port, + portMap: XrayCommonClass.toV2Headers(this.portMap, false), network: this.network, followRedirect: this.followRedirect, }; diff --git a/web/controller/inbound.go b/web/controller/inbound.go index a89f224f..851b4b6f 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -108,8 +108,8 @@ func (a *InboundController) addInbound(c *gin.Context) { jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err) return } - jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundCreateSuccess"), inbound, err) - if err == nil && needRestart { + jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundCreateSuccess"), inbound, nil) + if needRestart { a.xrayService.SetToNeedRestart() } } @@ -126,8 +126,8 @@ func (a *InboundController) delInbound(c *gin.Context) { jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err) return } - jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundDeleteSuccess"), id, err) - if err == nil && needRestart { + jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundDeleteSuccess"), id, nil) + if needRestart { a.xrayService.SetToNeedRestart() } } @@ -152,8 +152,8 @@ func (a *InboundController) updateInbound(c *gin.Context) { jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err) return } - jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), inbound, err) - if err == nil && needRestart { + jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), inbound, nil) + if needRestart { a.xrayService.SetToNeedRestart() } } @@ -342,25 +342,25 @@ func (a *InboundController) onlines(c *gin.Context) { func (a *InboundController) updateClientTraffic(c *gin.Context) { email := c.Param("email") - + // Define the request structure for traffic update type TrafficUpdateRequest struct { Upload int64 `json:"upload"` Download int64 `json:"download"` } - + var request TrafficUpdateRequest err := c.ShouldBindJSON(&request) if err != nil { jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), err) return } - + err = a.inboundService.UpdateClientTrafficByEmail(email, request.Upload, request.Download) if err != nil { jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err) return } - + jsonMsg(c, I18nWeb(c, "pages.inbounds.toasts.inboundClientUpdateSuccess"), nil) } diff --git a/web/controller/server.go b/web/controller/server.go index 8a7a2198..dd001f5e 100644 --- a/web/controller/server.go +++ b/web/controller/server.go @@ -46,6 +46,7 @@ func (a *ServerController) initRouter(g *gin.RouterGroup) { g.POST("/installXray/:version", a.installXray) g.POST("/updateGeofile/:fileName", a.updateGeofile) g.POST("/logs/:count", a.getLogs) + g.POST("/xraylogs/:count", a.getXrayLogs) g.POST("/getConfigJson", a.getConfigJson) g.GET("/getDb", a.getDb) g.POST("/importDB", a.importDB) @@ -134,6 +135,12 @@ func (a *ServerController) getLogs(c *gin.Context) { jsonObj(c, logs, nil) } +func (a *ServerController) getXrayLogs(c *gin.Context) { + count := c.Param("count") + logs := a.serverService.GetXrayLogs(count) + jsonObj(c, logs, nil) +} + func (a *ServerController) getConfigJson(c *gin.Context) { configJson, err := a.serverService.GetConfigJson() if err != nil { diff --git a/web/html/form/client.html b/web/html/form/client.html index 846bbd13..908f28d2 100644 --- a/web/html/form/client.html +++ b/web/html/form/client.html @@ -44,7 +44,7 @@ [[ key ]] - +