view

package
v1.6.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResourceMap = map[string]ResourceViewer{
	"app": {
		// contains filtered or unexported fields
	},
	"cluster": {
		// contains filtered or unexported fields
	},
	"k8s": {
		// contains filtered or unexported fields
	},
}

ResourceMap is a map from resource name to resource's renderer

Functions

func NewApplicationView

func NewApplicationView(ctx context.Context, app *App) model.Component

NewApplicationView return a new application view

func NewClusterView

func NewClusterView(ctx context.Context, app *App) model.Component

NewClusterView return a new cluster view

func NewK8SView

func NewK8SView(ctx context.Context, app *App) model.Component

NewK8SView return a new k8s view

Types

type App

type App struct {
	*component.App
	// contains filtered or unexported fields
}

App application object

func NewApp

func NewApp(c client.Client, restConfig *rest.Config) *App

NewApp return a new app object

func (*App) Back

func (a *App) Back(_ *tcell.EventKey) *tcell.EventKey

Back to return before view corresponding to the ESC key

func (*App) Init

func (a *App) Init()

Init the app

func (*App) Run

func (a *App) Run() error

Run is the application running entrance

type ApplicationView

type ApplicationView struct {
	*ResourceView
	// contains filtered or unexported fields
}

ApplicationView is the application view, this view display info of application of KubeVela

func (*ApplicationView) ColorizeStatusText

func (v *ApplicationView) ColorizeStatusText(rowNum int)

ColorizeStatusText colorize the status column text

func (*ApplicationView) Hint

func (v *ApplicationView) Hint() []model.MenuHint

Hint return key action menu hints of the application view

func (*ApplicationView) Init

func (v *ApplicationView) Init()

Init the application view

func (*ApplicationView) ListApplications

func (v *ApplicationView) ListApplications() model.ResourceList

ListApplications list all applications

func (*ApplicationView) Name

func (v *ApplicationView) Name() string

Name return application view name

type ClusterView

type ClusterView struct {
	*ResourceView
	// contains filtered or unexported fields
}

ClusterView is the cluster view, this view display info of cluster where selected application deployed

func (*ClusterView) Hint

func (v *ClusterView) Hint() []model.MenuHint

Hint return key action menu hints of the cluster view

func (*ClusterView) Init

func (v *ClusterView) Init()

Init cluster view init

func (*ClusterView) ListClusters

func (v *ClusterView) ListClusters() model.ResourceList

ListClusters list clusters where application deployed

func (*ClusterView) Name

func (v *ClusterView) Name() string

Name return cluster view name

type Command

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

Command is a kind of abstract of user UI operation

func NewCommand

func NewCommand(app *App) *Command

NewCommand return app's command instance

func (*Command) Init

func (c *Command) Init()

Init command instance

type HelpView

type HelpView struct {
	*Table
	// contains filtered or unexported fields
}

HelpView is the view which display help tips about how to use app

func NewHelpView

func NewHelpView(app *App) *HelpView

NewHelpView return a new help view

func (*HelpView) Init

func (v *HelpView) Init()

Init help view init

func (*HelpView) Name

func (v *HelpView) Name() string

Name return help view name

type K8SView

type K8SView struct {
	*ResourceView
	// contains filtered or unexported fields
}

K8SView is a view which displays info of kubernetes objects which are generated when application deployed

func (*K8SView) ColorizeStatusText

func (v *K8SView) ColorizeStatusText(rowNum int)

ColorizeStatusText colorize the status column text

func (*K8SView) Hint

func (v *K8SView) Hint() []model.MenuHint

Hint return key action menu hints of the k8s view

func (*K8SView) Init

func (v *K8SView) Init()

Init k8s view

func (*K8SView) ListK8SObjects

func (v *K8SView) ListK8SObjects() model.ResourceList

ListK8SObjects return kubernetes objects of the aimed application

func (*K8SView) Name

func (v *K8SView) Name() string

Name return k8s view name

type PageStack

type PageStack struct {
	*component.Pages
	// contains filtered or unexported fields
}

PageStack store views of app's main view, and it's a high level packing of "component.Pages"

func NewPageStack

func NewPageStack(app *App) *PageStack

NewPageStack returns a new page stack.

func (*PageStack) Init

func (ps *PageStack) Init()

Init the pageStack

func (*PageStack) StackPop

func (ps *PageStack) StackPop(_, _ model.Component)

StackPop change itself when accept "pop" notify from app's main view

func (*PageStack) StackPush

func (ps *PageStack) StackPush(component model.Component)

StackPush change itself when accept "pop" notify from app's main view

type ResourceView

type ResourceView struct {
	*Table
	// contains filtered or unexported fields
}

ResourceView is an abstract of resource view

func NewResourceView

func NewResourceView(app *App) *ResourceView

NewResourceView return a new resource view

func (*ResourceView) Init

func (v *ResourceView) Init(list model.ResourceList)

Init the resource view

func (*ResourceView) Name

func (v *ResourceView) Name() string

Name return view name

type ResourceViewer

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

ResourceViewer is resource's renderer

type Table

type Table struct {
	*component.Table
}

Table is a base table view, help view and resource view all base on it

func NewTable

func NewTable() *Table

NewTable return a new table view

func (*Table) Init

func (t *Table) Init()

Init the table view

Jump to

Keyboard shortcuts

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