Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddlet2666 committed Aug 26, 2024
1 parent 972dd43 commit 2512c48
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/cmd/monitor_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var (
"default-cache": "caches,cache-indexes:cache-access:cache-storage:cache-stores:cache-partitions",
"default-topic": "topics:topic-members:subscribers:subscriber-groups",
"default-subscriber": "topics:subscribers:subscriber-channels",
"default-federation": "federation-all:federation-dest,federation-origins:caches:elastic-data",
}
errSelectService = errors.New("you must provide a service name via -S option")
errSelectCache = errors.New("you must provide a cache using the -C option")
Expand All @@ -67,6 +68,7 @@ var (
selectedTopic string
allBaseData []string
heightAdjust int
noContentArray = []string{" ", noContent, " "}
drawnPositions map[rune]position
)

Expand Down Expand Up @@ -733,23 +735,23 @@ var federationAllContent = func(_ fetcher.Fetcher, clusterSummary clusterSummary
return strings.Split(sb.String(), "\n"), nil
}

return []string{}, nil
return noContentArray, nil
}

var federationDestinationsContent = func(_ fetcher.Fetcher, clusterSummary clusterSummaryInfo) ([]string, error) {
if len(clusterSummary.finalSummariesDestinations) > 0 {
return strings.Split(FormatFederationSummary(clusterSummary.finalSummariesDestinations, destinations), "\n"), nil
}

return []string{}, nil
return noContentArray, nil
}

var federationOriginsContent = func(_ fetcher.Fetcher, clusterSummary clusterSummaryInfo) ([]string, error) {
if len(clusterSummary.finalSummariesOrigins) > 0 {
return strings.Split(FormatFederationSummary(clusterSummary.finalSummariesOrigins, origins), "\n"), nil
}

return []string{}, nil
return noContentArray, nil
}

var healthSummaryContent = func(_ fetcher.Fetcher, clusterSummary clusterSummaryInfo) ([]string, error) {
Expand Down Expand Up @@ -1139,7 +1141,7 @@ func drawContent(screen tcell.Screen, dataFetcher fetcher.Fetcher, panel panelIm
content, err := panel.GetContentFunction()(dataFetcher, lastClusterSummaryInfo)
if err != nil {
if ignoreRESTErrors {
content = []string{" ", noContent, " "}
content = noContentArray
} else {
return 0, err
}
Expand All @@ -1148,7 +1150,7 @@ func drawContent(screen tcell.Screen, dataFetcher fetcher.Fetcher, panel panelIm
l := len(content)

if (l == 0 || l == 1) && content[0] == "" {
content = []string{" ", noContent, " "}
content = noContentArray
l = len(content)
}

Expand Down

0 comments on commit 2512c48

Please sign in to comment.