Skip to content

Commit

Permalink
Add Setting
Browse files Browse the repository at this point in the history
  • Loading branch information
cpapplefamily committed Nov 30, 2024
1 parent df01a85 commit 2882a16
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions model/event_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type EventSettings struct {
SelectionRound3Order string
SelectionShowUnpickedTeams bool
TbaDownloadEnabled bool
AlternateIOEnabled bool
TbaPublishingEnabled bool
TbaEventCode string
TbaSecretId string
Expand Down Expand Up @@ -74,6 +75,7 @@ func (database *Database) GetEventSettings() (*EventSettings, error) {
SelectionRound3Order: "",
SelectionShowUnpickedTeams: true,
TbaDownloadEnabled: true,
AlternateIOEnabled: false,
ApChannel: 36,
WarmupDurationSec: game.MatchTiming.WarmupDurationSec,
AutoDurationSec: game.MatchTiming.AutoDurationSec,
Expand Down
1 change: 1 addition & 0 deletions model/event_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestEventSettingsReadWrite(t *testing.T) {
SelectionRound3Order: "",
SelectionShowUnpickedTeams: true,
TbaDownloadEnabled: true,
AlternateIOEnabled: true,
ApChannel: 36,
WarmupDurationSec: 0,
AutoDurationSec: 15,
Expand Down
9 changes: 9 additions & 0 deletions templates/setup_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@
<input type="text" class="form-control" name="plcAddress" value="{{.PlcAddress}}">
</div>
</div>
<div class="row mb-3">
<label class="col-lg-8 control-label" for="alternateIOEnabled">
Enable Alternate IO (IE: Raspberry Pi)
</label>
<div class="col-lg-1 checkbox">
<input type="checkbox" id="alternateIOEnabled"
name="alternateIOEnabled"{{if .AlternateIOEnabled}} checked{{end}}>
</div>
</div>
</fieldset>
<fieldset class="mb-4">
<legend>Team Signs</legend>
Expand Down
1 change: 1 addition & 0 deletions web/setup_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (web *Web) settingsPostHandler(w http.ResponseWriter, r *http.Request) {
eventSettings.SelectionRound3Order = r.PostFormValue("selectionRound3Order")
eventSettings.SelectionShowUnpickedTeams = r.PostFormValue("selectionShowUnpickedTeams") == "on"
eventSettings.TbaDownloadEnabled = r.PostFormValue("tbaDownloadEnabled") == "on"
eventSettings.AlternateIOEnabled = r.PostFormValue("alternateIOEnabled") == "on"
eventSettings.TbaPublishingEnabled = r.PostFormValue("tbaPublishingEnabled") == "on"
eventSettings.TbaEventCode = r.PostFormValue("tbaEventCode")
eventSettings.TbaSecretId = r.PostFormValue("tbaSecretId")
Expand Down

0 comments on commit 2882a16

Please sign in to comment.