ui

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewObjectComparer added in v0.14.0

func NewObjectComparer[T any](f func(T, T) int) glib.CompareDataFunc

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the main type for the app, containing all of the state necessary to run it.

func (*App) Quit

func (a *App) Quit()

Quit exits the app completely, causing Run to return.

func (*App) Run

func (a *App) Run(ctx context.Context)

Run runs the app, initializing everything and then entering the main loop. It will return if either ctx is cancelled or Quit is called.

type Confirmation

type Confirmation struct {
	Heading string
	Body    string
	Accept  string
	Reject  string
}

func (Confirmation) Show

func (d Confirmation) Show(a *App, res func(bool))

type Info added in v0.10.2

type Info struct {
	Heading string
	Body    string
	Extra   func() gtk.Widgetter
}

func (Info) Show added in v0.10.2

func (d Info) Show(a *App, closed func())

type MainWindow

type MainWindow struct {
	MainWindow      *adw.ApplicationWindow
	ToastOverlay    *adw.ToastOverlay
	SplitView       *adw.NavigationSplitView
	StatusSwitch    *gtk.Switch
	MainMenuButton  *gtk.MenuButton
	PeersList       *gtk.ListBox
	PeersStack      *adw.ViewStack
	WorkSpinner     *adw.Spinner
	ProfileDropDown *gtk.DropDown
	PageMenuButton  *gtk.MenuButton
	// contains filtered or unexported fields
}

func NewMainWindow

func NewMainWindow(app *App) *MainWindow

func (*MainWindow) Toast added in v0.17.0

func (win *MainWindow) Toast(msg string) *adw.Toast

func (*MainWindow) Update added in v0.17.0

func (win *MainWindow) Update(status tsutil.Status)

type MullvadPage added in v0.12.0

type MullvadPage struct {
	Page         *adw.StatusPage
	LocationList *gtk.ListBox
	// contains filtered or unexported fields
}

func NewMullvadPage added in v0.12.0

func NewMullvadPage(a *App, status *tsutil.IPNStatus) *MullvadPage

func (*MullvadPage) Actions added in v0.17.5

func (page *MullvadPage) Actions() gio.ActionGrouper

func (*MullvadPage) Init added in v0.12.0

func (page *MullvadPage) Init(row *PageRow)

func (*MullvadPage) Update added in v0.12.0

func (page *MullvadPage) Update(s tsutil.Status) bool

func (*MullvadPage) Widget added in v0.17.0

func (page *MullvadPage) Widget() gtk.Widgetter

type OfflinePage added in v0.18.0

type OfflinePage struct {
	Page           *adw.StatusPage
	NeedsAuthGroup *adw.PreferencesGroup
	// contains filtered or unexported fields
}

func NewOfflinePage added in v0.18.0

func NewOfflinePage(app *App) *OfflinePage

func (*OfflinePage) Actions added in v0.18.0

func (page *OfflinePage) Actions() gio.ActionGrouper

func (*OfflinePage) Init added in v0.18.0

func (page *OfflinePage) Init(row *PageRow)

func (*OfflinePage) Update added in v0.18.0

func (page *OfflinePage) Update(status tsutil.Status) bool

func (*OfflinePage) Widget added in v0.18.0

func (page *OfflinePage) Widget() gtk.Widgetter

type Page added in v0.12.0

type Page interface {
	Widget() gtk.Widgetter
	Actions() gio.ActionGrouper

	Init(*PageRow)
	Update(tsutil.Status) bool
}

Page represents the UI for a single page of the app. This usually corresponds to information about a specific peer in the tailnet.

type PageRow added in v0.17.0

type PageRow struct {
	// contains filtered or unexported fields
}

func NewPageRow added in v0.17.0

func NewPageRow(page *adw.ViewStackPage) *PageRow

func (*PageRow) Icon added in v0.18.1

func (row *PageRow) Icon() *gtk.Image

func (*PageRow) Page added in v0.17.0

func (row *PageRow) Page() *adw.ViewStackPage

func (*PageRow) Row added in v0.17.0

func (row *PageRow) Row() *adw.ActionRow

func (*PageRow) SetIcon added in v0.18.1

func (row *PageRow) SetIcon(icon gio.Iconner)

func (*PageRow) SetIconName added in v0.17.0

func (row *PageRow) SetIconName(name string)

func (*PageRow) SetSubtitle added in v0.17.0

func (row *PageRow) SetSubtitle(subtitle string)

func (*PageRow) SetTitle added in v0.17.0

func (row *PageRow) SetTitle(title string)

type PeerPage

type PeerPage struct {
	Page                  *adw.StatusPage
	IPList                *gtk.ListBox
	AdvertisedRoutesGroup *adw.PreferencesGroup
	AdvertisedRoutesList  *gtk.ListBox
	UDPRow                *adw.ActionRow
	UDP                   *gtk.Image
	IPv4Row               *adw.ActionRow
	IPv4Icon              *gtk.Image
	IPv4Addr              *gtk.Label
	IPv6Row               *adw.ActionRow
	IPv6Icon              *gtk.Image
	IPv6Addr              *gtk.Label
	UPnPRow               *adw.ActionRow
	UPnP                  *gtk.Image
	PMPRow                *adw.ActionRow
	PMP                   *gtk.Image
	PCPRow                *adw.ActionRow
	PCP                   *gtk.Image
	HairPinningRow        *adw.ActionRow
	HairPinning           *gtk.Image
	PreferredDERPRow      *adw.ActionRow
	PreferredDERP         *gtk.Label
	DERPLatencies         *adw.ExpanderRow
	MiscGroup             *adw.PreferencesGroup
	ExitNodeRow           *adw.SwitchRow
	OnlineRow             *adw.ActionRow
	Online                *gtk.Image
	LastSeenRow           *adw.ActionRow
	LastSeen              *gtk.Label
	CreatedRow            *adw.ActionRow
	Created               *gtk.Label
	LastHandshakeRow      *adw.ActionRow
	LastHandshake         *gtk.Label
	RxBytesRow            *adw.ActionRow
	RxBytes               *gtk.Label
	TxBytesRow            *adw.ActionRow
	TxBytes               *gtk.Label
	SendFileBurron        *adw.ButtonRow
	SendDirButton         *adw.ButtonRow
	DropTarget            *gtk.DropTarget
	// contains filtered or unexported fields
}

func NewPeerPage

func NewPeerPage(a *App, status *tsutil.IPNStatus, peer tailcfg.NodeView) *PeerPage

func (*PeerPage) Actions added in v0.17.5

func (page *PeerPage) Actions() gio.ActionGrouper

func (*PeerPage) Init added in v0.12.0

func (page *PeerPage) Init(row *PageRow)

func (*PeerPage) Update added in v0.12.0

func (page *PeerPage) Update(s tsutil.Status) bool

func (*PeerPage) Widget added in v0.17.0

func (page *PeerPage) Widget() gtk.Widgetter

type PreferencesDialog added in v0.17.0

type PreferencesDialog struct {
	PreferencesDialog         *adw.PreferencesDialog
	UseTrayIconRow            *adw.SwitchRow
	PollingIntervalRow        *adw.SpinRow
	PollingIntervalAdjustment *gtk.Adjustment
}

func NewPreferencesDialog added in v0.17.0

func NewPreferencesDialog() *PreferencesDialog

type Prompt

type Prompt struct {
	Heading     string
	Body        string
	Placeholder string
	Purpose     gtk.InputPurpose
	Responses   []PromptResponse
}

func (Prompt) Show

func (d Prompt) Show(a *App, initialValue string, res func(response, val string))

type PromptResponse added in v0.13.0

type PromptResponse struct {
	ID         string
	Label      string
	Appearance adw.ResponseAppearance
	Default    bool
}

type Select added in v0.16.0

type Select[T any] struct {
	Heading  string
	Body     string
	Options  []SelectOption[T]
	Multiple bool
}

func (Select[T]) Show added in v0.16.0

func (d Select[T]) Show(a *App, res func([]SelectOption[T]))

type SelectOption added in v0.16.0

type SelectOption[T any] struct {
	Title    string
	Subtitle string
	Value    T
}

type SelfPage added in v0.12.0

type SelfPage struct {
	Page                 *adw.StatusPage
	IPList               *gtk.ListBox
	OptionsGroup         *adw.PreferencesGroup
	AdvertiseExitNodeRow *adw.SwitchRow
	AllowLANAccessRow    *adw.SwitchRow
	AcceptRoutesRow      *adw.SwitchRow
	AdvertisedRoutesList *gtk.ListBox
	AdvertiseRouteButton *gtk.Button
	NetCheckGroup        *adw.PreferencesGroup
	NetCheckButton       *gtk.Button
	LastNetCheckRow      *adw.ActionRow
	LastNetCheck         *gtk.Label
	UDPRow               *adw.ActionRow
	UDP                  *gtk.Image
	IPv4Row              *adw.ActionRow
	IPv4Icon             *gtk.Image
	IPv4Addr             *gtk.Label
	IPv6Row              *adw.ActionRow
	IPv6Icon             *gtk.Image
	IPv6Addr             *gtk.Label
	UPnPRow              *adw.ActionRow
	UPnP                 *gtk.Image
	PMPRow               *adw.ActionRow
	PMP                  *gtk.Image
	PCPRow               *adw.ActionRow
	PCP                  *gtk.Image
	CaptivePortalRow     *adw.ActionRow
	CaptivePortal        *gtk.Image
	PreferredDERPRow     *adw.ActionRow
	PreferredDERP        *gtk.Label
	DERPLatencies        *adw.ExpanderRow
	FilesList            *gtk.ListBox
	// contains filtered or unexported fields
}

func NewSelfPage added in v0.12.0

func NewSelfPage(a *App, status *tsutil.IPNStatus) *SelfPage

func (*SelfPage) Actions added in v0.17.5

func (page *SelfPage) Actions() gio.ActionGrouper

func (*SelfPage) Init added in v0.12.0

func (page *SelfPage) Init(row *PageRow)

func (*SelfPage) Update added in v0.12.0

func (page *SelfPage) Update(status tsutil.Status) bool

func (*SelfPage) UpdateFiles added in v0.18.0

func (page *SelfPage) UpdateFiles(status *tsutil.FileStatus) bool

func (*SelfPage) UpdateIPN added in v0.18.0

func (page *SelfPage) UpdateIPN(status *tsutil.IPNStatus) bool

func (*SelfPage) Widget added in v0.17.0

func (page *SelfPage) Widget() gtk.Widgetter

Jump to

Keyboard shortcuts

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