ui

package
v1.26.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const AppName = "FRP Manager"

Variables

View Source
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 GetWindowText(hWnd win.HWND) string

func NewAttributeDialog added in v1.16.0

func NewAttributeDialog(title string, data *map[string]string) Dialog

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

func NewListEditDialog(title string, values []string, cb func(string) error) Dialog

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

func PathOfConf(base string) string

PathOfConf returns the file path of a config with given base file name

func RunUI

func RunUI() error

func SetWindowText added in v1.12.0

func SetWindowText(hWnd win.HWND, text string) bool

Types

type AboutPage

type AboutPage struct {
	*walk.TabPage
	// contains filtered or unexported fields
}

func NewAboutPage

func NewAboutPage() *AboutPage

func (*AboutPage) OnCreate added in v1.7.0

func (ap *AboutPage) OnCreate()

func (*AboutPage) Page added in v1.7.0

func (ap *AboutPage) Page() TabPage

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

func NewConf added in v1.7.0

func NewConf(path string, data *config.ClientConfig) *Conf

func (*Conf) Delete added in v1.7.0

func (conf *Conf) Delete() error

Delete config will remove service, logs, config file in disk

func (*Conf) Name added in v1.7.0

func (conf *Conf) Name() string

func (*Conf) Save added in v1.7.0

func (conf *Conf) Save() error

Save config to the disk. The config will be completed before saving

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

type ConfPage struct {
	*walk.TabPage
	// contains filtered or unexported fields
}

func NewConfPage

func NewConfPage(cfgList []*Conf) *ConfPage

func (*ConfPage) Close added in v1.21.0

func (cp *ConfPage) Close() error

func (*ConfPage) OnCreate added in v1.7.0

func (cp *ConfPage) OnCreate()

func (*ConfPage) Page added in v1.7.0

func (cp *ConfPage) Page() TabPage

type ConfView

type ConfView struct {
	*walk.Composite
	// contains filtered or unexported fields
}

func NewConfView

func NewConfView(cfgList []*Conf) *ConfView

func (*ConfView) ImportFiles added in v1.8.0

func (cv *ConfView) ImportFiles(files []string)

func (*ConfView) OnCreate added in v1.7.0

func (cv *ConfView) OnCreate()

func (*ConfView) View added in v1.7.0

func (cv *ConfView) View() Widget

type DetailView

type DetailView struct {
	*walk.Composite
	// contains filtered or unexported fields
}

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
	// contains filtered or unexported fields
}

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 NewEditProxyDialog(proxy *config.Proxy, visitors []string, create, legacyFormat bool, nameChecker func(string) 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 GithubRelease struct {
	TagName string `json:"tag_name"`
	HtmlUrl string `json:"html_url"`
}

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 ListItem added in v1.20.0

type ListItem struct {
	Title any
	Value string
}

type ListModel added in v1.7.0

type ListModel []*ListItem

func NewListModel added in v1.7.0

func NewListModel(values []string, titles ...any) ListModel

type LogModel

type LogModel struct {
	walk.TableModelBase
	// contains filtered or unexported fields
}

func NewLogModel

func NewLogModel(paths []string, maxLines int) (*LogModel, bool)

func (*LogModel) ReadMore added in v1.20.0

func (m *LogModel) ReadMore() (int, error)

func (*LogModel) Reset

func (m *LogModel) Reset()

func (*LogModel) RowCount added in v1.20.0

func (m *LogModel) RowCount() int

func (*LogModel) Value added in v1.20.0

func (m *LogModel) Value(row, col int) any

type LogPage

type LogPage struct {
	*walk.TabPage
	// contains filtered or unexported fields
}

func NewLogPage

func NewLogPage() (*LogPage, error)

func (*LogPage) Close added in v1.20.0

func (lp *LogPage) Close() error

func (*LogPage) OnCreate added in v1.7.0

func (lp *LogPage) OnCreate()

func (*LogPage) Page added in v1.7.0

func (lp *LogPage) Page() TabPage

type NATDiscoveryDialog added in v1.14.0

type NATDiscoveryDialog struct {
	*walk.Dialog
	// contains filtered or unexported fields
}

func NewNATDiscoveryDialog added in v1.14.0

func NewNATDiscoveryDialog(serverAddr string) *NATDiscoveryDialog

func (*NATDiscoveryDialog) Run added in v1.14.0

func (nd *NATDiscoveryDialog) Run(owner walk.Form) (int, error)

type NIOption added in v1.16.0

type NIOption struct {
	Title        string
	Value        Property
	Suffix       string
	Min          float64
	Max          float64
	Width        int
	Style        uint32
	Greedy       bool
	NoSpinButton bool
	NoSpacer     bool
	Visible      Property
	Enabled      Property
}

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

type PanelView struct {
	*walk.GroupBox
	// contains filtered or unexported fields
}

func NewPanelView added in v1.7.0

func NewPanelView() *PanelView

func (*PanelView) Invalidate added in v1.7.0

func (pv *PanelView) Invalidate(state bool)

Invalidate updates views using the current config

func (*PanelView) OnCreate added in v1.7.0

func (pv *PanelView) OnCreate()

func (*PanelView) StartService added in v1.7.0

func (pv *PanelView) StartService(conf *Conf) error

StartService creates a daemon service of the given config, then starts it

func (*PanelView) StopService added in v1.7.0

func (pv *PanelView) StopService(conf *Conf) (err error)

StopService stops the service of the given config, then removes it

func (*PanelView) ToggleService added in v1.7.0

func (pv *PanelView) ToggleService()

func (*PanelView) View added in v1.7.0

func (pv *PanelView) View() Widget

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

func (*PluginProxyDialog) Run added in v1.7.1

func (pp *PluginProxyDialog) Run(owner walk.Form) (int, error)

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

func (*PortProxyDialog) Run added in v1.12.0

func (pp *PortProxyDialog) Run(owner walk.Form) (int, error)

type PrefPage added in v1.12.0

type PrefPage struct {
	*walk.TabPage
	// contains filtered or unexported fields
}

func NewPrefPage added in v1.12.0

func NewPrefPage() *PrefPage

func (*PrefPage) OnCreate added in v1.12.0

func (pp *PrefPage) OnCreate()

func (*PrefPage) Page added in v1.12.0

func (pp *PrefPage) Page() TabPage

type PropertiesDialog added in v1.22.0

type PropertiesDialog struct {
	*walk.Dialog
	// contains filtered or unexported fields
}

func NewPropertiesDialog added in v1.22.0

func NewPropertiesDialog(conf *Conf) *PropertiesDialog

func (*PropertiesDialog) Run added in v1.22.0

func (pd *PropertiesDialog) Run(owner walk.Form) (int, error)

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 NewProxyRow(p *config.Proxy) *ProxyRow

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

type ProxyTracker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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

type ProxyView struct {
	*walk.Composite
	// contains filtered or unexported fields
}

func NewProxyView added in v1.7.1

func NewProxyView() *ProxyView

func (*ProxyView) Invalidate added in v1.7.1

func (pv *ProxyView) Invalidate()

func (*ProxyView) OnCreate added in v1.7.1

func (pv *ProxyView) OnCreate()

func (*ProxyView) View added in v1.7.1

func (pv *ProxyView) View() Widget

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

func (*SimpleProxyDialog) Run added in v1.7.0

func (sp *SimpleProxyDialog) Run(owner walk.Form) (int, error)

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

func (*URLImportDialog) Run added in v1.9.0

func (ud *URLImportDialog) Run(owner walk.Form) (int, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL