fix status color
This commit is contained in:
17
main.go
17
main.go
@@ -932,7 +932,7 @@ const (
|
||||
totalSetupSteps = 5
|
||||
remoteWindowSize = 10
|
||||
remoteIndent = " "
|
||||
remoteLineColor = ""
|
||||
remoteLineColor = "\033[94m"
|
||||
headerColor = "\033[1;37m"
|
||||
localTimeColor = "\033[0;32m"
|
||||
statusActiveColor = "\033[92m"
|
||||
@@ -1172,10 +1172,10 @@ func runStatus() error {
|
||||
}
|
||||
defer closeSSHControlMaster(ctx.serverIP)
|
||||
|
||||
printInfo("Service", fmt.Sprintf("pb@%s", ctx.serviceName), remoteLineColor)
|
||||
printInfo("Server", ctx.serverIP, remoteLineColor)
|
||||
printInfo("Domain", ctx.domain, remoteLineColor)
|
||||
printInfo("Port", fmt.Sprintf("%d", ctx.port), remoteLineColor)
|
||||
printInfo("Service", fmt.Sprintf("pb@%s", ctx.serviceName), "")
|
||||
printInfo("Server", ctx.serverIP, "")
|
||||
printInfo("Domain", ctx.domain, "")
|
||||
printInfo("Port", fmt.Sprintf("%d", ctx.port), "")
|
||||
|
||||
props, err := querySystemdProperties(ctx)
|
||||
if err != nil {
|
||||
@@ -1193,7 +1193,7 @@ func runStatus() error {
|
||||
printInfo("Status", statusLine, statusColorFor(state))
|
||||
|
||||
if pid := strings.TrimSpace(props["ExecMainPID"]); pid != "" && pid != "0" {
|
||||
printInfo("PID", pid, remoteLineColor)
|
||||
printInfo("PID", pid, "")
|
||||
}
|
||||
|
||||
if memCurrent, ok := parseSystemdBytes(props["MemoryCurrent"]); ok {
|
||||
@@ -1201,7 +1201,7 @@ func runStatus() error {
|
||||
if memPeak, ok := parseSystemdBytes(props["MemoryPeak"]); ok {
|
||||
memLine = fmt.Sprintf("%s (peak: %s)", memLine, formatBytes(memPeak))
|
||||
}
|
||||
printInfo("Memory", memLine, remoteLineColor)
|
||||
printInfo("Memory", memLine, "")
|
||||
}
|
||||
|
||||
if started := strings.TrimSpace(props["ActiveEnterTimestamp"]); started != "" {
|
||||
@@ -1216,9 +1216,6 @@ func runStatus() error {
|
||||
}
|
||||
|
||||
func printInfo(label, value, valueColor string) {
|
||||
if valueColor == "" {
|
||||
valueColor = remoteLineColor
|
||||
}
|
||||
fmt.Printf("%s%s:%s %s%s%s\n", headerColor, label, remoteColorReset, valueColor, value, remoteColorReset)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user