From 223428655c95cde562c29683ef5fc4ec9c00243f Mon Sep 17 00:00:00 2001 From: Guoyh Date: Tue, 17 Dec 2024 17:49:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E8=BF=87=E6=BB=A4=E4=B8=8D=E5=8C=85=E5=90=AB?= =?UTF-8?q?upgrade=E7=9A=84=E5=8D=87=E7=BA=A7=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoroute/defaulter/system.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/autoroute/defaulter/system.go b/autoroute/defaulter/system.go index 3dc6461..fdfe134 100644 --- a/autoroute/defaulter/system.go +++ b/autoroute/defaulter/system.go @@ -1,8 +1,8 @@ /* * @Author: Wangjun * @Date: 2021-05-15 22:43:19 - * @LastEditTime: 2024-08-28 18:49:40 - * @LastEditors: wangjun haodreams@163.com + * @LastEditTime: 2024-12-17 17:47:35 + * @LastEditors: Please set LastEditors * @Description: * @FilePath: \golib\autoroute\defaulter\system.go * hnxr @@ -121,6 +121,10 @@ func (m *SystemController) Upgrade() { } dst := header.Filename fileName := filepath.Base(dst) + if !strings.Contains(fileName, "upgrade") { + m.Msg("请使用文件名带upgrade的升级包进行升级") + return + } f, err := header.Open() if err != nil { m.Error(err.Error()) -- Gitee From ae5b99917d80f77caa1b1137fb6ebece677ba4d9 Mon Sep 17 00:00:00 2001 From: Guoyh Date: Fri, 20 Dec 2024 15:00:00 +0800 Subject: [PATCH 2/2] up button --- autoroute/defaulter/default.go | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/autoroute/defaulter/default.go b/autoroute/defaulter/default.go index c0c432a..ee3109a 100644 --- a/autoroute/defaulter/default.go +++ b/autoroute/defaulter/default.go @@ -1,10 +1,10 @@ /* * @Author: Wangjun * @Date: 2023-09-01 13:39:49 - * @LastEditTime: 2024-11-01 17:38:28 - * @LastEditors: wangjun haodreams@163.com + * @LastEditTime: 2024-12-20 14:27:13 + * @LastEditors: Please set LastEditors * @Description:创建默认的router - * @FilePath: \xrdatad:\go\src\gitee.com\haodreams\golib\autoroute\defaulter\default.go + * @FilePath: \golib\autoroute\defaulter\default.go * hnxr */ package defaulter @@ -246,13 +246,24 @@ func TailLog(c *gin.Context) { } } - c.Writer.Header().Add("Content-Type", "text/plain") + c.Writer.Header().Add("Content-Type", "text/html; charset=utf-8") path := fmt.Sprintf("%s%s.log", prefix, day) lines, err := tailsnap.TailFile(path, size) if err != nil { c.Writer.WriteString(err.Error()) + fmt.Fprintln(c.Writer, "
", ` + + `) return } + fmt.Fprintln(c.Writer, "
")
 	for _, line := range lines {
 		if line != nil {
 			if code == "GBK" {
@@ -264,4 +275,19 @@ func TailLog(c *gin.Context) {
 			c.Writer.WriteString("\r\n")
 		}
 	}
+	fmt.Fprintln(c.Writer, "
") + fmt.Fprintln(c.Writer, ` + + + `) } -- Gitee