Skip to content

Commit

Permalink
Fix admin server config and ui
Browse files Browse the repository at this point in the history
  • Loading branch information
koho committed Feb 16, 2024
1 parent e9882b4 commit 44d1399
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions pkg/config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ func (conf *ClientConfig) Complete(read bool) {
conf.AdminUser = ""
conf.AdminPwd = ""
conf.AssetsDir = ""
conf.AdminTLS = v1.TLSConfig{}
conf.PprofEnable = false
}
conf.AutoDelete = conf.AutoDelete.Complete()
if !conf.TCPMux {
Expand Down
2 changes: 1 addition & 1 deletion pkg/consts/res.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const (
IconHttpFile = 69
IconHttpProxy = 114
IconOpenPort = 135
IconVpn = 47
IconLock = 47
IconNewVersion1 = -1028
IconNewVersion2 = 1
IconUpdate = -47
Expand Down
12 changes: 8 additions & 4 deletions ui/editclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,13 @@ func (cd *EditClientDialog) adminConfPage() TabPage {
LineEdit{Text: Bind("AdminAddr"), StretchFactor: 2},
Label{Text: ":"},
LineEdit{Name: "adminPort", Text: Bind("AdminPort", consts.ValidateInteger)},
ToolButton{Image: loadSysIcon("shell32", consts.IconVpn, 16), ToolTipText: "TLS", OnClicked: func() {
cd.adminTLSDialog().Run(cd.Form())
}},
ToolButton{
Enabled: Bind("adminPort.Text != ''"),
Image: loadSysIcon("shell32", consts.IconLock, 16),
ToolTipText: "TLS", OnClicked: func() {
cd.adminTLSDialog().Run(cd.Form())
},
},
},
},
Label{Enabled: Bind("adminPort.Text != ''"), Text: i18n.SprintfColon("User")},
Expand Down Expand Up @@ -397,7 +401,7 @@ func (cd *EditClientDialog) experimentDialog() Dialog {
func (cd *EditClientDialog) adminTLSDialog() Dialog {
var widgets [4]*walk.LineEdit
customDialog := NewBasicDialog(nil, "TLS",
loadSysIcon("shell32", consts.IconVpn, 32),
loadSysIcon("shell32", consts.IconLock, 32),
DataBinder{DataSource: &cd.binder.AdminTLS}, nil,
Label{Text: i18n.SprintfColon("Host Name")},
LineEdit{AssignTo: &widgets[0], Text: Bind("ServerName")},
Expand Down
4 changes: 2 additions & 2 deletions ui/proxyview.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ func (pv *ProxyView) createToolbar() ToolBar {
Action{
AssignTo: &pv.vpnAction,
Text: "OpenVPN",
Image: loadSysIcon("shell32", consts.IconVpn, 16),
Image: loadSysIcon("shell32", consts.IconLock, 16),
OnTriggered: func() {
pv.onQuickAdd(NewSimpleProxyDialog("OpenVPN", loadSysIcon("shell32", consts.IconVpn, 32),
pv.onQuickAdd(NewSimpleProxyDialog("OpenVPN", loadSysIcon("shell32", consts.IconLock, 32),
"openvpn", []string{consts.ProxyTypeTCP, consts.ProxyTypeUDP}, ":1194"))
},
},
Expand Down

0 comments on commit 44d1399

Please sign in to comment.