pages

package
v0.0.0-...-02c6b06 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthorizationTooltip = map[github.AuthorizationType]string{
	github.AuthorizationAll:        "Everyone is allowed to use the command",
	github.AuthorizationOrg:        "Everyone that is member of the org is allowed to use the command",
	github.AuthorizationTeam:       "Everyone that is in the default team is allowed to use the command",
	github.AuthorizationCodeOwners: "Only codeowners are allowed to use command. If no code owner exists the default team is used.",
}
View Source
var RunPhaseIcon = func(phase v1alpha1.WorkflowPhase) IconWithTooltip {
	switch phase {
	case v1beta1.RunPhaseInit:
		return IconWithTooltip{
			Icon:    "schedule",
			Tooltip: fmt.Sprintf("%s phase: Testrun is waiting to be scheduled", v1beta1.StepPhaseInit),
			Color:   "grey",
		}
	case v1beta1.RunPhasePending:
		return IconWithTooltip{
			Icon:    "schedule",
			Tooltip: fmt.Sprintf("%s phase: Testrun is pending", v1beta1.RunPhasePending),
			Color:   "orange",
		}
	case v1beta1.RunPhaseRunning:
		return IconWithTooltip{
			Icon:    "autorenew",
			Tooltip: fmt.Sprintf("%s phase: Testrun is running", v1beta1.RunPhaseRunning),
			Color:   "orange",
		}
	case v1beta1.RunPhaseSuccess:
		return IconWithTooltip{
			Icon:    "done",
			Tooltip: fmt.Sprintf("%s phase: Testrun succeeded", v1beta1.RunPhaseSuccess),
			Color:   "green",
		}
	case v1beta1.RunPhaseFailed:
		return IconWithTooltip{
			Icon:    "clear",
			Tooltip: fmt.Sprintf("%s phase: Testrun failed", v1beta1.RunPhaseFailed),
			Color:   "red",
		}
	case v1beta1.RunPhaseError:
		return IconWithTooltip{
			Icon:    "clear",
			Tooltip: fmt.Sprintf("%s phase: Testrun errored", v1beta1.RunPhaseError),
			Color:   "red",
		}
	case v1beta1.RunPhaseTimeout:
		return IconWithTooltip{
			Icon:    "clear",
			Tooltip: fmt.Sprintf("%s phase: Testrun run longer than the specified timeout", v1beta1.StepPhaseTimeout),
			Color:   "red",
		}
	default:
		return IconWithTooltip{
			Icon:    "info",
			Tooltip: fmt.Sprintf("%s phase", phase),
			Color:   "grey",
		}

	}
}

Functions

func New404Page

func New404Page(logger logr.Logger, auth auth.Provider, basePath string) http.HandlerFunc

func NewCommandDetailedHelpPage

func NewCommandDetailedHelpPage(logger logr.Logger, auth auth.Provider, basePath string) http.HandlerFunc

func NewCommandHelpPage

func NewCommandHelpPage(logger logr.Logger, auth auth.Provider, basePath string) http.HandlerFunc

func NewHomePage

func NewHomePage(logger logr.Logger, auth auth.Provider, basePath string) http.HandlerFunc

func NewPRStatusDetailPage

func NewPRStatusDetailPage(logger logr.Logger, auth auth.Provider, basePath string) http.HandlerFunc

func NewPRStatusPage

func NewPRStatusPage(p *Page) http.HandlerFunc

func NewTestrunPage

func NewTestrunPage(p *Page) http.HandlerFunc

func NewTestrunsPage

func NewTestrunsPage(p *Page) http.HandlerFunc

Types

type CommandHelpDetailedItem

type CommandHelpDetailedItem struct {
	CommandHelpItem
	AuthorizationTooltip string
	Usage                string
	Config               string
}

type CommandHelpItem

type CommandHelpItem struct {
	Command       string
	Description   string
	Example       string
	Authorization github.AuthorizationType
}

type IconWithTooltip

type IconWithTooltip struct {
	Icon    string
	Tooltip string
	Color   string
}

type Page

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

func New

func New(logger logr.Logger, runs *tests.Runs, auth auth.Provider, basePath string) *Page

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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