From 92c26da15a185cf2cbc8c07fe99a028dd6571ceb Mon Sep 17 00:00:00 2001 From: Matthew Coleman Date: Fri, 9 Feb 2024 15:52:51 -0500 Subject: [PATCH] Bug-fixing --- internal/lib/display.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/internal/lib/display.go b/internal/lib/display.go index a8465e7..c558d0b 100644 --- a/internal/lib/display.go +++ b/internal/lib/display.go @@ -84,7 +84,7 @@ func helpText() string { return HELP_TEXT + fmt.Sprintf( "\nQuery: %v | Labels: %v | Filters: %v", currentCtx.Value("query"), - currentCtx.Value("labels"), + store.GetLabels(currentCtx.Value("query").(string)), currentCtx.Value("filters")) } @@ -115,13 +115,13 @@ func StreamDisplay(query string) { reader = readerIndexes[query] // Reader index for the query. ) - // Initialize the display. - resultsView, _, _ := initDisplayTviewText(helpText()) - // Wait for the first result to appear to synchronize storage. GetResultWait(query) reader.Dec() + // Initialize the display. + resultsView, _, _ := initDisplayTviewText(helpText()) + // Start the display. display( DISPLAY_TVIEW, @@ -163,13 +163,13 @@ func TableDisplay(query string, filters []string) { valueIndexes = []int{} // Indexes of the result values to add to the table. ) - // Initialize the display. - resultsView, _, _ := initDisplayTviewTable(helpText()) - // Wait for the first result to appear to synchronize storage. GetResultWait(query) reader.Dec() + // Initialize the display. + resultsView, _, _ := initDisplayTviewTable(helpText()) + // Start the display. display( DISPLAY_TVIEW, @@ -264,6 +264,10 @@ func GraphDisplay(query string, filters []string) { valueIndex = 0 // Index of the result value to graph. ) + // Wait for the first result to appear to synchronize storage. + GetResultWait(query) + reader.Dec() + // Determine the values to populate into the graph. If none is provided, the first value is taken. if len(filters) > 0 { valueIndex = store.GetValueIndex(query, filters[0])