Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #321 from vania-pooh/master
Browse files Browse the repository at this point in the history
Fixed backwards /status API compatibility (fixes #320)
  • Loading branch information
vania-pooh authored Dec 26, 2017
2 parents 7976204 + 91ea43b commit e149162
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import (

// Session - session id and vnc flag
type Session struct {
ID string `json:"id"`
Container *session.Container `json:"container,omitempty"`
VNC bool `json:"vnc"`
Screen string `json:"screen"`
Caps session.Caps `json:"caps"`
ID string `json:"id"`
Container string `json:"container,omitempty"`
ContainerInfo *session.Container `json:"containerInfo,omitempty"`
VNC bool `json:"vnc"`
Screen string `json:"screen"`
Caps session.Caps `json:"caps"`
}

// Sessions - used count and individual sessions for quota user
Expand Down Expand Up @@ -169,13 +170,18 @@ func (config *Config) State(sessions *session.Map, limit, queued, pending int) *
if session.VNC != "" {
vnc = true
}
v.Sessions = append(v.Sessions, Session{
ID: id,
Container: session.Container,
VNC: vnc,
Screen: session.Caps.ScreenResolution,
Caps: session.Caps,
})
ctr := session.Container
sess := Session{
ID: id,
ContainerInfo: ctr,
VNC: vnc,
Screen: session.Caps.ScreenResolution,
Caps: session.Caps,
}
if ctr != nil {
sess.Container = ctr.ID
}
v.Sessions = append(v.Sessions, sess)
})
return state
}

0 comments on commit e149162

Please sign in to comment.