This commit is contained in:
ACoolName 2024-05-28 00:36:46 +03:00
parent 8b3c830bab
commit ece028f167

View File

@ -604,17 +604,20 @@ func (con Connection) AttachServer(ctx *gin.Context) {
case "resize": case "resize":
args := strings.Split(Command.Arguments, "x") args := strings.Split(Command.Arguments, "x")
width, err2 := strconv.Atoi(args[0]) i_width, err2 := strconv.Atoi(args[0])
if err2 != nil { if err2 != nil {
break break
} }
height, err2 := strconv.Atoi(args[1]) width := uint(i_width)
i_height, err2 := strconv.Atoi(args[1])
if err2 != nil { if err2 != nil {
break break
} }
height := uint(i_height)
log.Printf("Fake resize %dx%d", width, height) log.Printf("Fake resize %dx%d", width, height)
err2 = con.dockerClient.ContainerResize(context.TODO(), containers[0].ID, container.ResizeOptions{Height: uint(height), Width: uint(width)}) err2 = con.dockerClient.ContainerResize(context.TODO(), containers[0].ID, container.ResizeOptions{Height: height, Width: width})
if err2 != nil { if err2 != nil {
log.Printf("Failed to resize container to %dx%d: %s", width, height, err) log.Printf("Failed to resize container to %dx%d: %s", width, height, err)
} }