Documentation ¶
Index ¶
- Constants
- Variables
- func HighlightText(yaml string) string
- func NewYamlView(ctx context.Context, app *App) model.View
- type App
- type ApplicationView
- func (v *ApplicationView) BuildBody()
- func (v *ApplicationView) BuildHeader()
- func (v *ApplicationView) ColorizeStatusText(rowNum int)
- func (v *ApplicationView) Hint() []model.MenuHint
- func (v *ApplicationView) Init()
- func (v *ApplicationView) InitView(ctx context.Context, app *App)
- func (v *ApplicationView) Name() string
- func (v *ApplicationView) Refresh(_ *tcell.EventKey) *tcell.EventKey
- func (v *ApplicationView) Start()
- func (v *ApplicationView) Stop()
- func (v *ApplicationView) Title() string
- func (v *ApplicationView) Update()
- type ClusterNamespaceView
- func (v *ClusterNamespaceView) BuildBody()
- func (v *ClusterNamespaceView) BuildHeader()
- func (v *ClusterNamespaceView) ColorizeStatusText(rowNum int)
- func (v *ClusterNamespaceView) Hint() []model.MenuHint
- func (v *ClusterNamespaceView) Init()
- func (v *ClusterNamespaceView) InitView(ctx context.Context, app *App)
- func (v *ClusterNamespaceView) Name() string
- func (v *ClusterNamespaceView) Refresh(_ *tcell.EventKey) *tcell.EventKey
- func (v *ClusterNamespaceView) Start()
- func (v *ClusterNamespaceView) Stop()
- func (v *ClusterNamespaceView) Update()
- type ClusterView
- func (v *ClusterView) BuildBody()
- func (v *ClusterView) BuildHeader()
- func (v *ClusterView) Hint() []model.MenuHint
- func (v *ClusterView) Init()
- func (v *ClusterView) InitView(ctx context.Context, app *App)
- func (v *ClusterView) Name() string
- func (v *ClusterView) Refresh(_ *tcell.EventKey) *tcell.EventKey
- func (v *ClusterView) Start()
- func (v *ClusterView) Stop()
- func (v *ClusterView) Update()
- type Command
- type CommonResourceView
- func (v *CommonResourceView) AutoRefresh(update func())
- func (v *CommonResourceView) BuildBody(body [][]string)
- func (v *CommonResourceView) BuildHeader(header []string)
- func (v *CommonResourceView) Init()
- func (v *CommonResourceView) Name() string
- func (v *CommonResourceView) Refresh(clear bool, update func())
- func (v *CommonResourceView) Stop()
- type HelpView
- type ManagedResourceView
- func (v *ManagedResourceView) BuildBody()
- func (v *ManagedResourceView) BuildHeader()
- func (v *ManagedResourceView) ColorizeStatusText(rowNum int)
- func (v *ManagedResourceView) Hint() []model.MenuHint
- func (v *ManagedResourceView) Init()
- func (v *ManagedResourceView) InitView(ctx context.Context, app *App)
- func (v *ManagedResourceView) Name() string
- func (v *ManagedResourceView) Refresh(_ *tcell.EventKey) *tcell.EventKey
- func (v *ManagedResourceView) Start()
- func (v *ManagedResourceView) Stop()
- func (v *ManagedResourceView) Title() string
- func (v *ManagedResourceView) Update()
- type NamespaceView
- func (v *NamespaceView) BuildBody()
- func (v *NamespaceView) BuildHeader()
- func (v *NamespaceView) ColorizeStatusText(rowNum int)
- func (v *NamespaceView) Hint() []model.MenuHint
- func (v *NamespaceView) Init()
- func (v *NamespaceView) InitView(ctx context.Context, app *App)
- func (v *NamespaceView) Name() string
- func (v *NamespaceView) Refresh(_ *tcell.EventKey) *tcell.EventKey
- func (v *NamespaceView) Start()
- func (v *NamespaceView) Stop()
- func (v *NamespaceView) Update()
- type PageStack
- type PodView
- func (v *PodView) BuildBody()
- func (v *PodView) BuildHeader()
- func (v *PodView) ColorizePhaseText(rowNum int)
- func (v *PodView) Hint() []model.MenuHint
- func (v *PodView) Init()
- func (v *PodView) InitView(ctx context.Context, app *App)
- func (v *PodView) Name() string
- func (v *PodView) Refresh(_ *tcell.EventKey) *tcell.EventKey
- func (v *PodView) Start()
- func (v *PodView) Stop()
- func (v *PodView) Update()
- type ResourceView
- type YamlView
Constants ¶
const RefreshDelay = 10 * time.Second
RefreshDelay is refresh delay
Variables ¶
var ResourceViewMap = map[string]ResourceView{ "app": new(ApplicationView), "cluster": new(ClusterView), "resource": new(ManagedResourceView), "ns": new(NamespaceView), "cns": new(ClusterNamespaceView), "pod": new(PodView), }
ResourceViewMap is a map from resource name to resource view
Functions ¶
func HighlightText ¶
HighlightText highlight the key, colon, value text of the yaml text
Types ¶
type App ¶
App application object
type ApplicationView ¶
type ApplicationView struct { *CommonResourceView // contains filtered or unexported fields }
ApplicationView is the application view, this view display info of application of KubeVela
func (*ApplicationView) BuildBody ¶
func (v *ApplicationView) BuildBody()
BuildBody render the body of table
func (*ApplicationView) BuildHeader ¶
func (v *ApplicationView) BuildHeader()
BuildHeader render the header of table
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) InitView ¶
func (v *ApplicationView) InitView(ctx context.Context, app *App)
InitView return a new application view
func (*ApplicationView) Name ¶
func (v *ApplicationView) Name() string
Name return application view name
func (*ApplicationView) Refresh ¶
func (v *ApplicationView) Refresh(_ *tcell.EventKey) *tcell.EventKey
Refresh the view content
func (*ApplicationView) Title ¶
func (v *ApplicationView) Title() string
Title return table title of application view
func (*ApplicationView) Update ¶
func (v *ApplicationView) Update()
Update refresh the content of body of view
type ClusterNamespaceView ¶
type ClusterNamespaceView struct { *CommonResourceView // contains filtered or unexported fields }
ClusterNamespaceView is the cluster namespace, which display the namespace info of application's resource
func (*ClusterNamespaceView) BuildBody ¶
func (v *ClusterNamespaceView) BuildBody()
BuildBody render the body of table
func (*ClusterNamespaceView) BuildHeader ¶
func (v *ClusterNamespaceView) BuildHeader()
BuildHeader render the header of table
func (*ClusterNamespaceView) ColorizeStatusText ¶
func (v *ClusterNamespaceView) ColorizeStatusText(rowNum int)
ColorizeStatusText colorize the status column text
func (*ClusterNamespaceView) Hint ¶
func (v *ClusterNamespaceView) Hint() []model.MenuHint
Hint return key action menu hints of the cluster namespace view
func (*ClusterNamespaceView) Init ¶
func (v *ClusterNamespaceView) Init()
Init the cluster namespace view
func (*ClusterNamespaceView) InitView ¶
func (v *ClusterNamespaceView) InitView(ctx context.Context, app *App)
InitView init a new cluster namespace view
func (*ClusterNamespaceView) Name ¶
func (v *ClusterNamespaceView) Name() string
Name return cluster namespace view name
func (*ClusterNamespaceView) Refresh ¶
func (v *ClusterNamespaceView) Refresh(_ *tcell.EventKey) *tcell.EventKey
Refresh the view content
func (*ClusterNamespaceView) Start ¶
func (v *ClusterNamespaceView) Start()
Start the cluster namespace view
func (*ClusterNamespaceView) Stop ¶
func (v *ClusterNamespaceView) Stop()
Stop the cluster namespace view
func (*ClusterNamespaceView) Update ¶
func (v *ClusterNamespaceView) Update()
Update refresh the content of body of view
type ClusterView ¶
type ClusterView struct { *CommonResourceView // contains filtered or unexported fields }
ClusterView is the cluster view, this view display info of cluster where selected application deployed
func (*ClusterView) BuildBody ¶
func (v *ClusterView) BuildBody()
BuildBody render the body of table
func (*ClusterView) BuildHeader ¶
func (v *ClusterView) BuildHeader()
BuildHeader render the header of table
func (*ClusterView) Hint ¶
func (v *ClusterView) Hint() []model.MenuHint
Hint return key action menu hints of the cluster view
func (*ClusterView) InitView ¶
func (v *ClusterView) InitView(ctx context.Context, app *App)
InitView init a new cluster view
func (*ClusterView) Refresh ¶
func (v *ClusterView) Refresh(_ *tcell.EventKey) *tcell.EventKey
Refresh the view content
func (*ClusterView) Update ¶
func (v *ClusterView) Update()
Update refresh the content of body of view
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a kind of abstract of user UI operation
type CommonResourceView ¶
CommonResourceView is an abstract of resource view
func NewCommonView ¶
func NewCommonView(app *App) *CommonResourceView
NewCommonView return a new common view
func (*CommonResourceView) AutoRefresh ¶
func (v *CommonResourceView) AutoRefresh(update func())
AutoRefresh will refresh the view in every RefreshDelay delay
func (*CommonResourceView) BuildBody ¶
func (v *CommonResourceView) BuildBody(body [][]string)
BuildBody render the body of table
func (*CommonResourceView) BuildHeader ¶
func (v *CommonResourceView) BuildHeader(header []string)
BuildHeader render the header of table
func (*CommonResourceView) Name ¶
func (v *CommonResourceView) Name() string
Name return the name of common view
func (*CommonResourceView) Refresh ¶
func (v *CommonResourceView) Refresh(clear bool, update func())
Refresh the base resource view
func (*CommonResourceView) Stop ¶
func (v *CommonResourceView) Stop()
Stop the refresh goroutine and clear the table content
type ManagedResourceView ¶
type ManagedResourceView struct { *CommonResourceView // contains filtered or unexported fields }
ManagedResourceView is a view which displays info of application's managed resource including CRDs and k8s objects
func (*ManagedResourceView) BuildBody ¶
func (v *ManagedResourceView) BuildBody()
BuildBody render the body of table
func (*ManagedResourceView) BuildHeader ¶
func (v *ManagedResourceView) BuildHeader()
BuildHeader render the header of table
func (*ManagedResourceView) ColorizeStatusText ¶
func (v *ManagedResourceView) ColorizeStatusText(rowNum int)
ColorizeStatusText colorize the status column text
func (*ManagedResourceView) Hint ¶
func (v *ManagedResourceView) Hint() []model.MenuHint
Hint return key action menu hints of the managed resource view
func (*ManagedResourceView) InitView ¶
func (v *ManagedResourceView) InitView(ctx context.Context, app *App)
InitView init a new managed resource view
func (*ManagedResourceView) Name ¶
func (v *ManagedResourceView) Name() string
Name return managed resource view name
func (*ManagedResourceView) Refresh ¶
func (v *ManagedResourceView) Refresh(_ *tcell.EventKey) *tcell.EventKey
Refresh the view content
func (*ManagedResourceView) Start ¶
func (v *ManagedResourceView) Start()
Start the managed resource view
func (*ManagedResourceView) Stop ¶
func (v *ManagedResourceView) Stop()
Stop the managed resource view
func (*ManagedResourceView) Title ¶
func (v *ManagedResourceView) Title() string
Title return the table title of managed resource view
func (*ManagedResourceView) Update ¶
func (v *ManagedResourceView) Update()
Update refresh the content of body of view
type NamespaceView ¶
type NamespaceView struct { *CommonResourceView // contains filtered or unexported fields }
NamespaceView is namespace view struct
func (*NamespaceView) BuildBody ¶
func (v *NamespaceView) BuildBody()
BuildBody render the body of table
func (*NamespaceView) BuildHeader ¶
func (v *NamespaceView) BuildHeader()
BuildHeader render the header of table
func (*NamespaceView) ColorizeStatusText ¶
func (v *NamespaceView) ColorizeStatusText(rowNum int)
ColorizeStatusText colorize the status column text
func (*NamespaceView) Hint ¶
func (v *NamespaceView) Hint() []model.MenuHint
Hint return key action menu hints of the k8s view
func (*NamespaceView) InitView ¶
func (v *NamespaceView) InitView(ctx context.Context, app *App)
InitView init a new namespace view
func (*NamespaceView) Refresh ¶
func (v *NamespaceView) Refresh(_ *tcell.EventKey) *tcell.EventKey
Refresh the view content
func (*NamespaceView) Update ¶
func (v *NamespaceView) Update()
Update refresh the content of body of view
type PageStack ¶
PageStack store views of app's main view, and it's a high level packing of "component.Pages"
type PodView ¶
type PodView struct { *CommonResourceView // contains filtered or unexported fields }
PodView is the pod view, this view display info of pod belonging to component
func (*PodView) BuildHeader ¶
func (v *PodView) BuildHeader()
BuildHeader render the header of table
func (*PodView) ColorizePhaseText ¶
ColorizePhaseText colorize the phase column text
type ResourceView ¶
type ResourceView interface { model.View InitView(ctx context.Context, app *App) Refresh(event *tcell.EventKey) *tcell.EventKey Update() BuildHeader() BuildBody() }
ResourceView is the interface to abstract resource view