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)
|
||||
//
|
||||
// Client-side logic for the field setup page.
|
||||
// Client-side logic for the Field Testing page.
|
||||
|
||||
var websocket;
|
||||
|
||||
@@ -24,7 +24,7 @@ var handlePlcIoChange = function(data) {
|
||||
|
||||
$(function() {
|
||||
// Set up the websocket back to the server.
|
||||
websocket = new CheesyWebsocket("/setup/led_plc/websocket", {
|
||||
websocket = new CheesyWebsocket("/setup/field_testing/websocket", {
|
||||
plcIoChange: function(event) { handlePlcIoChange(event.data); }
|
||||
});
|
||||
});
|
||||
@@ -35,7 +35,7 @@
|
||||
<li><a href="/setup/lower_thirds">Lower Thirds</a></li>
|
||||
<li><a href="/setup/sponsor_slides">Sponsor Slides</a></li>
|
||||
<li><a href="/setup/displays">Display Configuration</a></li>
|
||||
<li><a href="/setup/led_plc">LED and PLC Testing</a></li>
|
||||
<li><a href="/setup/field_testing">Field Testing</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Copyright 2018 Team 254. All Rights Reserved.
|
||||
Author: pat@patfairbank.com (Patrick Fairbank)
|
||||
|
||||
UI for testing the LEDs and PLC connected to the field.
|
||||
UI for testing the game sounds and the LEDs and PLC connected to the field.
|
||||
*/}}
|
||||
{{define "title"}}LED and PLC Testing{{end}}
|
||||
{{define "title"}}Field Testing{{end}}
|
||||
{{define "body"}}
|
||||
<div class="row">
|
||||
<div class="col-lg-7">
|
||||
@@ -56,5 +56,5 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{define "script"}}
|
||||
<script src="/static/js/setup_led_plc.js"></script>
|
||||
<script src="/static/js/setup_field_testing.js"></script>
|
||||
{{end}}
|
||||
@@ -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