34 lines
851 B
Go
34 lines
851 B
Go
package main
|
|
|
|
import (
|
|
"charm.land/lipgloss/v2"
|
|
)
|
|
|
|
var (
|
|
greenDot = lipgloss.NewStyle().Foreground(lipgloss.Color("2")).Render("●")
|
|
redDot = lipgloss.NewStyle().Foreground(lipgloss.Color("1")).Render("●")
|
|
yellowDot = lipgloss.NewStyle().Foreground(lipgloss.Color("3")).Render("●")
|
|
grayDot = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Render("●")
|
|
whiteDot = lipgloss.NewStyle().Foreground(lipgloss.Color("7")).Render("●")
|
|
)
|
|
|
|
var (
|
|
stop = lipgloss.NewStyle().Foreground(lipgloss.Color("1")).Render("[STOP]")
|
|
start = lipgloss.NewStyle().Foreground(lipgloss.Color("2")).Render("[START]")
|
|
)
|
|
|
|
func status(s string) string {
|
|
switch s {
|
|
case "active":
|
|
return greenDot
|
|
case "failed":
|
|
return redDot
|
|
case "activating", "reloading":
|
|
return yellowDot
|
|
case "inactive":
|
|
return grayDot
|
|
default:
|
|
return whiteDot
|
|
}
|
|
}
|