style: 补充代码注释

This commit is contained in:
TsMask
2024-06-14 17:01:19 +08:00
parent 4b1acc3e25
commit 1f68c15e93
3 changed files with 4 additions and 3 deletions

View File

@@ -203,6 +203,7 @@ func (s *NeHostController) Test(c *gin.Context) {
return return
} }
defer client.Close() defer client.Close()
// 是否有终止符
if strings.HasSuffix(client.LastResult, ">") || strings.HasSuffix(client.LastResult, "> ") || strings.HasSuffix(client.LastResult, "# ") { if strings.HasSuffix(client.LastResult, ">") || strings.HasSuffix(client.LastResult, "> ") || strings.HasSuffix(client.LastResult, "# ") {
c.JSON(200, result.Ok(nil)) c.JSON(200, result.Ok(nil))
} else { } else {

View File

@@ -174,7 +174,7 @@ func (r *NeLicenseImpl) UploadLicense(neLicense model.NeLicense) error {
// 上传授权文件去覆盖 // 上传授权文件去覆盖
if err := sftpClient.CopyFileLocalToRemote(omcLicensePath, neLicensePath); err != nil { if err := sftpClient.CopyFileLocalToRemote(omcLicensePath, neLicensePath); err != nil {
return err return fmt.Errorf("please check if scp remote copy is allowed")
} }
// 重启服务 // 重启服务

View File

@@ -259,12 +259,12 @@ func (s *WSController) Telnet(c *gin.Context) {
// 终端单行字符数 // 终端单行字符数
cols, err := strconv.Atoi(c.Query("cols")) cols, err := strconv.Atoi(c.Query("cols"))
if err != nil || cols > 254 { if err != nil || cols > 254 {
cols = 80 cols = 120
} }
// 终端显示行数 // 终端显示行数
rows, err := strconv.Atoi(c.Query("rows")) rows, err := strconv.Atoi(c.Query("rows"))
if err != nil || cols > rows { if err != nil || cols > rows {
rows = 40 rows = 128
} }
// 创建Telnet客户端会话 // 创建Telnet客户端会话