views

package
v0.0.0-...-2eb1f2f Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PasteMenu    = fmt.Sprintf(" [%s]<ctrl+v> [%s]Paste", utils.ColorTOrange, utils.ColorTWhite)
	DryRunMenu   = fmt.Sprintf(" [%s]<ctrl+d> [%s]Dry Run", utils.ColorTOrange, utils.ColorTWhite)
	MoveUpMenu   = fmt.Sprintf(" [%s]<↑> [%s]Scroll Up", utils.ColorTOrange, utils.ColorTWhite)
	MoveDownMenu = fmt.Sprintf(" [%s]<↓> [%s]Scroll Down", utils.ColorTOrange, utils.ColorTWhite)
)
View Source
var (
	TitleTasks          = "task"
	TitleEvents         = "events"
	TaskLeftInfoKeys    = []string{"Name", "Status", "JobId", "Client", "Modified At", "Started At"}
	TaskLeftInfoValues  = []string{"", "", "", "", "", ""}
	TaskRightInfoKeys   = []string{"Namespace", "Version", "Driver", "Image", "Volumes", "LifeCycle"}
	TaskRightInfoValues = []string{"", "", "", "", "", ""}
)
View Source
	` _  _  ____  __  __  ____`,
	`( \( )(_  _)(  )(  )(_  _)`,
	` )  (   )(   )(__)(  _)(_`,
	`(_)\_) (__) (______)(____)`,
}
View Source
var TitleAllocations = "allocations"
View Source
var TitleJobs = "jobs"
View Source
var TitleLog = "log"
View Source
var TitleNamespace = "namespaces"
View Source
var TitleNodes = "nodes"
View Source
var TitleRegions = "regions"
View Source
var TitleSplash = "splash"
View Source
var TitleTaskGroups = "taskgroups"
View Source
var TitleVersionDiff = "versiondiff"
View Source
var TitleVersions = "versions"
View Source
var VersionMenus = []widgets.Item{
	widgets.RevertMenu,
}

Functions

func FindChangesCount

func FindChangesCount(taskGroupDiff []*api.TaskGroupDiff) int

func GetTaskData

func GetTaskData(data models.Allocations)

Types

type Allocations

type Allocations struct {
	*widgets.Table
	Title   string
	Headers []string
	Data    []models.Allocations
	Menus   []widgets.Item
}

func NewAllocations

func NewAllocations() *Allocations

func (*Allocations) GetTitle

func (a *Allocations) GetTitle() string

func (*Allocations) SetOnSelectFn

func (a *Allocations) SetOnSelectFn(fn func(int, int))

func (*Allocations) SetOnTabPressFn

func (a *Allocations) SetOnTabPressFn(fn func())

func (*Allocations) UpdateTableData

func (a *Allocations) UpdateTableData(data []models.Allocations)

type App

type App struct {
	*tview.Application
}

func NewApp

func NewApp() *App
type Footer struct {
	*widgets.Flex
	// Grid1		*widgets.TextView
	Grid2 *widgets.TextView
}

func NewFooter

func NewFooter() *Footer

func (*Footer) SetAlert

func (f *Footer) SetAlert(message models.AlertMessage)
type Header struct {
	*tview.Flex
	Menu     *widgets.Menu
	Metadata *widgets.MapView
}

func NewHeader

func NewHeader() *Header
func (h *Header) RenderLogo() error

func (*Header) RenderMenu

func (h *Header) RenderMenu(menus []widgets.Item) error

func (*Header) SetMetadata

func (h *Header) SetMetadata(metadata models.Metadata)

type JobDefinition

type JobDefinition struct {
	*widgets.TextView
	Title       string
	Data        []models.Namespaces
	RemoveMenus []widgets.Item
}

func NewJobDefinition

func NewJobDefinition() *JobDefinition

func (*JobDefinition) GetTitle

func (jd *JobDefinition) GetTitle() string

func (*JobDefinition) SetJDData

func (jd *JobDefinition) SetJDData(data map[string]string)

type Jobs

type Jobs struct {
	*widgets.Table
	Title   string
	Headers []string
	Data    []models.Jobs
	Menus   []widgets.Item
}

func NewJobs

func NewJobs() *Jobs

func (*Jobs) GetTitle

func (j *Jobs) GetTitle() string

func (*Jobs) SetOnSelectFn

func (j *Jobs) SetOnSelectFn(fn func(int, int))

func (*Jobs) SetOnSelectionChanged

func (j *Jobs) SetOnSelectionChanged(fn func(int, int))

func (*Jobs) SetOnTabPressFn

func (j *Jobs) SetOnTabPressFn(fn func())

func (*Jobs) UpdateTableData

func (j *Jobs) UpdateTableData(params *models.NomadParams, data []models.Jobs)

type Log

type Log struct {
	Container *widgets.Flex
	LogView   *widgets.TextView
	Title     string
	Log       []byte
	Menus     []widgets.Item
}

func NewLog

func NewLog() *Log

func (*Log) ClearLogs

func (l *Log) ClearLogs()

func (*Log) FollowX

func (l *Log) FollowX()

func (*Log) GetTitle

func (l *Log) GetTitle() string

func (*Log) Render

func (l *Log) Render(log []byte)

type Namespaces

type Namespaces struct {
	*widgets.Table
	Headers []string
	Data    []models.Namespaces
}

func NewNamespaces

func NewNamespaces() *Namespaces

func (*Namespaces) SetOnSelectFn

func (n *Namespaces) SetOnSelectFn(fn func(int, int))

func (*Namespaces) SetOnTabPress

func (n *Namespaces) SetOnTabPress(fn func())

func (*Namespaces) UpdateTableData

func (n *Namespaces) UpdateTableData(data []models.Namespaces, region string)

type Nodes

type Nodes struct {
	*widgets.Table
	Title   string
	Headers []string
	Data    []models.Nodes
}

func NewNodes

func NewNodes() *Nodes

func (*Nodes) GetTitle

func (n *Nodes) GetTitle() string

func (*Nodes) SetOnSelectFn

func (n *Nodes) SetOnSelectFn(fn func(int, int))

func (*Nodes) SetOnTabPressFn

func (n *Nodes) SetOnTabPressFn(fn func())

func (*Nodes) UpdateTableData

func (n *Nodes) UpdateTableData(data []models.Nodes)

type Regions

type Regions struct {
	*widgets.Table
	Headers []string
	Data    []models.Regions
}

func NewRegions

func NewRegions() *Regions

func (*Regions) SetOnSelectFn

func (reg *Regions) SetOnSelectFn(fn func(int, int))

func (*Regions) SetOnTabPressFn

func (reg *Regions) SetOnTabPressFn(fn func())

func (*Regions) UpdateTableData

func (reg *Regions) UpdateTableData(data []models.Regions)

type RunJob

type RunJob struct {
	*tview.Grid
	TextAreaX *widgets.TextArea
	HelpMenu  *tview.TextView
	Title     string
	Data      []models.Namespaces
}

func NewRunJob

func NewRunJob() *RunJob

func (*RunJob) Clear

func (rj *RunJob) Clear()

func (*RunJob) GetTextAreaText

func (rj *RunJob) GetTextAreaText() string

func (*RunJob) GetTitle

func (rj *RunJob) GetTitle() string

func (*RunJob) Render

func (rj *RunJob) Render()

func (*RunJob) SetContent

func (rj *RunJob) SetContent(data string)

func (*RunJob) UpdateHelpMenu

func (rj *RunJob) UpdateHelpMenu(menus string)

type Splash

type Splash struct {
	*tview.Flex
	Title   string
	Version string
}

func NewSplash

func NewSplash(version string) *Splash
func (s *Splash) DrawLogo(t *tview.TextView)

func (*Splash) DrawVersion

func (s *Splash) DrawVersion(t *tview.TextView, Version string)

func (*Splash) GetTitle

func (s *Splash) GetTitle() string

type TaskGroups

type TaskGroups struct {
	*widgets.Table
	Title   string
	Headers []string
	Data    []models.TaskGroups
	Menus   []widgets.Item
}

func NewTaskGroups

func NewTaskGroups() *TaskGroups

func (*TaskGroups) GetTitle

func (tg *TaskGroups) GetTitle() string

func (*TaskGroups) SetOnSelectFn

func (tg *TaskGroups) SetOnSelectFn(fn func(int, int))

func (*TaskGroups) SetOnTabPressFn

func (tg *TaskGroups) SetOnTabPressFn(fn func())

func (*TaskGroups) UpdateTableData

func (tg *TaskGroups) UpdateTableData(jobId, region, namespace string, data []models.TaskGroups)

type Tasks

type Tasks struct {
	*widgets.Flex
	Title       string
	DetailsView *widgets.Flex
	InfoView    *widgets.Flex
	UsageView   *widgets.Flex
	EventsTable *widgets.Table
	Menus       []widgets.Item
	RemoveMenus []widgets.Item
	Data        models.Allocations
}

func NewTasks

func NewTasks() *Tasks

func (*Tasks) DrawUsageGauges

func (t *Tasks) DrawUsageGauges()

func (*Tasks) DrawView

func (t *Tasks) DrawView(data models.Allocations)

func (*Tasks) EventsView

func (t *Tasks) EventsView(events []models.Events)

func (*Tasks) GetTitle

func (t *Tasks) GetTitle() string

func (*Tasks) SetInfoView

func (t *Tasks) SetInfoView()

func (*Tasks) SetUsageData

func (t *Tasks) SetUsageData(usage models.TaskResource)

func (*Tasks) TaskDetails

func (t *Tasks) TaskDetails(task models.Tasks)

func (*Tasks) UpdateEventTable

func (t *Tasks) UpdateEventTable(events []models.Events)

type VersionDiff

type VersionDiff struct {
	*widgets.TextView
	Title string
	Data  []string
}

func NewVersionDiff

func NewVersionDiff() *VersionDiff

func (*VersionDiff) GetTitle

func (vd *VersionDiff) GetTitle() string

func (*VersionDiff) SetData

func (vd *VersionDiff) SetData(jobId string, detail map[string]string, diff models.JobVersionDiff)

type Versions

type Versions struct {
	*widgets.Table
	Title   string
	Headers []string
	Data    []models.JobVersion
	Menus   []widgets.Item
}

func NewVersions

func NewVersions() *Versions

func (*Versions) GetTitle

func (v *Versions) GetTitle() string

func (*Versions) SetOnSelectFn

func (v *Versions) SetOnSelectFn(fn func(int, int))

func (*Versions) SetOnTabPressFn

func (v *Versions) SetOnTabPressFn(fn func())

func (*Versions) UpdateTableData

func (v *Versions) UpdateTableData(jobId string, jobVersions []models.JobVersion, diffs []models.JobVersionDiff)

Jump to

Keyboard shortcuts

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