un-mask wifi password
This commit is contained in:
@@ -2,7 +2,6 @@ package page
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-gl/gl/v3.3-core/gl"
|
"github.com/go-gl/gl/v3.3-core/gl"
|
||||||
@@ -95,7 +94,7 @@ func (p *WiFiSetupPage) Init(ctx *PageCtx) error {
|
|||||||
}
|
}
|
||||||
for _, dev := range p.networkManager.Devices {
|
for _, dev := range p.networkManager.Devices {
|
||||||
if dev.Type == network.TypeWifi {
|
if dev.Type == network.TypeWifi {
|
||||||
d := dev
|
d := dev
|
||||||
p.wifiDevice = &d
|
p.wifiDevice = &d
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -198,14 +197,13 @@ func (p *WiFiSetupPage) handlePasswordInput(sym sdl.Keycode, mod uint16) {
|
|||||||
switch sym {
|
switch sym {
|
||||||
|
|
||||||
case sdl.K_RETURN:
|
case sdl.K_RETURN:
|
||||||
p.exitPasswordMode()
|
p.exitPasswordMode()
|
||||||
|
|
||||||
p.pendingSSID = p.selectedAP.SSID
|
p.pendingSSID = p.selectedAP.SSID
|
||||||
p.isConnecting = true
|
p.isConnecting = true
|
||||||
p.connectionError = ""
|
p.connectionError = ""
|
||||||
p.connectionAttemptTime = time.Now()
|
p.connectionAttemptTime = time.Now()
|
||||||
|
|
||||||
|
|
||||||
err := p.networkManager.Connect(*p.wifiDevice, *p.selectedAP, p.passwordInput)
|
err := p.networkManager.Connect(*p.wifiDevice, *p.selectedAP, p.passwordInput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.isConnecting = false
|
p.isConnecting = false
|
||||||
@@ -589,7 +587,7 @@ func (p *WiFiSetupPage) updatePasswordTexture() {
|
|||||||
if p.passwordInputItem.ID != 0 {
|
if p.passwordInputItem.ID != 0 {
|
||||||
gl.DeleteTextures(1, &p.passwordInputItem.ID)
|
gl.DeleteTextures(1, &p.passwordInputItem.ID)
|
||||||
}
|
}
|
||||||
maskedPassword := strings.Repeat("*", len(p.passwordInput))
|
maskedPassword := p.passwordInput
|
||||||
if maskedPassword == "" {
|
if maskedPassword == "" {
|
||||||
maskedPassword = " "
|
maskedPassword = " "
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user