From ee49d0fa5d5cc6335683976063e17fcf2baa715c Mon Sep 17 00:00:00 2001 From: Furkan Pehlivan Date: Sat, 16 Sep 2023 21:30:59 +0300 Subject: [PATCH 1/2] update status ui. --- pkg/status.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/status.go b/pkg/status.go index ac71db5..57cda88 100644 --- a/pkg/status.go +++ b/pkg/status.go @@ -32,5 +32,26 @@ func (tui *TUI) getStatus() { } tui.PreviewList.SetTitle(" Status ").SetTitleAlign(tview.AlignCenter) + + tui.PreviewList.AddItem("Status", "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Uptime: %s", status.Payload.Uptime), "", 0, nil) + tui.PreviewList.AddItem("*", "", 0, nil) + tui.PreviewList.AddItem("Cluster Status", "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Status: %s", *status.Payload.Cluster.Status), "", 0, nil) + tui.PreviewList.AddItem(" Peers:", "", 0, nil) + if len(status.Payload.Cluster.Peers) > 0 { + for _, peer := range status.Payload.Cluster.Peers { + tui.PreviewList.AddItem(fmt.Sprintf(" - Name: %s Address: %s", *peer.Name, *peer.Address), "", 0, nil) + } + } + tui.PreviewList.AddItem("*", "", 0, nil) + tui.PreviewList.AddItem("Version Information", "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Branch: %s", *status.Payload.VersionInfo.Branch), "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Build Date: %s", *status.Payload.VersionInfo.BuildDate), "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Build User: %s", *status.Payload.VersionInfo.BuildUser), "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" GoVersion: %s", *status.Payload.VersionInfo.GoVersion), "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Revision: %s", *status.Payload.VersionInfo.Revision), "", 0, nil) + tui.PreviewList.AddItem(fmt.Sprintf(" Version: %s", *status.Payload.VersionInfo.Version), "", 0, nil) + tui.Preview.SetText(fmt.Sprintf("[green]%s", string(statusByte))).SetTextAlign(tview.AlignLeft) } From 5ae913c153a2c635a600cec1de3a6ef0d48c7947 Mon Sep 17 00:00:00 2001 From: Furkan Pehlivan Date: Sat, 16 Sep 2023 21:31:22 +0300 Subject: [PATCH 2/2] update filter error message. --- pkg/tui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tui.go b/pkg/tui.go index ada51fe..3c8f25e 100644 --- a/pkg/tui.go +++ b/pkg/tui.go @@ -33,7 +33,7 @@ func InitTUI() *TUI { // check if Alerts or Silences option is selected from SidebarList or not if tui.SidebarList.GetCurrentItem() == 2 { tui.ClearPreviews() - tui.Preview.SetText("[red]Please select Alerts or Silences option from Navigation").SetTextAlign(tview.AlignCenter) + tui.Preview.SetText("[red]Please select Alerts or Silences option from Navigation to use filter").SetTextAlign(tview.AlignCenter) return }