Documentation
¶
Overview ¶
Package tui is rig's terminal control plane: one screen per concern (services, logs, metrics, traces, queries, key-value, data, load, manifests, hosts), all driven by the same engine as the CLI. Screens load nothing until opened and refresh only while showing; the service list is one runtime call per refresh.
Index ¶
- func Chat(ctx context.Context, a *engine.App, id string) error
- func CloseSession(projectDir, id string) error
- func CurrentTheme() string
- func Palettes() map[string]Theme
- func PickSession(rows [][]string, close func(i int) error) (int, error)
- func Pinned(projectDir string) (id, env string)
- func Resume(ctx context.Context, open func(env string) (*engine.App, error), ...) error
- func Run(ctx context.Context, a *engine.App) error
- func SaveThemeFile(name, from string) (string, error)
- func ThemeNames() []string
- func Unpin(projectDir string)
- func UseTheme(name string) error
- type Session
- type Theme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chat ¶
Chat opens the UI with the assistant's chat open, on conversation id ("" a new one, "last" the newest).
func CloseSession ¶
CloseSession forgets a saved session.
func CurrentTheme ¶ added in v0.13.0
func CurrentTheme() string
CurrentTheme is $RIG_THEME, else what `rig theme <name>` chose, else "default".
func Palettes ¶ added in v0.30.0
Palettes are every theme resolved, light shades filled in, for the web UI.
func PickSession ¶
PickSession is `rig resume`'s chooser: rows are id, kind, saved, what; enter picks one, d closes the selected one (through close), q leaves. It returns the picked row, -1 for none.
func Pinned ¶ added in v0.11.0
Pinned is the session rig opens on (the last one S saved) and its environment; "" for none.
func Resume ¶
func Resume(ctx context.Context, open func(env string) (*engine.App, error), projectDir, id string) error
Resume opens the saved session's environment and the UI as it was.
func SaveThemeFile ¶ added in v0.13.0
SaveThemeFile writes theme name, in full, to the themes folder as a starting point to edit.
func ThemeNames ¶ added in v0.13.0
func ThemeNames() []string
ThemeNames are the built-in themes and the files in ~/.config/rig/themes (name.yaml), sorted.
Types ¶
type Session ¶
type Session struct {
ID string `json:"id"`
Env string `json:"env"`
Created time.Time `json:"created"`
Saved time.Time `json:"saved"`
Tab int `json:"tab"`
TabName string `json:"tab_name,omitempty"`
LogServices []string `json:"log_services,omitempty"`
LogInstances []string `json:"log_instances,omitempty"`
LogGrep string `json:"log_grep,omitempty"`
Queries map[string]*spec.Query `json:"adhoc_queries,omitempty"`
Scheduled map[string]bool `json:"scheduled,omitempty"`
Results map[string]savedResult `json:"results,omitempty"`
Runs []queryRun `json:"runs,omitempty"`
DataPaths map[string][]string `json:"data_paths,omitempty"`
Dashboard int `json:"dashboard,omitempty"`
Load map[string]savedLoadHist `json:"load,omitempty"`
Sorts map[string]gridSort `json:"sorts,omitempty"`
Widths map[string]int `json:"widths,omitempty"`
Drafts map[string]draft `json:"drafts,omitempty"`
Commands []string `json:"commands,omitempty"`
Activity []savedJob `json:"activity,omitempty"`
Errors []loggedErr `json:"errors,omitempty"`
Views map[string]map[string]string `json:"views,omitempty"`
}
Session is what S saves and `rig resume` brings back: the screen, what each screen was showing, and the query results and history of the run.
func ListSessions ¶
ListSessions are the project's saved sessions, newest first, without their results.
func LoadSession ¶
LoadSession reads a saved session of the project; id "" or "last" is the newest.
type Theme ¶ added in v0.13.0
type Theme struct {
// Base is the theme this one starts from; a theme file sets only what it changes.
Base string `yaml:"base,omitempty"`
Accent string `yaml:"accent,omitempty"`
OnAccent string `yaml:"on_accent,omitempty"`
Green string `yaml:"green,omitempty"`
Amber string `yaml:"amber,omitempty"`
Red string `yaml:"red,omitempty"`
Purple string `yaml:"purple,omitempty"`
Light themeShades `yaml:"light,omitempty"`
// Series are the chart colours, in order.
Series []string `yaml:"series,omitempty,flow"`
// contains filtered or unexported fields
}
Theme is the UI's colours. Text, Dim, Placeholder, Panel, Bar and the three backgrounds are for a dark terminal; Light holds their light-terminal values (empty: the default theme's).
Source Files
¶
- bigtext.go
- chartview.go
- chat.go
- data_filter.go
- edit.go
- envinfo.go
- filesearch.go
- form.go
- fuzzy.go
- grid.go
- hover.go
- jobs.go
- jsontree.go
- keys.go
- kv_locate.go
- layout.go
- layouts.go
- logquery.go
- logtree.go
- logview.go
- manifest_edit.go
- manifest_fields.go
- manifest_search.go
- markdown.go
- mouse.go
- openwith.go
- picker.go
- profile.go
- report.go
- select.go
- session.go
- ship.go
- split.go
- styles.go
- tab_data.go
- tab_data_col.go
- tab_files.go
- tab_hosts.go
- tab_kv.go
- tab_load.go
- tab_logs.go
- tab_manifests.go
- tab_metrics.go
- tab_queries.go
- tab_services.go
- tab_tests.go
- tab_traces.go
- tablefold.go
- terminal.go
- theme.go
- timewindow.go
- tui.go
- view_secret.go
- views.go
- watch.go
- widgets.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Command layoutgen writes layouts.go: for every non-Latin xkb layout on this machine, the rune each key gives, mapped back to the US key in the same place.
|
Command layoutgen writes layouts.go: for every non-Latin xkb layout on this machine, the rune each key gives, mapped back to the US key in the same place. |