mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-06 22:05:53 +02:00
fix broadcast typo.
This commit is contained in:
parent
6a9cb24743
commit
6d72a795ef
4 changed files with 9 additions and 9 deletions
|
@ -22,7 +22,7 @@ func (h *RoomHandler) broadcastStatus(w http.ResponseWriter, r *http.Request) er
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *RoomHandler) boradcastStart(w http.ResponseWriter, r *http.Request) error {
|
func (h *RoomHandler) broadcastStart(w http.ResponseWriter, r *http.Request) error {
|
||||||
data := &BroadcastStatusPayload{}
|
data := &BroadcastStatusPayload{}
|
||||||
if err := utils.HttpJsonRequest(w, r, data); err != nil {
|
if err := utils.HttpJsonRequest(w, r, data); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -42,7 +42,7 @@ func (h *RoomHandler) boradcastStart(w http.ResponseWriter, r *http.Request) err
|
||||||
}
|
}
|
||||||
|
|
||||||
h.sessions.AdminBroadcast(
|
h.sessions.AdminBroadcast(
|
||||||
event.BORADCAST_STATUS,
|
event.BROADCAST_STATUS,
|
||||||
message.BroadcastStatus{
|
message.BroadcastStatus{
|
||||||
IsActive: broadcast.Started(),
|
IsActive: broadcast.Started(),
|
||||||
URL: broadcast.Url(),
|
URL: broadcast.Url(),
|
||||||
|
@ -51,7 +51,7 @@ func (h *RoomHandler) boradcastStart(w http.ResponseWriter, r *http.Request) err
|
||||||
return utils.HttpSuccess(w)
|
return utils.HttpSuccess(w)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *RoomHandler) boradcastStop(w http.ResponseWriter, r *http.Request) error {
|
func (h *RoomHandler) broadcastStop(w http.ResponseWriter, r *http.Request) error {
|
||||||
broadcast := h.capture.Broadcast()
|
broadcast := h.capture.Broadcast()
|
||||||
if !broadcast.Started() {
|
if !broadcast.Started() {
|
||||||
return utils.HttpUnprocessableEntity("server is not broadcasting")
|
return utils.HttpUnprocessableEntity("server is not broadcasting")
|
||||||
|
@ -60,7 +60,7 @@ func (h *RoomHandler) boradcastStop(w http.ResponseWriter, r *http.Request) erro
|
||||||
broadcast.Stop()
|
broadcast.Stop()
|
||||||
|
|
||||||
h.sessions.AdminBroadcast(
|
h.sessions.AdminBroadcast(
|
||||||
event.BORADCAST_STATUS,
|
event.BROADCAST_STATUS,
|
||||||
message.BroadcastStatus{
|
message.BroadcastStatus{
|
||||||
IsActive: broadcast.Started(),
|
IsActive: broadcast.Started(),
|
||||||
URL: broadcast.Url(),
|
URL: broadcast.Url(),
|
||||||
|
|
|
@ -62,8 +62,8 @@ func (h *RoomHandler) Route(r types.Router) {
|
||||||
|
|
||||||
r.With(auth.AdminsOnly).Route("/broadcast", func(r types.Router) {
|
r.With(auth.AdminsOnly).Route("/broadcast", func(r types.Router) {
|
||||||
r.Get("/", h.broadcastStatus)
|
r.Get("/", h.broadcastStatus)
|
||||||
r.Post("/start", h.boradcastStart)
|
r.Post("/start", h.broadcastStart)
|
||||||
r.Post("/stop", h.boradcastStop)
|
r.Post("/stop", h.broadcastStop)
|
||||||
})
|
})
|
||||||
|
|
||||||
r.With(auth.CanAccessClipboardOnly).With(auth.HostsOnly).Route("/clipboard", func(r types.Router) {
|
r.With(auth.CanAccessClipboardOnly).With(auth.HostsOnly).Route("/clipboard", func(r types.Router) {
|
||||||
|
|
|
@ -265,7 +265,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- room
|
- room
|
||||||
summary: start broadcast
|
summary: start broadcast
|
||||||
operationId: boradcastStart
|
operationId: broadcastStart
|
||||||
responses:
|
responses:
|
||||||
'204':
|
'204':
|
||||||
description: OK
|
description: OK
|
||||||
|
@ -302,7 +302,7 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- room
|
- room
|
||||||
summary: stop broadcast
|
summary: stop broadcast
|
||||||
operationId: boradcastStop
|
operationId: broadcastStop
|
||||||
responses:
|
responses:
|
||||||
'204':
|
'204':
|
||||||
description: OK
|
description: OK
|
||||||
|
|
|
@ -70,7 +70,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
BORADCAST_STATUS = "broadcast/status"
|
BROADCAST_STATUS = "broadcast/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
Loading…
Add table
Reference in a new issue