aboutsummaryrefslogtreecommitdiffstats
path: root/lib/agent/sessions.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-24 01:14:30 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-24 01:37:24 +0100
commit4d843d2bde236ec23810d0904dfb8aebbc53a37b (patch)
tree84c01452f01620cedb7bf6bcb608a0eade82161b /lib/agent/sessions.go
parent38c0c21a969e621c725245ce91c78e77076c5ce7 (diff)
New dashboard improvements.
- add build buttons - add build settings support and backup into project clientData - improved async alert - fixed project dropdown Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/sessions.go')
-rw-r--r--lib/agent/sessions.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/agent/sessions.go b/lib/agent/sessions.go
index 7347480..3d8b0f4 100644
--- a/lib/agent/sessions.go
+++ b/lib/agent/sessions.go
@@ -125,6 +125,14 @@ func (s *Sessions) Get(c *gin.Context) *ClientSession {
return nil
}
+// GetID returns the session or an empty string
+func (s *Sessions) GetID(c *gin.Context) string {
+ if sess := s.Get(c); sess != nil {
+ return sess.ID
+ }
+ return ""
+}
+
// IOSocketGet Get socketio definition from sid
func (s *Sessions) IOSocketGet(sid string) *socketio.Socket {
s.mutex.Lock()