parent
4e8995cc0e
commit
a1fb0d281d
@ -20,7 +20,8 @@ var borderStyle = lipgloss.NewStyle().
|
||||
|
||||
var headerStyle = lipgloss.NewStyle().
|
||||
Underline(true).
|
||||
Bold(true)
|
||||
Bold(true).
|
||||
PaddingBottom(1)
|
||||
|
||||
var leftStyle = lipgloss.NewStyle().
|
||||
Bold(true)
|
||||
@ -51,6 +52,11 @@ func NewVersionOverview(
|
||||
server = "local"
|
||||
}
|
||||
|
||||
domain := app.Domain
|
||||
if domain == "" {
|
||||
domain = "N/A"
|
||||
}
|
||||
|
||||
body := strings.Builder{}
|
||||
body.WriteString(
|
||||
borderStyle.Render(
|
||||
@ -60,7 +66,7 @@ func NewVersionOverview(
|
||||
lipgloss.JoinVertical(
|
||||
lipgloss.Left,
|
||||
horizontal(leftStyle.Render("SERVER"), " ", rightStyle.Render(server)),
|
||||
horizontal(leftStyle.Render("DOMAIN"), " ", rightStyle.Render(app.Domain)),
|
||||
horizontal(leftStyle.Render("DOMAIN"), " ", rightStyle.Render(domain)),
|
||||
horizontal(leftStyle.Render("RECIPE"), " ", rightStyle.Render(app.Recipe.Name)),
|
||||
horizontal(leftStyle.Render("CONFIG"), " ", rightStyle.Render(deployConfig)),
|
||||
horizontal(leftStyle.Render("VERSION"), " ", rightStyle.Render(currentVersion)),
|
||||
@ -112,6 +118,11 @@ func DeployOverview(app appPkg.App, warnMessages []string, version, chaosVersion
|
||||
server = "local"
|
||||
}
|
||||
|
||||
domain := app.Domain
|
||||
if domain == "" {
|
||||
domain = "N/A"
|
||||
}
|
||||
|
||||
body := strings.Builder{}
|
||||
body.WriteString(
|
||||
borderStyle.Render(
|
||||
@ -121,7 +132,7 @@ func DeployOverview(app appPkg.App, warnMessages []string, version, chaosVersion
|
||||
lipgloss.JoinVertical(
|
||||
lipgloss.Left,
|
||||
horizontal(leftStyle.Render("SERVER"), " ", rightStyle.Render(server)),
|
||||
horizontal(leftStyle.Render("DOMAIN"), " ", rightStyle.Render(app.Domain)),
|
||||
horizontal(leftStyle.Render("DOMAIN"), " ", rightStyle.Render(domain)),
|
||||
horizontal(leftStyle.Render("RECIPE"), " ", rightStyle.Render(app.Recipe.Name)),
|
||||
horizontal(leftStyle.Render("CONFIG"), " ", rightStyle.Render(deployConfig)),
|
||||
horizontal(leftStyle.Render("VERSION"), " ", rightStyle.Render(version)),
|
||||
|
@ -43,12 +43,28 @@ func HumanDuration(timestamp int64) string {
|
||||
|
||||
// CreateTable prepares a table layout for output.
|
||||
func CreateTable() (*table.Table, error) {
|
||||
var (
|
||||
renderer = lipgloss.NewRenderer(os.Stdout)
|
||||
headerStyle = renderer.NewStyle().Bold(true).Align(lipgloss.Center)
|
||||
cellStyle = renderer.NewStyle().Padding(0, 1)
|
||||
borderStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("63"))
|
||||
)
|
||||
|
||||
table := table.New().
|
||||
Border(lipgloss.ThickBorder()).
|
||||
BorderStyle(
|
||||
lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("63")),
|
||||
)
|
||||
BorderStyle(borderStyle).
|
||||
StyleFunc(func(row, col int) lipgloss.Style {
|
||||
var style lipgloss.Style
|
||||
|
||||
switch {
|
||||
case row == table.HeaderRow:
|
||||
return headerStyle
|
||||
default:
|
||||
style = cellStyle
|
||||
}
|
||||
|
||||
return style
|
||||
})
|
||||
|
||||
if isAbraCI, ok := os.LookupEnv("ABRA_CI"); ok && isAbraCI == "1" {
|
||||
// NOTE(d1): no width limits for CI testing since we test against outputs
|
||||
|
Loading…
Reference in New Issue
Block a user