From 02587c1edc1f8cecea3ba9439c78c330ad300b43 Mon Sep 17 00:00:00 2001 From: Rachel Williams Date: Tue, 25 Aug 2020 16:51:01 -0700 Subject: [PATCH] TUN-3321: Add box around logs on UI --- cmd/cloudflared/ui/launch_ui.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/cloudflared/ui/launch_ui.go b/cmd/cloudflared/ui/launch_ui.go index dd9bd85c..04631e8e 100644 --- a/cmd/cloudflared/ui/launch_ui.go +++ b/cmd/cloudflared/ui/launch_ui.go @@ -91,9 +91,13 @@ func (data *uiModel) LaunchUI(ctx context.Context, logger logger.Service, tunnel grid.AddItem(connTable, 2, 1, 1, 1, 0, 0, false) grid.AddItem(NewDynamicColorTextView().SetText(fmt.Sprintf("Metrics at [%s::b]%s/metrics", palette.url, data.metricsURL)), 3, 1, 1, 1, 0, 0, false) + // Add TextView to stream logs - // LOGS header is displayed in bold - grid.AddItem(logTextView.SetText("[::b]LOGS:[::-]\n\n").SetChangedFunc(handleNewText(app, logTextView)), 4, 0, 5, 2, 0, 0, false) + // Logs are displayed in a new grid so a border can be set around them + logGrid := tview.NewGrid().SetBorders(true).AddItem(logTextView.SetChangedFunc(handleNewText(app, logTextView)), 0, 0, 5, 2, 0, 0, false) + // LogFrame holds the Logs header as well as the grid with the textView for streamed logs + logFrame := tview.NewFrame(logGrid).AddText("[::b]Logs:[::-]", true, tview.AlignLeft, tcell.ColorWhite).SetBorders(0, 0, 0, 0, 0, 0) + grid.AddItem(logFrame, 4, 0, 5, 2, 0, 0, false) go func() { for {