Revert "Add DNS/routing prefs like on desktop (#86)" (#108)

This reverts commit d316acaa3d.
pull/110/head
Charlotte Brandhorst-Satzkorn 11 months ago committed by GitHub
parent 4789733d46
commit 39717f946b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -188,18 +188,15 @@ type SetLoginServerEvent struct {
// UIEvent types.
type (
ToggleEvent struct{}
ReauthEvent struct{}
BugEvent struct{}
WebAuthEvent struct{}
GoogleAuthEvent struct{}
LogoutEvent struct{}
OSSLicensesEvent struct{}
BeExitNodeEvent bool
ExitAllowLANEvent bool
AllowIncomingTransactionsEvent bool
UseTailscaleDNSEvent bool
UseTailscaleSubnetsEvent bool
ToggleEvent struct{}
ReauthEvent struct{}
BugEvent struct{}
WebAuthEvent struct{}
GoogleAuthEvent struct{}
LogoutEvent struct{}
OSSLicensesEvent struct{}
BeExitNodeEvent bool
ExitAllowLANEvent bool
)
// serverOAuthID is the OAuth ID of the tailscale-android server, used
@ -437,15 +434,6 @@ func (a *App) runBackend() error {
case ExitAllowLANEvent:
state.Prefs.ExitNodeAllowLANAccess = bool(e)
go b.backend.SetPrefs(state.Prefs)
case UseTailscaleDNSEvent:
state.Prefs.CorpDNS = bool(e)
go b.backend.SetPrefs(state.Prefs)
case UseTailscaleSubnetsEvent:
state.Prefs.RouteAll = !bool(e)
go b.backend.SetPrefs(state.Prefs)
case AllowIncomingTransactionsEvent:
state.Prefs.ShieldsUp = !bool(e)
go b.backend.SetPrefs(state.Prefs)
case WebAuthEvent:
if !signingIn {
go b.backend.StartLoginInteractive()
@ -1142,12 +1130,6 @@ func (a *App) processUIEvents(w *app.Window, events []UIEvent, act jni.Object, s
requestBackend(e)
case ExitAllowLANEvent:
requestBackend(e)
case AllowIncomingTransactionsEvent:
requestBackend(e)
case UseTailscaleDNSEvent:
requestBackend(e)
case UseTailscaleSubnetsEvent:
requestBackend(e)
case WebAuthEvent:
a.store.WriteString(loginMethodPrefKey, loginMethodWeb)
requestBackend(e)

@ -53,10 +53,6 @@ type UI struct {
exitLAN widget.Bool
allowIncomingTransactions widget.Bool
useTailscaleDNS widget.Bool
useTailscaleSubnets widget.Bool
// webSigin is the button for the web-based sign-in flow.
webSignin widget.Clickable
@ -66,9 +62,6 @@ type UI struct {
// openExitDialog opens the exit node picker.
openExitDialog widget.Clickable
// openPreferencesDialog opens the preferences dialog
openPreferencesDialog widget.Clickable
signinType signinType
setLoginServer bool
@ -87,14 +80,6 @@ type UI struct {
list layout.List
}
// exitDialog is state for the exit node dialog.
preferencesDialog struct {
show bool
dismiss Dismiss
exits widget.Enum
list layout.List
}
runningExit bool // are we an exit node now?
qr struct {
@ -117,7 +102,6 @@ type UI struct {
useLoginServer widget.Clickable
copy widget.Clickable
preferences widget.Clickable
reauth widget.Clickable
bug widget.Clickable
beExit widget.Clickable
@ -276,7 +260,6 @@ func newUI(store *stateStore) (*UI, error) {
ui.search.SingleLine = true
ui.loginServer.SingleLine = true
ui.exitDialog.list.Axis = layout.Vertical
ui.preferencesDialog.list.Axis = layout.Vertical
ui.shareDialog.list.Axis = layout.Vertical
// If they've ever set the control plane, give them the debug menu right away.
@ -311,8 +294,6 @@ func (ui *UI) activeDialog() *bool {
return &ui.shareDialog.show
case ui.exitDialog.show:
return &ui.exitDialog.show
case ui.preferencesDialog.show:
return &ui.preferencesDialog.show
case ui.aboutDialog.show:
return &ui.aboutDialog.show
}
@ -403,15 +384,6 @@ func (ui *UI) layout(gtx layout.Context, sysIns system.Insets, state *clientStat
if ui.exitLAN.Changed() {
events = append(events, ExitAllowLANEvent(ui.exitLAN.Value))
}
if ui.allowIncomingTransactions.Changed() {
events = append(events, AllowIncomingTransactionsEvent(ui.allowIncomingTransactions.Value))
}
if ui.useTailscaleDNS.Changed() {
events = append(events, UseTailscaleDNSEvent(ui.useTailscaleDNS.Value))
}
if ui.useTailscaleSubnets.Changed() {
events = append(events, UseTailscaleSubnetsEvent(ui.useTailscaleSubnets.Value))
}
if ui.googleSignin.Clicked() {
ui.signinType = googleSignin
@ -467,10 +439,6 @@ func (ui *UI) layout(gtx layout.Context, sysIns system.Insets, state *clientStat
ui.exitDialog.show = true
}
if ui.menuClicked(&ui.menu.preferences) || ui.openPreferencesDialog.Clicked() {
ui.preferencesDialog.show = true
}
if ui.menuClicked(&ui.menu.about) {
ui.aboutDialog.show = true
}
@ -600,8 +568,6 @@ func (ui *UI) layout(gtx layout.Context, sysIns system.Insets, state *clientStat
ui.layoutExitNodeDialog(gtx, sysIns, state.backend.Exits)
ui.layoutPreferencesDialog(gtx, sysIns, state.backend.Exits)
ui.layoutShareDialog(gtx, sysIns)
ui.layoutAboutDialog(gtx, sysIns)
@ -1114,70 +1080,6 @@ func (ui *UI) layoutExitNodeDialog(gtx layout.Context, sysIns system.Insets, exi
})
}
// layoutPreferencesDialog lays out the preferences dialog.
func (ui *UI) layoutPreferencesDialog(gtx layout.Context, sysIns system.Insets, exits []Peer) {
d := &ui.preferencesDialog
if d.dismiss.Dismissed(gtx) {
d.show = false
}
if !d.show {
return
}
d.dismiss.Add(gtx, argb(0x66000000))
layout.Inset{
Top: sysIns.Top + unit.Dp(16),
Right: sysIns.Right + unit.Dp(16),
Bottom: sysIns.Bottom + unit.Dp(16),
Left: sysIns.Left + unit.Dp(16),
}.Layout(gtx, func(gtx C) D {
return layout.Center.Layout(gtx, func(gtx C) D {
gtx.Constraints.Min.X = gtx.Dp(unit.Dp(300))
gtx.Constraints.Max.X = gtx.Constraints.Min.X
return layoutDialog(gtx, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
// Header.
return layout.Inset{
Top: unit.Dp(16),
Right: unit.Dp(20),
Left: unit.Dp(20),
Bottom: unit.Dp(16),
}.Layout(gtx, func(gtx C) D {
l := material.Body1(ui.theme, "Preferences")
l.Font.Weight = text.Bold
return l.Layout(gtx)
})
}),
layout.Rigid(func(gtx C) D {
btn := material.CheckBox(ui.theme, &ui.allowIncomingTransactions, "Allow Incoming Connections")
return layout.Inset{
Right: unit.Dp(16),
Left: unit.Dp(16),
Bottom: unit.Dp(16),
}.Layout(gtx, btn.Layout)
}),
layout.Rigid(func(gtx C) D {
btn := material.CheckBox(ui.theme, &ui.useTailscaleDNS, "Use Tailscale DNS")
return layout.Inset{
Right: unit.Dp(16),
Left: unit.Dp(16),
Bottom: unit.Dp(16),
}.Layout(gtx, btn.Layout)
}),
layout.Rigid(func(gtx C) D {
btn := material.CheckBox(ui.theme, &ui.useTailscaleSubnets, "Use Tailscale Subnets")
return layout.Inset{
Right: unit.Dp(16),
Left: unit.Dp(16),
Bottom: unit.Dp(16),
}.Layout(gtx, btn.Layout)
}),
)
})
})
})
}
// layoutAboutDialog lays out the about dialog.
func (ui *UI) layoutAboutDialog(gtx layout.Context, sysIns system.Insets) {
d := &ui.aboutDialog
@ -1319,7 +1221,6 @@ func (ui *UI) layoutMenu(gtx layout.Context, sysIns system.Insets, expiry time.T
if showExits {
items = append(items, menuItem{title: "Use exit node...", btn: &menu.exits})
}
items = append(items, menuItem{title: "Preferences", btn: &menu.preferences})
items = append(items,
menuItem{title: "Bug report", btn: &menu.bug},
menuItem{title: "Reauthenticate", btn: &menu.reauth},

Loading…
Cancel
Save