views

package
v1.2.750 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 23 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 CommandPanelListOption added in v1.1.441

type CommandPanelListOption struct {
	ID          string
	DisplayText string
}

CommandPanelListOption represents a list item that can be displayed in the CommandPanel

type CommandPanelNotification added in v1.1.441

type CommandPanelNotification struct {
	CurrentText  string
	SelectedID   string
	EnterPressed bool
}

CommandPanelNotification holds the event state for a panel changed notification

type CommandPanelNotificationHandler added in v1.1.441

type CommandPanelNotificationHandler func(state CommandPanelNotification)

CommandPanelNotificationHandler is the function signature for a panel changed notification handler

type CommandPanelWidget added in v1.1.333

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

CommandPanelWidget controls the notifications windows in the top right

func NewCommandPanelWidget added in v1.1.333

func NewCommandPanelWidget(x, y, w int, g *gocui.Gui) *CommandPanelWidget

NewCommandPanelWidget create new instance and start go routine for spinner

func (*CommandPanelWidget) EnterPressed added in v1.1.441

func (w *CommandPanelWidget) EnterPressed()

EnterPressed is used to communicate that the enter key was pressed but a handler received it

func (*CommandPanelWidget) Hide added in v1.1.441

func (w *CommandPanelWidget) Hide()

Hide hides the command panel

func (*CommandPanelWidget) Layout added in v1.1.333

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

Layout draws the widget in the gocui view

func (*CommandPanelWidget) MoveDown added in v1.1.441

func (w *CommandPanelWidget) MoveDown()

MoveDown moves down a list item if options are displayed

func (*CommandPanelWidget) MoveUp added in v1.1.441

func (w *CommandPanelWidget) MoveUp()

MoveUp moves up a list item if options are displayed

func (*CommandPanelWidget) ShowWithText added in v1.1.333

func (w *CommandPanelWidget) ShowWithText(title string, s string, options *[]CommandPanelListOption, handler CommandPanelNotificationHandler)

ShowWithText launches the command panel pre-populated with some text

func (*CommandPanelWidget) Width added in v1.1.441

func (w *CommandPanelWidget) Width() int

Width returns the width of the CommandPanel

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, shouldRender 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) GetContentType added in v1.1.363

func (w *ItemWidget) GetContentType() expanders.ExpanderResponseType

GetContentType returns the current content type

func (*ItemWidget) Layout

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

Layout draws the widget in the gocui view

func (*ItemWidget) PageDown added in v1.1.251

func (w *ItemWidget) PageDown()

PageDown move the view down a page

func (*ItemWidget) PageUp added in v1.1.251

func (w *ItemWidget) PageUp()

PageUp move the view a page up

func (*ItemWidget) SetContent

func (w *ItemWidget) SetContent(content string, contentType expanders.ExpanderResponseType, title string)

SetContent displays the string in the itemview

func (*ItemWidget) SetHideGuids added in v1.1.485

func (w *ItemWidget) SetHideGuids(value bool)

SetHideGuids sets the HideGuids option

func (*ItemWidget) SetShouldRender added in v1.2.739

func (w *ItemWidget) SetShouldRender(val bool)

SetShouldRender set the shouldRender value of this item

type ListNavigatedEventState added in v1.1.505

type ListNavigatedEventState struct {
	Success      bool                  // True if this was a successful navigation
	NewNodes     []*expanders.TreeNode // If Success==true this contains the new nodes
	ParentNodeID string                // This is the ID of the item expanded.
	NodeID       string                // The current nodes id
	IsBack       bool                  // Was this a navigation back?
}

ListNavigatedEventState captures the state when raising a `list.navigated` event

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, title string, shouldRender bool, g *gocui.Gui) *ListWidget

NewListWidget creates a new instance

func (*ListWidget) ChangeSelection

func (w *ListWidget) ChangeSelection(i int)

ChangeSelection updates the selected item

func (*ListWidget) ClearFilter added in v1.1.333

func (w *ListWidget) ClearFilter()

ClearFilter clears a filter if applied

func (*ListWidget) CurrentExpandedItem

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

CurrentExpandedItem returns the currently expanded item as a treenode

func (*ListWidget) CurrentItem

func (w *ListWidget) CurrentItem() *expanders.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) GetNodes added in v1.1.505

func (w *ListWidget) GetNodes() []*expanders.TreeNode

GetNodes returns the currently listed nodes

func (*ListWidget) GoBack

func (w *ListWidget) GoBack()

GoBack takes the user back to preview view

func (*ListWidget) HasCurrentItem added in v1.1.307

func (w *ListWidget) HasCurrentItem() bool

HasCurrentItem indicates whether there is a current item

func (*ListWidget) Layout

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

Layout draws the widget in the gocui view

func (*ListWidget) MoveDown added in v1.1.230

func (w *ListWidget) MoveDown()

MoveDown moves the selection down one item

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) MoveUp added in v1.1.230

func (w *ListWidget) MoveUp()

MoveUp moves the selection up one item

func (*ListWidget) Navigate added in v1.1.307

func (w *ListWidget) Navigate(nodes []*expanders.TreeNode, content *expanders.ExpanderResponse, title string)

Navigate updates the currently selected list nodes, title and details content

func (*ListWidget) Refresh

func (w *ListWidget) Refresh()

Refresh refreshes the current view

func (*ListWidget) SetFilter added in v1.1.441

func (w *ListWidget) SetFilter(filterString string)

SetFilter sets the filter to be applied to list items

func (*ListWidget) SetNodes

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

SetNodes allows others to set the list nodes

func (*ListWidget) SetShouldRender added in v1.2.739

func (w *ListWidget) SetShouldRender(val bool)

SetShouldRender sets the shouldRender value for the list and the current item

type NameAndNodeType added in v1.2.531

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

NameAndNodeType represents fields `name` and `type` from a node structure

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, g *gocui.Gui, client *armclient.Client) *NotificationWidget

NewNotificationWidget create new instance and start go routine for spinner

func (*NotificationWidget) AddPendingDelete added in v1.1.170

func (w *NotificationWidget) AddPendingDelete(item *expanders.TreeNode)

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 OperationsRequest added in v1.1.394

type OperationsRequest struct {
	DisplayName string `json:"displayName"`
	Operations  []struct {
		Name         string      `json:"name"`
		DisplayName  string      `json:"displayName"`
		Description  string      `json:"description"`
		Origin       interface{} `json:"origin"`
		Properties   interface{} `json:"properties"`
		IsDataAction bool        `json:"isDataAction"`
	} `json:"operations"`
	ResourceTypes []struct {
		Name        string `json:"name"`
		DisplayName string `json:"displayName"`
		Operations  []struct {
			Name         string      `json:"name"`
			DisplayName  string      `json:"displayName"`
			Description  string      `json:"description"`
			Origin       interface{} `json:"origin"`
			Properties   interface{} `json:"properties"`
			IsDataAction bool        `json:"isDataAction"`
		} `json:"operations"`
	} `json:"resourceTypes"`
	ID   string `json:"id"`
	Type string `json:"type"`
	Name string `json:"name"`
}

OperationsRequest list the actions that can be performed

type Page

type Page struct {
	Value            []*expanders.TreeNode
	Data             string
	DataType         expanders.ExpanderResponseType
	Title            string
	Selection        int
	ExpandedNodeItem *expanders.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) SetHideGuids added in v1.1.485

func (w *StatusbarWidget) SetHideGuids(value bool)

SetHideGuids sets the HideGuids option

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