|
|
@ -49,6 +49,8 @@ type UI struct {
|
|
|
|
enabled widget.Bool
|
|
|
|
enabled widget.Bool
|
|
|
|
search widget.Editor
|
|
|
|
search widget.Editor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exitLAN widget.Bool
|
|
|
|
|
|
|
|
|
|
|
|
// webSigin is the button for the web-based sign-in flow.
|
|
|
|
// webSigin is the button for the web-based sign-in flow.
|
|
|
|
webSignin widget.Clickable
|
|
|
|
webSignin widget.Clickable
|
|
|
|
|
|
|
|
|
|
|
@ -303,6 +305,9 @@ func (ui *UI) layout(gtx layout.Context, sysIns system.Insets, state *clientStat
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
d.exits.Value = string(exitID)
|
|
|
|
d.exits.Value = string(exitID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ui.exitLAN.Changed() {
|
|
|
|
|
|
|
|
events = append(events, ExitAllowLANEvent(ui.exitLAN.Value))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ui.googleSignin.Clicked() {
|
|
|
|
if ui.googleSignin.Clicked() {
|
|
|
|
ui.signinType = googleSignin
|
|
|
|
ui.signinType = googleSignin
|
|
|
@ -892,12 +897,20 @@ func (ui *UI) layoutExitNodeDialog(gtx layout.Context, sysIns system.Insets, exi
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
layout.Flexed(1, func(gtx C) D {
|
|
|
|
layout.Flexed(1, func(gtx C) D {
|
|
|
|
gtx.Constraints.Min.Y = 0
|
|
|
|
gtx.Constraints.Min.Y = 0
|
|
|
|
// Add "none" exit node.
|
|
|
|
// Add "none" exit node, then "Allow LAN" checkbox, then the exit nodes.
|
|
|
|
n := len(exits) + 1
|
|
|
|
n := len(exits) + 2
|
|
|
|
return d.list.Layout(gtx, n, func(gtx C, idx int) D {
|
|
|
|
return d.list.Layout(gtx, n, func(gtx C, idx int) D {
|
|
|
|
|
|
|
|
if idx == 0 {
|
|
|
|
|
|
|
|
btn := material.CheckBox(ui.theme, &ui.exitLAN, "Allow LAN access")
|
|
|
|
|
|
|
|
return layout.Inset{
|
|
|
|
|
|
|
|
Right: unit.Dp(16),
|
|
|
|
|
|
|
|
Left: unit.Dp(16),
|
|
|
|
|
|
|
|
Bottom: unit.Dp(16),
|
|
|
|
|
|
|
|
}.Layout(gtx, btn.Layout)
|
|
|
|
|
|
|
|
}
|
|
|
|
node := Peer{Label: "None", Online: true}
|
|
|
|
node := Peer{Label: "None", Online: true}
|
|
|
|
if idx >= 1 {
|
|
|
|
if idx >= 2 {
|
|
|
|
node = exits[idx-1]
|
|
|
|
node = exits[idx-2]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lbl := node.Label
|
|
|
|
lbl := node.Label
|
|
|
|
if !node.Online {
|
|
|
|
if !node.Online {
|
|
|
|