mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Rename LED/PLC testing page to Field Testing to be more generic.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Copyright 2018 Team 254. All Rights Reserved.
|
||||
// Author: pat@patfairbank.com (Patrick Fairbank)
|
||||
//
|
||||
// Web routes for testing the field LEDs and PLC.
|
||||
// Web routes for testing the field sounds, LEDs, and PLC.
|
||||
|
||||
package web
|
||||
|
||||
@@ -11,13 +11,13 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Shows the LED/PLC test page.
|
||||
func (web *Web) ledPlcGetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// Shows the Field Testing page.
|
||||
func (web *Web) fieldTestingGetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if !web.userIsAdmin(w, r) {
|
||||
return
|
||||
}
|
||||
|
||||
template, err := web.parseFiles("templates/setup_led_plc.html", "templates/base.html")
|
||||
template, err := web.parseFiles("templates/setup_field_testing.html", "templates/base.html")
|
||||
if err != nil {
|
||||
handleWebErr(w, err)
|
||||
return
|
||||
@@ -36,8 +36,8 @@ func (web *Web) ledPlcGetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// The websocket endpoint for sending realtime updates to the LED/PLC test page.
|
||||
func (web *Web) ledPlcWebsocketHandler(w http.ResponseWriter, r *http.Request) {
|
||||
// The websocket endpoint for sending realtime updates to the Field Testing page.
|
||||
func (web *Web) fieldTestingWebsocketHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if !web.userIsAdmin(w, r) {
|
||||
return
|
||||
}
|
||||
@@ -10,12 +10,12 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSetupLedPlcWebsocket(t *testing.T) {
|
||||
func TestSetupFieldTestingWebsocket(t *testing.T) {
|
||||
web := setupTestWeb(t)
|
||||
|
||||
server, wsUrl := web.startTestServer()
|
||||
defer server.Close()
|
||||
conn, _, err := gorillawebsocket.DefaultDialer.Dial(wsUrl+"/setup/led_plc/websocket", nil)
|
||||
conn, _, err := gorillawebsocket.DefaultDialer.Dial(wsUrl+"/setup/field_testing/websocket", nil)
|
||||
assert.Nil(t, err)
|
||||
defer conn.Close()
|
||||
ws := websocket.NewTestWebsocket(conn)
|
||||
@@ -159,8 +159,8 @@ func (web *Web) newHandler() http.Handler {
|
||||
router.HandleFunc("/setup/db/save", web.saveDbHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/displays", web.displaysGetHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/displays/websocket", web.displaysWebsocketHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/led_plc", web.ledPlcGetHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/led_plc/websocket", web.ledPlcWebsocketHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/field_testing", web.fieldTestingGetHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/field_testing/websocket", web.fieldTestingWebsocketHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/lower_thirds", web.lowerThirdsGetHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/lower_thirds/websocket", web.lowerThirdsWebsocketHandler).Methods("GET")
|
||||
router.HandleFunc("/setup/schedule", web.scheduleGetHandler).Methods("GET")
|
||||
|
||||
Reference in New Issue
Block a user