mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-10 06:06:47 -04:00
Provide option to disable admin wireless network.
This commit is contained in:
@@ -54,8 +54,13 @@ func (ap *AccessPoint) ConfigureAdminWifi() error {
|
||||
ap.mutex.Lock()
|
||||
defer ap.mutex.Unlock()
|
||||
|
||||
disabled := 0
|
||||
if ap.adminChannel == 0 {
|
||||
disabled = 1
|
||||
}
|
||||
commands := []string{
|
||||
fmt.Sprintf("set wireless.radio0.channel='%d'", ap.teamChannel),
|
||||
fmt.Sprintf("set wireless.radio1.disabled='%d'", disabled),
|
||||
fmt.Sprintf("set wireless.radio1.channel='%d'", ap.adminChannel),
|
||||
fmt.Sprintf("set wireless.@wifi-iface[0].key='%s'", ap.adminWpaKey),
|
||||
"commit wireless",
|
||||
|
||||
@@ -50,7 +50,7 @@ func (database *Database) GetEventSettings() (*EventSettings, error) {
|
||||
eventSettings.SelectionRound3Order = ""
|
||||
eventSettings.TBADownloadEnabled = true
|
||||
eventSettings.ApTeamChannel = 157
|
||||
eventSettings.ApAdminChannel = 11
|
||||
eventSettings.ApAdminChannel = 0
|
||||
eventSettings.ApAdminWpaKey = "1234Five"
|
||||
|
||||
err = database.eventSettingsMap.Insert(eventSettings)
|
||||
|
||||
@@ -14,7 +14,7 @@ func TestEventSettingsReadWrite(t *testing.T) {
|
||||
eventSettings, err := db.GetEventSettings()
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, EventSettings{Id: 0, Name: "Untitled Event", NumElimAlliances: 8, SelectionRound2Order: "L",
|
||||
SelectionRound3Order: "", TBADownloadEnabled: true, ApTeamChannel: 157, ApAdminChannel: 11,
|
||||
SelectionRound3Order: "", TBADownloadEnabled: true, ApTeamChannel: 157, ApAdminChannel: 0,
|
||||
ApAdminWpaKey: "1234Five"}, *eventSettings)
|
||||
|
||||
eventSettings.Name = "Chezy Champs"
|
||||
|
||||
@@ -189,6 +189,7 @@
|
||||
<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 0}} selected{{end}}>Disabled</option>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user