feat: archer add print message
This commit is contained in:
parent
cc9c9354bc
commit
c09933767b
|
@ -75,6 +75,7 @@ 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) + `;
|
||||||
|
@ -93,3 +94,11 @@ 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"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue