Documentation ¶
Index ¶
- Constants
- Variables
- func AlignGrid(page TabPage, n int) TabPage
- func GetWindowText(hWnd win.HWND) string
- 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 NewRadioButtonGroup(dataMember string, db *DataBinder, buttons []RadioButton) Composite
- func PathOfConf(base string) string
- func RunUI() error
- func SetWindowText(hWnd win.HWND, text string) bool
- type AboutPage
- type Conf
- type ConfBinder
- type ConfListModel
- type ConfPage
- type ConfView
- type DetailView
- type EditClientDialog
- type EditProxyDialog
- type FRPManager
- type GithubRelease
- type ListModel
- type LogModel
- type LogPage
- type PanelView
- type PluginProxyDialog
- type PortProxyDialog
- type PrefPage
- type ProxyItem
- type ProxyModel
- type ProxyView
- type QuickAdd
- type SimpleProxyDialog
- type StringPair
- type TextLine
- type URLConf
- type URLImportDialog
- type ValidateDialog
- type View
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 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 NewRadioButtonGroup ¶ added in v1.7.1
func NewRadioButtonGroup(dataMember string, db *DataBinder, 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 Conf ¶ added in v1.7.0
type Conf struct { sync.Mutex // Name of the config Name string DisplayName string // Path of the config file Path string // State of service State consts.ServiceState // Install indicates whether a service is installed Install bool // Data is ClientConfig or ServerConfig Data config.Config }
Conf contains all data of a config
type ConfBinder ¶ added in v1.7.0
type ConfBinder struct { // Current selected config Current *Conf // Selected indicates whether there's a selected config Selected bool // Commit will save the given config and try to reload service Commit func(conf *Conf, flag runFlag) }
ConfBinder is the view model of the current selected config
type ConfListModel ¶
type ConfListModel struct { walk.TableModelBase // contains filtered or unexported fields }
func NewConfListModel ¶
func NewConfListModel(items []*Conf) *ConfListModel
func (*ConfListModel) Items ¶
func (m *ConfListModel) Items() interface{}
type ConfPage ¶
func NewConfPage ¶
func NewConfPage() *ConfPage
type ConfView ¶
func NewConfView ¶
func NewConfView() *ConfView
func (*ConfView) ImportFiles ¶ added in v1.8.0
func (*ConfView) Invalidate ¶ added in v1.7.0
func (cv *ConfView) Invalidate()
Invalidate conf view with last selected index
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
type EditClientDialog struct { *walk.Dialog // Config data Conf *Conf ShouldRestart bool Added bool // contains filtered or unexported fields }
func NewEditClientDialog ¶ added in v1.7.0
func NewEditClientDialog(conf *Conf, name string) *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 NewEditProxyDialog(configName string, proxy *config.Proxy, exist bool) *EditProxyDialog
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 ListModel ¶ added in v1.7.0
type ListModel struct { walk.ListModelBase // contains filtered or unexported fields }
func NewListModel ¶ added in v1.7.0
type LogModel ¶
type LogModel struct { walk.ReflectTableModelBase // contains filtered or unexported fields }
func NewLogModel ¶
type LogPage ¶
func NewLogPage ¶
func NewLogPage() *LogPage
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
func (pv *PanelView) Invalidate()
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 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) Items ¶ added in v1.7.1
func (m *ProxyModel) Items() interface{}
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, localAddr string) *SimpleProxyDialog
NewSimpleProxyDialog creates proxies connecting to the local service
func (*SimpleProxyDialog) GetProxies ¶ added in v1.7.1
func (sp *SimpleProxyDialog) GetProxies() []*config.Proxy
type StringPair ¶ added in v1.11.0
StringPair is a simple struct to hold a pair of strings.
func NewDefaultListModel ¶ added in v1.7.0
func NewDefaultListModel(items []string, defaultKey string, defaultName string) []*StringPair
NewDefaultListModel creates a default item at the top of the model.
func NewStringPairModel ¶ added in v1.11.0
func NewStringPairModel(keys []string, values []string, defaultValue string) []*StringPair
NewStringPairModel creates a slice of string pair from two string slices.
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 // Rename defines whether we can change the name of // new config if the original name exists. Rename 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
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)
type View ¶ added in v1.7.0
type View interface { // View should define widget in declarative way, and will // be called by the parent widget. View() Widget // OnCreate will be called after the creation of views. The // view reference should be available now. OnCreate() // Invalidate should be called if data that view relying on // is changed. The view should be updated with new data. Invalidate() }
View is the interface that must be implemented to build a Widget.