views

package
v1.1.170 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawHelp

func DrawHelp(keyBindings map[string]string, v *gocui.View)

DrawHelp renders the popup help view

func LoadActionsView

func LoadActionsView(ctx context.Context, list *ListWidget) error

LoadActionsView Shows available actions for the current resource

Types

type ItemWidget

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

ItemWidget is response for showing the text response from the Rest requests

func NewItemWidget

func NewItemWidget(x, y, w, h int, hideGuids bool, content string) *ItemWidget

NewItemWidget creates a new instance of ItemWidget

func (*ItemWidget) GetContent

func (w *ItemWidget) GetContent() string

GetContent returns the current content

func (*ItemWidget) Layout

func (w *ItemWidget) Layout(g *gocui.Gui) error

Layout draws the widget in the gocui view

func (*ItemWidget) SetContent

func (w *ItemWidget) SetContent(content string, title string)

SetContent displays the string in the itemview

type ListWidget

type ListWidget struct {
	FullscreenKeyBinding string
	ActionKeyBinding     string
	// contains filtered or unexported fields
}

ListWidget hosts the left panel showing resources and controls the navigation

func NewListWidget

func NewListWidget(ctx context.Context, x, y, w, h int, items []string, selected int, contentView *ItemWidget, status *StatusbarWidget, enableTracing bool) *ListWidget

NewListWidget creates a new instance

func (*ListWidget) ChangeSelection

func (w *ListWidget) ChangeSelection(i int)

ChangeSelection updates the selected item

func (*ListWidget) CurrentExpandedItem

func (w *ListWidget) CurrentExpandedItem() *handlers.TreeNode

CurrentExpandedItem returns the currently expanded item as a treenode

func (*ListWidget) CurrentItem

func (w *ListWidget) CurrentItem() *handlers.TreeNode

CurrentItem returns the selected item as a treenode

func (*ListWidget) CurrentSelection

func (w *ListWidget) CurrentSelection() int

CurrentSelection returns the current selection int

func (*ListWidget) ExpandCurrentSelection

func (w *ListWidget) ExpandCurrentSelection()

ExpandCurrentSelection opens the resource Sub->RG for example

func (*ListWidget) GoBack

func (w *ListWidget) GoBack()

GoBack takes the user back to preview view

func (*ListWidget) Layout

func (w *ListWidget) Layout(g *gocui.Gui) error

Layout draws the widget in the gocui view

func (*ListWidget) MoveEnd added in v1.1.104

func (w *ListWidget) MoveEnd()

MoveEnd changes the selection to the bottom of the list

func (*ListWidget) MoveHome added in v1.1.104

func (w *ListWidget) MoveHome()

MoveHome changes the selection to the top of the list

func (*ListWidget) MovePageDown added in v1.1.104

func (w *ListWidget) MovePageDown()

MovePageDown changes the selection to be a page further down the list

func (*ListWidget) MovePageUp added in v1.1.104

func (w *ListWidget) MovePageUp()

MovePageUp changes the selection to be a page further up the list

func (*ListWidget) Refresh

func (w *ListWidget) Refresh()

Refresh refreshes the current view

func (*ListWidget) SetNodes

func (w *ListWidget) SetNodes(nodes []*handlers.TreeNode)

SetNodes allows others to set the list nodes

func (*ListWidget) SetSubscriptions

func (w *ListWidget) SetSubscriptions(subs armclient.SubResponse)

SetSubscriptions starts vaidation with the subs found

type NotificationWidget added in v1.1.170

type NotificationWidget struct {
	ConfirmDeleteKeyBinding       string
	ClearPendingDeletesKeyBinding string
	// contains filtered or unexported fields
}

NotificationWidget controls the notifications windows in the top right

func NewNotificationWidget added in v1.1.170

func NewNotificationWidget(x, y, w int, hideGuids bool, g *gocui.Gui) *NotificationWidget

NewNotificationWidget create new instance and start go routine for spinner

func (*NotificationWidget) AddPendingDelete added in v1.1.170

func (w *NotificationWidget) AddPendingDelete(display, url string)

AddPendingDelete queues deletes for delete once confirmed

func (*NotificationWidget) ClearPendingDeletes added in v1.1.170

func (w *NotificationWidget) ClearPendingDeletes()

ClearPendingDeletes removes all pending deletes

func (*NotificationWidget) ConfirmDelete added in v1.1.170

func (w *NotificationWidget) ConfirmDelete()

ConfirmDelete delete all queued/pending deletes

func (*NotificationWidget) Layout added in v1.1.170

func (w *NotificationWidget) Layout(g *gocui.Gui) error

Layout draws the widget in the gocui view

type Page

type Page struct {
	Value            []*handlers.TreeNode
	Data             string
	Title            string
	Selection        int
	ExpandedNodeItem *handlers.TreeNode
}

Page represents a previous view in the nav stack

type Stack

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

Stack is a basic LIFO stack that resizes as needed.

func (*Stack) Pop

func (s *Stack) Pop() *Page

Pop removes and returns a node from the stack in last to first order.

func (*Stack) Push

func (s *Stack) Push(n *Page)

Push adds a node to the stack.

type StatusbarWidget

type StatusbarWidget struct {
	HelpKeyBinding string
	// contains filtered or unexported fields
}

StatusbarWidget controls the statusbar

func NewStatusbarWidget

func NewStatusbarWidget(x, y, w int, hideGuids bool, g *gocui.Gui) *StatusbarWidget

NewStatusbarWidget create new instance and start go routine for spinner

func (*StatusbarWidget) Layout

func (w *StatusbarWidget) Layout(g *gocui.Gui) error

Layout draws the widget in the gocui view

func (*StatusbarWidget) Status

func (w *StatusbarWidget) Status(message string, loading bool) func()

Status updates the message in the status bar and whether to show loading indicator

Jump to

Keyboard shortcuts

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