diff --git a/web/controller/server.go b/web/controller/server.go index 673a96d8..7b7239d5 100644 --- a/web/controller/server.go +++ b/web/controller/server.go @@ -1,10 +1,11 @@ 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 { @@ -37,6 +38,7 @@ 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() { @@ -87,13 +89,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) { @@ -102,6 +104,15 @@ func (a *ServerController) restartXrayService(c *gin.Context) { jsonMsg(c, "", err) return } - jsonMsg(c, "Xray restarted",err) + jsonMsg(c, "Xray restarted", err) -} \ No newline at end of file +} + +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) +} diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index e535b401..f492dabb 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -1,9 +1,10 @@ {{define "qrcodeModal"}} - {{ i18n "pages.inbounds.clickOnQRcode" }} + :footer="null" + width="300px"> + {{ i18n "pages.inbounds.clickOnQRcode" }} @@ -14,17 +15,15 @@ content: '', inbound: new Inbound(), dbInbound: new DBInbound(), - okText: '', copyText: '', qrcode: null, clipboard: null, visible: false, - show: function (title='', content='', dbInbound=new DBInbound(),okText='{{ i18n "copy" }}', copyText='') { + show: function (title='', content='', dbInbound=new DBInbound(), copyText='') { this.title = title; this.content = content; this.dbInbound = dbInbound; this.inbound = dbInbound.toInbound(); - this.okText = okText; if (ObjectUtil.isEmpty(copyText)) { this.copyText = content; } else { @@ -32,13 +31,6 @@ } this.visible = true; qrModalApp.$nextTick(() => { - this.clipboard = new ClipboardJS('#qr-modal-ok-btn', { - text: () => this.copyText, - }); - this.clipboard.on('success', () => { - app.$message.success('{{ i18n "copied" }}') - this.clipboard.destroy(); - }); if (this.qrcode === null) { this.qrcode = new QRious({ element: document.querySelector('#qrCode'), diff --git a/web/html/xui/client_bulk_modal.html b/web/html/xui/client_bulk_modal.html index 19fd4b18..2024fa1d 100644 --- a/web/html/xui/client_bulk_modal.html +++ b/web/html/xui/client_bulk_modal.html @@ -7,10 +7,11 @@ Random - Random_Prefix - Random_Prefix+Num - Random_Prefix+Num+Postfix - Random_Prefix+Num@Telegram Username + Random+Prefix + Random+Prefix+Num + Random+Prefix+Num+Postfix + Random+Prefix+Num@Telegram Username + Prefix+Num+Postfix [ BE CAREFUL! ]
@@ -91,11 +92,12 @@ start=0; end=clientsBulkModal.quantity; } - prefix = (method>0 && clientsBulkModal.emailPrefix.length>0) ? "_" + clientsBulkModal.emailPrefix : ""; + prefix = (method>0 && clientsBulkModal.emailPrefix.length>0) ? clientsBulkModal.emailPrefix : ""; useNum=(method>1); postfix = (method>2 && clientsBulkModal.emailPostfix.length>0) ? (method == 4 ? "@" : "") + clientsBulkModal.emailPostfix : ""; for (let i = start; i < end; i++) { newClient = clientsBulkModal.newClient(clientsBulkModal.dbInbound.protocol); + if(method==5) newClient.email = ""; newClient.email += useNum ? prefix + i.toString() + postfix : prefix + postfix; newClient._totalGB = clientsBulkModal.totalGB; newClient._expiryTime = clientsBulkModal.expiryTime; diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 0e1b1415..6de729f9 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -59,13 +59,11 @@ - [[ 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" }} + Logs + 3x-ui v{{ .cur_ver }} {{ i18n "pages.index.operationHours" }}: - [[ formatSecond(status.uptime) ]] + [[ formatSecond(status.uptime) ]]