Compare commits

..

No commits in common. "fc35559ab8188702b33d81e3e096f4e4c06c6fbf" and "cc9c9354bc8ce68617bfb373c1071c4b619d0fa1" have entirely different histories.

1 changed files with 2 additions and 11 deletions

View File

@ -56,7 +56,7 @@ func (p ArcherAx50) Login(user, pass string) error {
} }
func (p ArcherAx50) SwitchWIFI() error { func (p ArcherAx50) SwitchWIFI() error {
time.Sleep(time.Millisecond * 1350) time.Sleep(time.Second * 1)
pageURL := p.page.MustInfo().URL pageURL := p.page.MustInfo().URL
log.Println("p.page.MustInfo().URL", pageURL) log.Println("p.page.MustInfo().URL", pageURL)
@ -67,7 +67,7 @@ func (p ArcherAx50) SwitchWIFI() error {
wirelessTab.MustClick() wirelessTab.MustClick()
log.Println(p.wirelessTab, "DONE") log.Println(p.wirelessTab, "DONE")
time.Sleep(time.Millisecond * 1250) time.Sleep(time.Millisecond * 750)
checked := p.page.MustEvaluate(&rod.EvalOptions{ checked := p.page.MustEvaluate(&rod.EvalOptions{
JS: `() => { JS: `() => {
return document.getElementById('` + p.chkWifi2gID + `').checked; return document.getElementById('` + p.chkWifi2gID + `').checked;
@ -75,7 +75,6 @@ func (p ArcherAx50) SwitchWIFI() error {
}) })
isChecked := checked.Value.Bool() isChecked := checked.Value.Bool()
log.Println(getCheckedMessage(isChecked))
p.page.MustEvaluate(&rod.EvalOptions{ p.page.MustEvaluate(&rod.EvalOptions{
JS: `() => { JS: `() => {
document.getElementById('` + p.chkWifi2gID + `').checked=` + fmt.Sprint(!isChecked) + `; document.getElementById('` + p.chkWifi2gID + `').checked=` + fmt.Sprint(!isChecked) + `;
@ -94,11 +93,3 @@ func (p ArcherAx50) SwitchWIFI() error {
time.Sleep(time.Millisecond * 1500) time.Sleep(time.Millisecond * 1500)
return nil return nil
} }
func getCheckedMessage(isChecked bool) string {
if isChecked {
return "Time to sleep, let's switch off"
}
return "Time to laborate, let's switch WIFI on"
}