Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions internal/config/skins/barbie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

main:
foreground: "#FCE4EC"
background: "#2B1028"
table:
foreground: "#FCE4EC"
background: "#2B1028"
context:
foreground: "#FCE4EC"
background: "#2B1028"
command:
foreground: "#FFB6D9"
background: "#2B1028"
resource_tag:
foreground: "#2B1028"
background: "#FF1493"
navigation_tag:
foreground: "#2B1028"
background: "#FF69B4"
status:
foreground: "#2B1028"
background: "#FFB6D9"
loading:
foreground: "#2B1028"
background: "#C77DFF"
info:
foreground: "#2B1028"
background: "#FFB6D9"
state_on:
foreground: "#2B1028"
background: "#9EFFC8"
state_off:
foreground: "#FFFFFF"
background: "#D81B60"
modal_button:
foreground: "#2B1028"
background: "#FF69B4"
table_selected:
foreground: "#2B1028"
background: "#FFB6D9"
table_header: "#FF69B4"
command_ghost: "#A879A1"
command_placeholder: "#A879A1"
header_label: "#FF69B4"
header_value: "#FCE4EC"
header_command_key: "#FFB6D9"
header_command_text: "#FCE4EC"
logo: "#FF1493"
json_key: "#FF69B4"
json_string: "#9EFFC8"
json_number: "#FFD166"
json_bool: "#C77DFF"
json_null: "#A879A1"
table_title: "#FCE4EC"
error_title: "#FF4D6D"
55 changes: 55 additions & 0 deletions internal/config/skins/matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

main:
foreground: "#00CC33"
background: "#050A05"
table:
foreground: "#00CC33"
background: "#050A05"
context:
foreground: "#00CC33"
background: "#050A05"
command:
foreground: "#00FF41"
background: "#050A05"
resource_tag:
foreground: "#050A05"
background: "#00FF41"
navigation_tag:
foreground: "#050A05"
background: "#7CFC00"
status:
foreground: "#050A05"
background: "#00CC33"
loading:
foreground: "#FFFFFF"
background: "#000000"
info:
foreground: "#050A05"
background: "#00FF41"
state_on:
foreground: "#FFFFFF"
background: "#000000"
state_off:
foreground: "#FFFFFF"
background: "#000000"
modal_button:
foreground: "#050A05"
background: "#00FF41"
table_selected:
foreground: "#050A05"
background: "#00CC33"
table_header: "#00FF41"
command_ghost: "#527A52"
command_placeholder: "#527A52"
header_label: "#7CFC00"
header_value: "#00CC33"
header_command_key: "#00FF41"
header_command_text: "#00CC33"
logo: "#00FF41"
json_key: "#00FF41"
json_string: "#FFFFFF"
json_number: "#00FFFF"
json_bool: "#FF0000"
json_null: "#0000FF"
table_title: "#00FF41"
error_title: "#FF5252"
55 changes: 55 additions & 0 deletions internal/config/skins/synthwave.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

main:
foreground: "#F5E6FF"
background: "#241734"
table:
foreground: "#F5E6FF"
background: "#241734"
context:
foreground: "#F5E6FF"
background: "#241734"
command:
foreground: "#36F9F6"
background: "#241734"
resource_tag:
foreground: "#241734"
background: "#FF7EDB"
navigation_tag:
foreground: "#241734"
background: "#FEDE5D"
status:
foreground: "#241734"
background: "#B893FF"
loading:
foreground: "#241734"
background: "#FF8B39"
info:
foreground: "#241734"
background: "#36F9F6"
state_on:
foreground: "#241734"
background: "#72F1B8"
state_off:
foreground: "#241734"
background: "#FF5C8A"
modal_button:
foreground: "#241734"
background: "#FEDE5D"
table_selected:
foreground: "#241734"
background: "#FF7EDB"
table_header: "#36F9F6"
command_ghost: "#9B87B5"
command_placeholder: "#9B87B5"
header_label: "#FF7EDB"
header_value: "#F5E6FF"
header_command_key: "#36F9F6"
header_command_text: "#F5E6FF"
logo: "#FF7EDB"
json_key: "#36F9F6"
json_string: "#72F1B8"
json_number: "#FEDE5D"
json_bool: "#B893FF"
json_null: "#9B87B5"
table_title: "#F5E6FF"
error_title: "#FF5C8A"
46 changes: 26 additions & 20 deletions internal/ui/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,27 @@ func (m Model) renderHeaderCommands(availableWidth int) string {

func (m Model) renderTable() string {
title := ""

if m.resource != nil {
title = fmt.Sprintf(" %s[%d] ", m.resource.Kind(), m.itemCount)
kindStyle := lipgloss.NewStyle().Foreground(navigationTagStyle.GetBackground())
kind := kindStyle.Render(m.resource.Kind())

itemCountStyle := lipgloss.NewStyle().Foreground(navigationTagStyle.GetBackground())
itemCount := itemCountStyle.Render(fmt.Sprintf("[%d]", m.itemCount))

title = fmt.Sprintf(" %s%s ", kind, itemCount)

if len(m.navigation) > 0 {
parent := m.navigation[len(m.navigation)-1]
title = fmt.Sprintf(" %s(%s/%s)[%d] ", m.resource.Kind(), parent.resource, parent.id, m.itemCount)

parentResourceStyle := lipgloss.NewStyle().Background(headerCommandKeyStyle.GetBackground()).Foreground(headerCommandKeyStyle.GetForeground())
parentResource := parentResourceStyle.Render(fmt.Sprintf("%s/%s", parent.resource, parent.id))

title = fmt.Sprintf(" %s(%s)%s ", kind, parentResource, itemCount)
} else if !m.showHeaderContext() && m.context.Cloud != "" && m.resource.Kind() != "contexts" {
title = fmt.Sprintf(" %s(%s)[%d] ", m.resource.Kind(), m.context.Cloud, m.itemCount)
openstackContextStyle := lipgloss.NewStyle().Foreground(headerCommandKeyStyle.GetForeground())
openstackContext := openstackContextStyle.Render(fmt.Sprintf("%s", m.context.Cloud))

title = openstackContextStyle.Render(fmt.Sprintf(" %s(%s)%s ", kind, openstackContext, itemCount))
}
}

Expand All @@ -246,13 +258,9 @@ func (m Model) renderTable() string {
Foreground(lipgloss.Color(m.skin.Main.Foreground)).
Background(lipgloss.Color(m.skin.Main.Background))

top := borderStyle.Render(
"┌" +
repeat("─", left) +
title +
repeat("─", right) +
"┐",
)
top := borderStyle.Render("┌"+repeat("─", left)) +
preserveBackground(title, lipgloss.Color(m.skin.Main.Background)) +
borderStyle.Render(repeat("─", right)+"┐")

bottom := borderStyle.Render(
"└" +
Expand Down Expand Up @@ -322,15 +330,17 @@ func (m Model) renderTable() string {

func (m Model) renderDetails() string {
title := " details "
titleStyle := lipgloss.NewStyle().Background(headerCommandKeyStyle.GetBackground()).Foreground(headerCommandKeyStyle.GetForeground())

if m.resource != nil {
title = fmt.Sprintf(" %s details ", m.resource.Kind())
title = titleStyle.Render(fmt.Sprintf("%s details", m.resource.Kind()))
}

if m.resource != nil && m.detailID != "" {
title = fmt.Sprintf(" %s/%s ", m.resource.Kind(), m.detailID)
title = titleStyle.Render(fmt.Sprintf("%s/%s", m.resource.Kind(), m.detailID))
}

title = fmt.Sprintf(" %s ", title)
innerWidth := max(m.width-2, 1)

title = ansi.Truncate(title, innerWidth, "…")
Expand All @@ -344,13 +354,9 @@ func (m Model) renderDetails() string {
Foreground(lipgloss.Color(m.skin.Main.Foreground)).
Background(lipgloss.Color(m.skin.Main.Background))

top := borderStyle.Render(
"┌" +
repeat("─", left) +
title +
repeat("─", right) +
"┐",
)
top := borderStyle.Render("┌"+repeat("─", left)) +
preserveBackground(title, lipgloss.Color(m.skin.Main.Background)) +
borderStyle.Render(repeat("─", right)+"┐")

bottom := borderStyle.Render(
"└" +
Expand Down
Loading