mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
316 lines
13 KiB
HTML
316 lines
13 KiB
HTML
{{/*
|
||
Copyright 2014 Team 254. All Rights Reserved.
|
||
Author: pat@patfairbank.com (Patrick Fairbank)
|
||
|
||
UI for configuring event settings.
|
||
*/}}
|
||
{{define "title"}}Settings{{end}}
|
||
{{define "body"}}
|
||
<div class="row">
|
||
{{if .ErrorMessage}}
|
||
<div class="alert alert-dismissable alert-danger">
|
||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||
{{.ErrorMessage}}
|
||
</div>
|
||
{{end}}
|
||
<div class="col-lg-6 col-lg-offset-1">
|
||
<div class="well">
|
||
<form class="form-horizontal" action="/setup/settings" method="POST">
|
||
<fieldset>
|
||
<legend>Event Settings</legend>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Name</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="name" value="{{.Name}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Display Background Color</label>
|
||
<div class="col-lg-7">
|
||
<div class="input-group" id="displayBackgroundColor">
|
||
<input type="text" class="form-control" name="displayBackgroundColor"
|
||
value="{{.DisplayBackgroundColor}}">
|
||
<span class="input-group-addon"><i></i></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Number of Alliances</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="numElimAlliances" value="{{.NumElimAlliances}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Round 2 Selection Order</label>
|
||
<div class="col-lg-7">
|
||
<div class="radio">
|
||
<label>
|
||
<input type="radio" name="selectionRound2Order" value="F"
|
||
{{if eq .SelectionRound2Order "F"}}checked{{end}}>
|
||
First to Last
|
||
</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label>
|
||
<input type="radio" name="selectionRound2Order" value="L"
|
||
{{if eq .SelectionRound2Order "L"}}checked{{end}}>
|
||
Last to First
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Round 3 Selection Order</label>
|
||
<div class="col-lg-7">
|
||
<div class="radio">
|
||
<label>
|
||
<input type="radio" name="selectionRound3Order" value="F"
|
||
{{if eq .SelectionRound3Order "F"}}checked{{end}}>
|
||
First to Last
|
||
</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label>
|
||
<input type="radio" name="selectionRound3Order" value="L"
|
||
{{if eq .SelectionRound3Order "L"}}checked{{end}}>
|
||
Last to First
|
||
</label>
|
||
</div>
|
||
<div class="radio">
|
||
<label>
|
||
<input type="radio" name="selectionRound3Order" value=""
|
||
{{if eq .SelectionRound3Order ""}}checked{{end}}>
|
||
None
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend>Automatic Team Info Download</legend>
|
||
<div class="form-group">
|
||
<label class="col-lg-9 control-label">Enable Automatic Team Info Download (From TBA)</label>
|
||
<div class="col-lg-1 checkbox">
|
||
<input type="checkbox" name="TBADownloadEnabled"{{if .TBADownloadEnabled}} checked{{end}}>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend>Publishing</legend>
|
||
<p>Contact The Blue Alliance to obtain an event code and credentials.</p>
|
||
<div class="form-group">
|
||
<label class="col-lg-7 control-label">Enable The Blue Alliance publishing</label>
|
||
<div class="col-lg-1 checkbox">
|
||
<input type="checkbox" name="tbaPublishingEnabled"{{if .TbaPublishingEnabled}} checked{{end}}>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">TBA Event Code</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="tbaEventCode" value="{{.TbaEventCode}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">TBA Auth ID</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="tbaSecretId" value="{{.TbaSecretId}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">TBA Secret</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="tbaSecret" value="{{.TbaSecret}}">
|
||
</div>
|
||
</div>
|
||
<p>Contact STEMtv to obtain an event code.</p>
|
||
<div class="form-group">
|
||
<label class="col-lg-7 control-label">Enable STEMtv publishing</label>
|
||
<div class="col-lg-1 checkbox">
|
||
<input type="checkbox" name="stemTvPublishingEnabled"{{if .StemTvPublishingEnabled}} checked{{end}}>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">STEMtv Event Code</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="stemTvEventCode" value="{{.StemTvEventCode}}">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend>Authentication</legend>
|
||
<p>Configure passwords to enable HTTP Basic authentication, or leave blank to disable.</p>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Password for 'admin' user</label>
|
||
<div class="col-lg-7">
|
||
<input type="password" class="form-control" name="adminPassword" value="{{.AdminPassword}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Password for 'reader' user</label>
|
||
<div class="col-lg-7">
|
||
<input type="password" class="form-control" name="readerPassword" value="{{.ReaderPassword}}">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend>Networking</legend>
|
||
<p>Enable this setting if you have a Linksys WRT1900ACS access point and Catalyst 3500-series
|
||
switch available, for isolating each team to its own SSID and VLAN.</p>
|
||
<div class="form-group">
|
||
<label class="col-lg-7 control-label">Enable advanced network security</label>
|
||
<div class="col-lg-1 checkbox">
|
||
<input type="checkbox" name="networkSecurityEnabled"{{if .NetworkSecurityEnabled}} checked{{end}}>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">AP Address</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="apAddress" value="{{.ApAddress}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">AP Username</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="apUsername" value="{{.ApUsername}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">AP Password</label>
|
||
<div class="col-lg-7">
|
||
<input type="password" class="form-control" name="apPassword" value="{{.ApPassword}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">AP Team Channel (5GHz)</label>
|
||
<div class="col-lg-7">
|
||
<select class="form-control" name="apTeamChannel" value="{{.ApTeamChannel}}">
|
||
<option{{if eq .ApTeamChannel 36}} selected{{end}}>36</option>
|
||
<option{{if eq .ApTeamChannel 40}} selected{{end}}>40</option>
|
||
<option{{if eq .ApTeamChannel 44}} selected{{end}}>44</option>
|
||
<option{{if eq .ApTeamChannel 48}} selected{{end}}>48</option>
|
||
<option{{if eq .ApTeamChannel 149}} selected{{end}}>149</option>
|
||
<option{{if eq .ApTeamChannel 153}} selected{{end}}>153</option>
|
||
<option{{if eq .ApTeamChannel 157}} selected{{end}}>157</option>
|
||
<option{{if eq .ApTeamChannel 161}} selected{{end}}>161</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">AP Admin Channel (2.4GHz)</label>
|
||
<div class="col-lg-7">
|
||
<select class="form-control" name="apAdminChannel" value="{{.ApAdminChannel}}">
|
||
<option{{if eq .ApAdminChannel 1}} selected{{end}}>1</option>
|
||
<option{{if eq .ApAdminChannel 6}} selected{{end}}>6</option>
|
||
<option{{if eq .ApAdminChannel 11}} selected{{end}}>11</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">AP Admin WPA Key</label>
|
||
<div class="col-lg-7">
|
||
<input type="password" class="form-control" name="apAdminWpaKey" value="{{.ApAdminWpaKey}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Switch Address</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="switchAddress" value="{{.SwitchAddress}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">Switch Password</label>
|
||
<div class="col-lg-7">
|
||
<input type="password" class="form-control" name="switchPassword" value="{{.SwitchPassword}}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-lg-7 control-label">Enable bandwidth monitoring</label>
|
||
<div class="col-lg-1 checkbox">
|
||
<input type="checkbox" name="bandwidthMonitoringEnabled"{{if .BandwidthMonitoringEnabled}} checked{{end}}>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<fieldset>
|
||
<legend>PLC</legend>
|
||
<div class="form-group">
|
||
<label class="col-lg-5 control-label">PLC Address</label>
|
||
<div class="col-lg-7">
|
||
<input type="text" class="form-control" name="plcAddress" value="{{.PlcAddress}}">
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
<div class="form-group">
|
||
<div class="col-lg-7 col-lg-offset-5">
|
||
<button type="submit" class="btn btn-info">Save</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<div class="col-lg-4">
|
||
<div class="well">
|
||
<legend>Database</legend>
|
||
<p>
|
||
<a href="/setup/db/save"><button class="btn btn-info">Save Copy of Database</button></a>
|
||
</p>
|
||
<p>
|
||
<button type="button" class="btn btn-primary" onclick="$('#uploadDatabase').modal('show');">
|
||
Load Database from Backup
|
||
</button>
|
||
</p>
|
||
<p>
|
||
<button type="button" class="btn btn-primary" onclick="$('#confirmClearData').modal('show');">
|
||
Clear All Match Data
|
||
</button>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="uploadDatabase" class="modal" style="top: 20%;">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h4 class="modal-title">Choose Backup File</h4>
|
||
</div>
|
||
<form class="form-horizontal" action="/setup/db/restore" enctype="multipart/form-data" method="POST">
|
||
<div class="modal-body">
|
||
<p>Select the database file to load from. <b>This will overwrite any existing data.</b></p>
|
||
<input type="file" name="databaseFile">
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||
<button type="submit" class="btn btn-primary">Load Database from Backup</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="confirmClearData" class="modal" style="top: 20%;">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h4 class="modal-title">Confirm</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<p>Are you sure you want to clear all match, ranking, and alliance selection data?</p>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<form class="form-horizontal" action="/setup/db/clear" method="POST">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||
<button type="submit" class="btn btn-primary">Clear All Match Data</button>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{{end}}
|
||
{{define "script"}}
|
||
<script>
|
||
$(function() {
|
||
$("#displayBackgroundColor").colorpicker();
|
||
});
|
||
</script>
|
||
{{end}}
|