Add viewlog controller

This commit is contained in:
chteufleur 2016-12-16 22:05:06 +01:00
parent f0427c6508
commit 4bd4c0417c
1 changed files with 5 additions and 12 deletions

View File

@ -10,8 +10,6 @@ import (
"net/http"
)
type WebSocketController struct {
beego.Controller
}
@ -28,16 +26,12 @@ func (c *WebSocketController) Prepare() {
c.Data["version"] = variables.Version
}
// Get method handles GET requests for WebSocketController.
func (c *WebSocketController) Get() {
c.Data["hostWS"] = "ws://" + c.Ctx.Request.Host + variables.WebSocketLogRoute
c.TplName = "watchlog.tpl"
}
// Join method handles WebSocket requests for WebSocketController.
func (this *WebSocketController) Join() {
// Upgrade from http request to WebSocket.
@ -52,7 +46,6 @@ func (this *WebSocketController) Join() {
watchlog.ListWebSocket.PushFront(ws)
// Message receive loop.
for {
_, _, err := ws.ReadMessage()