mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
fix(api/docker): correct paramaters
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/moby/moby/api/types/container"
|
"github.com/moby/moby/api/types/container"
|
||||||
"github.com/moby/moby/client"
|
|
||||||
"github.com/yusing/godoxy/internal/docker"
|
"github.com/yusing/godoxy/internal/docker"
|
||||||
"github.com/yusing/godoxy/internal/route/routes"
|
"github.com/yusing/godoxy/internal/route/routes"
|
||||||
"github.com/yusing/godoxy/internal/types"
|
"github.com/yusing/godoxy/internal/types"
|
||||||
@@ -68,7 +67,7 @@ func Stats(c *gin.Context) {
|
|||||||
defer dockerClient.Close()
|
defer dockerClient.Close()
|
||||||
|
|
||||||
if httpheaders.IsWebsocket(c.Request.Header) {
|
if httpheaders.IsWebsocket(c.Request.Header) {
|
||||||
stats, err := dockerClient.ContainerStats(c.Request.Context(), id, client.ContainerStatsOptions{Stream: true})
|
stats, err := dockerClient.ContainerStats(c.Request.Context(), id, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Error(apitypes.InternalServerError(err, "failed to get container stats"))
|
c.Error(apitypes.InternalServerError(err, "failed to get container stats"))
|
||||||
return
|
return
|
||||||
@@ -102,7 +101,7 @@ func Stats(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stats, err := dockerClient.ContainerStats(c.Request.Context(), id, client.ContainerStatsOptions{Stream: false})
|
stats, err := dockerClient.ContainerStats(c.Request.Context(), id, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Error(apitypes.InternalServerError(err, "failed to get container stats"))
|
c.Error(apitypes.InternalServerError(err, "failed to get container stats"))
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user