Documentation
¶
Index ¶
- Constants
- Variables
- func AlignGrid(page TabPage, n int) TabPage
- func GetWindowText(hWnd win.HWND) string
- func NewAttributeDialog(title string, data *map[string]string) Dialog
- func NewAttributeTable(m *AttributeModel, nameWidth, valueWidth int) Composite
- func NewBasicDialog(assignTo **walk.Dialog, title string, icon Property, db DataBinder, yes func(), ...) Dialog
- func NewBrowseLineEdit(assignTo **walk.LineEdit, visible, enable, text Property, title, filter string, ...) Composite
- func NewListEdit(owner walk.Window, visible, text Property, title string, widget ...Widget) Composite
- func NewListEditDialog(title string, values []string, cb func(string) error) Dialog
- func NewNumberInput(opt NIOption) Composite
- func NewRadioButtonGroup(dataMember string, db *DataBinder, visible Property, buttons []RadioButton) Composite
- func PathOfConf(base string) string
- func RunUI() error
- func SetWindowText(hWnd win.HWND, text string) bool
- type AboutPage
- type AttributeModel
- type Conf
- type ConfBinder
- type ConfListModel
- func (m *ConfListModel) Add(item ...*Conf)
- func (m *ConfListModel) List() []*Conf
- func (m *ConfListModel) Move(i, j int)
- func (m *ConfListModel) PublishRowEdited(i int)
- func (m *ConfListModel) Remove(index ...int)
- func (m *ConfListModel) RowCount() int
- func (m *ConfListModel) RowEdited() *walk.IntEvent
- func (m *ConfListModel) SetStateByConf(conf *Conf, state consts.ConfigState) bool
- func (m *ConfListModel) SetStateByPath(path string, state consts.ConfigState) bool
- func (m *ConfListModel) Value(row, col int) interface{}
- type ConfPage
- type ConfView
- type DetailView
- type EditClientDialog
- type EditProxyDialog
- type FRPManager
- type GithubRelease
- type ListEditModel
- type ListItem
- type ListModel
- type LogModel
- type LogPage
- type NATDiscoveryDialog
- type NIOption
- type NonSortedModel
- type PanelView
- type PluginProxyDialog
- type PortProxyDialog
- type PrefPage
- type PropertiesDialog
- type ProxyModel
- func (m *ProxyModel) Add(proxy ...*config.Proxy)
- func (m *ProxyModel) BeforeRemove() *walk.IntEvent
- func (m *ProxyModel) HasName(name string) bool
- func (m *ProxyModel) Items() interface{}
- func (m *ProxyModel) Move(i, j int)
- func (m *ProxyModel) PublishRowEdited(row int)
- func (m *ProxyModel) PublishRowRenamed(row int)
- func (m *ProxyModel) Remove(index ...int)
- func (m *ProxyModel) Reset(row int)
- func (m *ProxyModel) RowEdited() *walk.IntEvent
- func (m *ProxyModel) RowRenamed() *walk.IntEvent
- type ProxyRow
- type ProxyStatusInfo
- type ProxyTracker
- type ProxyView
- type QuickAdd
- type SimpleProxyDialog
- type URLConf
- type URLImportDialog
- type ValidateDialog
Constants ¶
const AppName = "FRP Manager"
Variables ¶
var AppLocalName = i18n.Sprintf(AppName)
Functions ¶
func AlignGrid ¶ added in v1.10.1
func AlignGrid(page TabPage, n int) TabPage
AlignGrid resizes the first child of a grid to the width of the first column. After that, we keep a fixed width column regardless of whether the row is hidden or not.
func GetWindowText ¶ added in v1.12.0
func NewAttributeDialog ¶ added in v1.16.0
NewAttributeDialog returns a dialog box with data displayed in the attribute table.
func NewAttributeTable ¶ added in v1.16.0
func NewAttributeTable(m *AttributeModel, nameWidth, valueWidth int) Composite
NewAttributeTable returns a two-column table view. The first column is name and the second column is value. It provides the ability to edit cells by double-clicking.
func NewBasicDialog ¶ added in v1.7.1
func NewBasicDialog(assignTo **walk.Dialog, title string, icon Property, db DataBinder, yes func(), widgets ...Widget) Dialog
NewBasicDialog returns a dialog with given widgets and default buttons
func NewBrowseLineEdit ¶ added in v1.7.0
func NewBrowseLineEdit(assignTo **walk.LineEdit, visible, enable, text Property, title, filter string, file bool) Composite
NewBrowseLineEdit places a tool button at the tail of a LineEdit, and opens a file dialog when the button is clicked
func NewListEdit ¶ added in v1.21.0
func NewListEdit(owner walk.Window, visible, text Property, title string, widget ...Widget) Composite
NewListEdit places a tool button at the tail of a LineEdit, and opens a list edit dialog when the button is clicked.
func NewListEditDialog ¶ added in v1.21.0
NewListEditDialog returns a dialog box with the values displayed in the list box. It provides the ability to edit rows by double-clicking.
func NewNumberInput ¶ added in v1.16.0
func NewNumberInput(opt NIOption) Composite
NewNumberInput returns a number edit with custom prefix and suffix.
func NewRadioButtonGroup ¶ added in v1.7.1
func NewRadioButtonGroup(dataMember string, db *DataBinder, visible Property, buttons []RadioButton) Composite
NewRadioButtonGroup returns a simple radio button group
func PathOfConf ¶ added in v1.9.0
PathOfConf returns the file path of a config with given base file name
Types ¶
type AboutPage ¶
func NewAboutPage ¶
func NewAboutPage() *AboutPage
type AttributeModel ¶ added in v1.16.0
type AttributeModel struct {
walk.TableModelBase
// contains filtered or unexported fields
}
AttributeModel is a list of name-value pairs.
func NewAttributeModel ¶ added in v1.16.0
func NewAttributeModel(attrs map[string]string) *AttributeModel
func (*AttributeModel) Add ¶ added in v1.16.0
func (a *AttributeModel) Add(k, v string)
func (*AttributeModel) AsMap ¶ added in v1.16.0
func (a *AttributeModel) AsMap() map[string]string
func (*AttributeModel) Clear ¶ added in v1.16.0
func (a *AttributeModel) Clear()
func (*AttributeModel) Delete ¶ added in v1.16.0
func (a *AttributeModel) Delete(i int)
func (*AttributeModel) RowCount ¶ added in v1.16.0
func (a *AttributeModel) RowCount() int
func (*AttributeModel) Value ¶ added in v1.16.0
func (a *AttributeModel) Value(row, col int) interface{}
type Conf ¶ added in v1.7.0
type Conf struct {
// Path of the config file
Path string
// State of service
State consts.ConfigState
Data *config.ClientConfig
}
Conf contains all data of a config
type ConfBinder ¶ added in v1.7.0
type ConfBinder struct {
// Current selected config
Current *Conf
// List of configs
List func() []*Conf
// Set Config state
SetState func(conf *Conf, state consts.ConfigState) bool
// Commit will save the given config and try to reload service
Commit func(conf *Conf, flag runFlag)
}
ConfBinder is the view model of configs
type ConfListModel ¶
type ConfListModel struct {
walk.ReflectTableModelBase
sync.Mutex
// contains filtered or unexported fields
}
func NewConfListModel ¶
func NewConfListModel(items []*Conf) *ConfListModel
func (*ConfListModel) Add ¶ added in v1.21.0
func (m *ConfListModel) Add(item ...*Conf)
func (*ConfListModel) List ¶ added in v1.21.0
func (m *ConfListModel) List() []*Conf
func (*ConfListModel) Move ¶ added in v1.20.0
func (m *ConfListModel) Move(i, j int)
func (*ConfListModel) PublishRowEdited ¶ added in v1.21.0
func (m *ConfListModel) PublishRowEdited(i int)
func (*ConfListModel) Remove ¶ added in v1.21.0
func (m *ConfListModel) Remove(index ...int)
func (*ConfListModel) RowCount ¶ added in v1.20.0
func (m *ConfListModel) RowCount() int
func (*ConfListModel) RowEdited ¶ added in v1.21.0
func (m *ConfListModel) RowEdited() *walk.IntEvent
func (*ConfListModel) SetStateByConf ¶ added in v1.21.0
func (m *ConfListModel) SetStateByConf(conf *Conf, state consts.ConfigState) bool
func (*ConfListModel) SetStateByPath ¶ added in v1.21.0
func (m *ConfListModel) SetStateByPath(path string, state consts.ConfigState) bool
func (*ConfListModel) Value ¶ added in v1.20.0
func (m *ConfListModel) Value(row, col int) interface{}
type ConfPage ¶
func NewConfPage ¶
type DetailView ¶
func NewDetailView ¶
func NewDetailView() *DetailView
func (*DetailView) Invalidate ¶ added in v1.7.0
func (dv *DetailView) Invalidate()
func (*DetailView) OnCreate ¶ added in v1.7.0
func (dv *DetailView) OnCreate()
func (*DetailView) View ¶ added in v1.7.0
func (dv *DetailView) View() Widget
type EditClientDialog ¶ added in v1.7.0
func NewEditClientDialog ¶ added in v1.7.0
func NewEditClientDialog(conf *config.ClientConfig, create bool) *EditClientDialog
func (*EditClientDialog) Run ¶ added in v1.7.0
func (cd *EditClientDialog) Run(owner walk.Form) (int, error)
func (*EditClientDialog) View ¶ added in v1.7.0
func (cd *EditClientDialog) View() Dialog
type EditProxyDialog ¶ added in v1.7.0
type EditProxyDialog struct {
*walk.Dialog
Proxy *config.Proxy
// contains filtered or unexported fields
}
func NewEditProxyDialog ¶ added in v1.7.0
func (*EditProxyDialog) Run ¶ added in v1.7.0
func (pd *EditProxyDialog) Run(owner walk.Form) (int, error)
func (*EditProxyDialog) View ¶ added in v1.7.0
func (pd *EditProxyDialog) View() Dialog
type FRPManager ¶
type FRPManager struct {
*walk.MainWindow
// contains filtered or unexported fields
}
type GithubRelease ¶ added in v1.7.0
type ListEditModel ¶ added in v1.21.0
type ListEditModel struct {
walk.ReflectTableModelBase
// contains filtered or unexported fields
}
ListEditModel is a list of strings, but supports editing.
func NewListEditModel ¶ added in v1.21.0
func NewListEditModel(values []string) *ListEditModel
func (*ListEditModel) Add ¶ added in v1.21.0
func (m *ListEditModel) Add(value string)
func (*ListEditModel) AsString ¶ added in v1.21.0
func (m *ListEditModel) AsString() string
func (*ListEditModel) Clear ¶ added in v1.21.0
func (m *ListEditModel) Clear()
func (*ListEditModel) Delete ¶ added in v1.21.0
func (m *ListEditModel) Delete(i int)
func (*ListEditModel) Move ¶ added in v1.21.0
func (m *ListEditModel) Move(i, j int)
func (*ListEditModel) RowCount ¶ added in v1.21.0
func (m *ListEditModel) RowCount() int
func (*ListEditModel) Value ¶ added in v1.21.0
func (m *ListEditModel) Value(row, col int) interface{}
type LogModel ¶
type LogModel struct {
walk.TableModelBase
// contains filtered or unexported fields
}
type LogPage ¶
func NewLogPage ¶
type NATDiscoveryDialog ¶ added in v1.14.0
func NewNATDiscoveryDialog ¶ added in v1.14.0
func NewNATDiscoveryDialog(serverAddr string) *NATDiscoveryDialog
type NonSortedModel ¶ added in v1.14.0
type NonSortedModel[T any] struct { walk.ReflectTableModelBase // contains filtered or unexported fields }
NonSortedModel preserves the original order of items in the slice.
func NewNonSortedModel ¶ added in v1.14.0
func NewNonSortedModel[T any](items []*T) *NonSortedModel[T]
func (*NonSortedModel[T]) Items ¶ added in v1.14.0
func (m *NonSortedModel[T]) Items() interface{}
type PanelView ¶ added in v1.7.0
func NewPanelView ¶ added in v1.7.0
func NewPanelView() *PanelView
func (*PanelView) Invalidate ¶ added in v1.7.0
Invalidate updates views using the current config
func (*PanelView) StartService ¶ added in v1.7.0
StartService creates a daemon service of the given config, then starts it
func (*PanelView) StopService ¶ added in v1.7.0
StopService stops the service of the given config, then removes it
func (*PanelView) ToggleService ¶ added in v1.7.0
func (pv *PanelView) ToggleService()
type PluginProxyDialog ¶ added in v1.7.1
type PluginProxyDialog struct {
*walk.Dialog
Proxies []*config.Proxy
// contains filtered or unexported fields
}
func NewPluginProxyDialog ¶ added in v1.7.1
func NewPluginProxyDialog(title string, icon *walk.Icon, plugin string) *PluginProxyDialog
NewPluginProxyDialog creates proxy with given plugin
func (*PluginProxyDialog) GetProxies ¶ added in v1.7.1
func (pp *PluginProxyDialog) GetProxies() []*config.Proxy
type PortProxyDialog ¶ added in v1.12.0
type PortProxyDialog struct {
*walk.Dialog
Proxies []*config.Proxy
// contains filtered or unexported fields
}
func NewPortProxyDialog ¶ added in v1.12.0
func NewPortProxyDialog() *PortProxyDialog
func (*PortProxyDialog) GetProxies ¶ added in v1.12.0
func (pp *PortProxyDialog) GetProxies() []*config.Proxy
type PrefPage ¶ added in v1.12.0
func NewPrefPage ¶ added in v1.12.0
func NewPrefPage() *PrefPage
type PropertiesDialog ¶ added in v1.22.0
func NewPropertiesDialog ¶ added in v1.22.0
func NewPropertiesDialog(conf *Conf) *PropertiesDialog
type ProxyModel ¶ added in v1.7.1
type ProxyModel struct {
walk.ReflectTableModelBase
// contains filtered or unexported fields
}
func NewProxyModel ¶ added in v1.7.1
func NewProxyModel(conf *Conf) *ProxyModel
func (*ProxyModel) Add ¶ added in v1.21.0
func (m *ProxyModel) Add(proxy ...*config.Proxy)
func (*ProxyModel) BeforeRemove ¶ added in v1.21.0
func (m *ProxyModel) BeforeRemove() *walk.IntEvent
func (*ProxyModel) HasName ¶ added in v1.21.0
func (m *ProxyModel) HasName(name string) bool
func (*ProxyModel) Items ¶ added in v1.7.1
func (m *ProxyModel) Items() interface{}
func (*ProxyModel) Move ¶ added in v1.18.0
func (m *ProxyModel) Move(i, j int)
func (*ProxyModel) PublishRowEdited ¶ added in v1.21.0
func (m *ProxyModel) PublishRowEdited(row int)
func (*ProxyModel) PublishRowRenamed ¶ added in v1.21.0
func (m *ProxyModel) PublishRowRenamed(row int)
func (*ProxyModel) Remove ¶ added in v1.21.0
func (m *ProxyModel) Remove(index ...int)
func (*ProxyModel) Reset ¶ added in v1.21.0
func (m *ProxyModel) Reset(row int)
func (*ProxyModel) RowEdited ¶ added in v1.21.0
func (m *ProxyModel) RowEdited() *walk.IntEvent
func (*ProxyModel) RowRenamed ¶ added in v1.21.0
func (m *ProxyModel) RowRenamed() *walk.IntEvent
type ProxyRow ¶ added in v1.21.0
type ProxyRow struct {
*config.Proxy
ProxyStatusInfo
// Domains is a list of domains bound to this proxy
Domains string
// DisplayLocalIP changes the local address shown in table
DisplayLocalIP string
// DisplayLocalPort changes the local port shown in table
DisplayLocalPort string
// DisplayRemotePort changes the remote port shown in table.
DisplayRemotePort string
}
func NewProxyRow ¶ added in v1.21.0
func (*ProxyRow) UpdateRemotePort ¶ added in v1.21.0
func (m *ProxyRow) UpdateRemotePort()
UpdateRemotePort attempts to display the remote port obtained from the server if the requested remote port is empty.
type ProxyStatusInfo ¶ added in v1.22.0
type ProxyStatusInfo struct {
// Running state.
State consts.ProxyState
// Error message.
Error string
// Name of the proxy reporting the status.
StateSource string
// Remote address got from server.
RemoteAddr string
}
type ProxyTracker ¶ added in v1.21.0
func NewProxyTracker ¶ added in v1.21.0
func NewProxyTracker(owner walk.Form, model *ProxyModel, refresh bool) (tracker *ProxyTracker)
func (*ProxyTracker) Close ¶ added in v1.21.0
func (pt *ProxyTracker) Close()
type ProxyView ¶ added in v1.7.1
func NewProxyView ¶ added in v1.7.1
func NewProxyView() *ProxyView
func (*ProxyView) Invalidate ¶ added in v1.7.1
func (pv *ProxyView) Invalidate()
type QuickAdd ¶ added in v1.7.1
type QuickAdd interface {
// Run a new simple dialog to input few parameters
Run(owner walk.Form) (int, error)
// GetProxies returns the proxies generated by quick-add dialog
GetProxies() []*config.Proxy
}
QuickAdd is the interface that must be implemented to build a quick-add dialog
type SimpleProxyDialog ¶ added in v1.7.0
type SimpleProxyDialog struct {
*walk.Dialog
Proxies []*config.Proxy
// contains filtered or unexported fields
}
func NewSimpleProxyDialog ¶ added in v1.7.0
func NewSimpleProxyDialog(title string, icon *walk.Icon, service string, types []string, port int) *SimpleProxyDialog
NewSimpleProxyDialog creates proxies connecting to the local service
func (*SimpleProxyDialog) GetProxies ¶ added in v1.7.1
func (sp *SimpleProxyDialog) GetProxies() []*config.Proxy
type URLConf ¶ added in v1.9.0
type URLConf struct {
// Filename is the name of the downloaded file
Filename string
// Zip defines whether the Data is a zip file
Zip bool
// Downloaded raw Data from URL
Data []byte
}
URLConf provides config data downloaded from URL
type URLImportDialog ¶ added in v1.9.0
type URLImportDialog struct {
*walk.Dialog
// Items contain the downloaded data from URLs
Items []URLConf
// contains filtered or unexported fields
}
func NewURLImportDialog ¶ added in v1.9.0
func NewURLImportDialog() *URLImportDialog
type ValidateDialog ¶ added in v1.12.0
type ValidateDialog struct {
// contains filtered or unexported fields
}
ValidateDialog validates the administration password.
func NewValidateDialog ¶ added in v1.12.0
func NewValidateDialog() *ValidateDialog
func (*ValidateDialog) Run ¶ added in v1.12.0
func (vd *ValidateDialog) Run() (int, error)