Correctly return the suspension status of the server
This commit is contained in:
parent
c69a0bb107
commit
7d084e3049
|
@ -12,13 +12,19 @@ import (
|
|||
"strconv"
|
||||
)
|
||||
|
||||
type serverProcData struct {
|
||||
server.ResourceUsage
|
||||
Suspended bool `json:"suspended"`
|
||||
}
|
||||
|
||||
// Returns a single server from the collection of servers.
|
||||
func getServer(c *gin.Context) {
|
||||
s := GetServer(c.Param("server"))
|
||||
|
||||
p := *s.Proc()
|
||||
|
||||
c.JSON(http.StatusOK, p)
|
||||
c.JSON(http.StatusOK, serverProcData{
|
||||
ResourceUsage: *s.Proc(),
|
||||
Suspended: s.IsSuspended(),
|
||||
})
|
||||
}
|
||||
|
||||
// Returns the logs for a given server instance.
|
||||
|
@ -50,7 +56,7 @@ func getServerLogs(c *gin.Context) {
|
|||
func postServerPower(c *gin.Context) {
|
||||
s := GetServer(c.Param("server"))
|
||||
|
||||
var data struct{
|
||||
var data struct {
|
||||
Action server.PowerAction `json:"action"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user