From 826c7264b5cbea4e4149645bef220fd3c6a010e7 Mon Sep 17 00:00:00 2001
From: MHSanaei <33454419+MHSanaei@users.noreply.github.com>
Date: Fri, 24 Mar 2023 17:13:31 +0330
Subject: [PATCH] Add version and log
TGBOT: Add xray config to backup
[TGBOT] add seach inbound
---
web/controller/server.go | 21 ++++----------
web/html/xui/index.html | 47 ++++--------------------------
web/html/xui/setting.html | 4 +--
web/service/inbound.go | 10 -------
web/service/server.go | 47 +++++++-----------------------
web/service/tgbot.go | 60 +++++----------------------------------
6 files changed, 31 insertions(+), 158 deletions(-)
diff --git a/web/controller/server.go b/web/controller/server.go
index 7b7239d5..673a96d8 100644
--- a/web/controller/server.go
+++ b/web/controller/server.go
@@ -1,11 +1,10 @@
package controller
import (
+ "github.com/gin-gonic/gin"
"time"
"x-ui/web/global"
"x-ui/web/service"
-
- "github.com/gin-gonic/gin"
)
type ServerController struct {
@@ -38,7 +37,6 @@ func (a *ServerController) initRouter(g *gin.RouterGroup) {
g.POST("/stopXrayService", a.stopXrayService)
g.POST("/restartXrayService", a.restartXrayService)
g.POST("/installXray/:version", a.installXray)
- g.POST("/logs", a.getLogs)
}
func (a *ServerController) refreshStatus() {
@@ -89,13 +87,13 @@ func (a *ServerController) installXray(c *gin.Context) {
}
func (a *ServerController) stopXrayService(c *gin.Context) {
- a.lastGetStatusTime = time.Now()
+ a.lastGetStatusTime = time.Now()
err := a.serverService.StopXrayService()
if err != nil {
jsonMsg(c, "", err)
return
}
- jsonMsg(c, "Xray stoped", err)
+ jsonMsg(c, "Xray stoped",err)
}
func (a *ServerController) restartXrayService(c *gin.Context) {
@@ -104,15 +102,6 @@ func (a *ServerController) restartXrayService(c *gin.Context) {
jsonMsg(c, "", err)
return
}
- jsonMsg(c, "Xray restarted", err)
+ jsonMsg(c, "Xray restarted",err)
-}
-
-func (a *ServerController) getLogs(c *gin.Context) {
- logs, err := a.serverService.GetLogs()
- if err != nil {
- jsonMsg(c, I18n(c, "getLogs"), err)
- return
- }
- jsonObj(c, logs, nil)
-}
+}
\ No newline at end of file
diff --git a/web/html/xui/index.html b/web/html/xui/index.html
index 713d5b7e..b8a1e4b5 100644
--- a/web/html/xui/index.html
+++ b/web/html/xui/index.html
@@ -84,18 +84,16 @@
- [[ status.xray.version ]]
- {{ i18n "pages.index.stopXray" }}
- {{ i18n "pages.index.restartXray" }}
- {{ i18n "pages.index.xraySwitch" }}
+ [[ status.xray.version ]]
+ {{ i18n "pages.index.stopXray" }}
+ {{ i18n "pages.index.restartXray" }}
+ {{ i18n "pages.index.xraySwitch" }}
- x-ui: {{ .cur_ver }}
- Logs
{{ i18n "pages.index.operationHours" }}:
- [[ formatSecond(status.uptime) ]]
+ [[ formatSecond(status.uptime) ]]
{{ i18n "pages.index.operationHoursDesc" }}
@@ -179,7 +177,7 @@
versionModal.visible = false"
:class="siderDrawer.isDarkTheme ? darkClass : ''"
- footer="">
+ ok-text='{{ i18n "confirm" }}' cancel-text='{{ i18n "cancel"}}'>
{{ i18n "pages.index.xraySwitchClick"}}
{{ i18n "pages.index.xraySwitchClickDesk"}}
@@ -189,17 +187,6 @@
- logModal.visible = false" @cancel="() => logModal.visible = false"
- :class="siderDrawer.isDarkTheme ? darkClass : ''"
- width="800px"
- footer="">
-
-
- [[ index ]] | [[ log ]] |
-
-
-
{{template "js" .}}