Compare commits
3 Commits
d0d716b07a
...
ef8e5c0b93
| Author | SHA1 | Date | |
|---|---|---|---|
|
ef8e5c0b93
|
|||
|
94b27488bd
|
|||
|
7d0b4dab8b
|
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 823 KiB After Width: | Height: | Size: 804 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 269 KiB After Width: | Height: | Size: 275 KiB |
@@ -52,7 +52,14 @@ func init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if mv := info.Main.Version; mv != "" && mv != "(devel)" {
|
if mv := info.Main.Version; mv != "" && mv != "(devel)" {
|
||||||
version = strings.TrimPrefix(mv, "v")
|
mv = strings.TrimPrefix(mv, "v")
|
||||||
|
// Pseudo-versions (e.g. "0.1.1-0.20260620165311-5ca534b0b100+dirty")
|
||||||
|
// are noisy in the TUI footer. Extract just the base semver.
|
||||||
|
if i := strings.Index(mv, "-0."); i > 0 {
|
||||||
|
mv = mv[:i]
|
||||||
|
}
|
||||||
|
mv = strings.TrimSuffix(mv, "+dirty")
|
||||||
|
version = mv
|
||||||
}
|
}
|
||||||
for _, s := range info.Settings {
|
for _, s := range info.Settings {
|
||||||
switch s.Key {
|
switch s.Key {
|
||||||
|
|||||||
@@ -181,7 +181,18 @@ func (m Model) viewDashboard() string {
|
|||||||
if contentHeight < 1 {
|
if contentHeight < 1 {
|
||||||
contentHeight = 1
|
contentHeight = 1
|
||||||
}
|
}
|
||||||
paddedContent := lipgloss.NewStyle().Height(contentHeight).MaxHeight(contentHeight).Render(content)
|
|
||||||
|
contentLines := lipgloss.Height(content)
|
||||||
|
var paddedContent string
|
||||||
|
if contentLines < contentHeight {
|
||||||
|
topPad := (contentHeight - contentLines) / 3
|
||||||
|
paddedContent = lipgloss.NewStyle().
|
||||||
|
PaddingTop(topPad).
|
||||||
|
Height(contentHeight).MaxHeight(contentHeight).
|
||||||
|
Render(content)
|
||||||
|
} else {
|
||||||
|
paddedContent = lipgloss.NewStyle().Height(contentHeight).MaxHeight(contentHeight).Render(content)
|
||||||
|
}
|
||||||
|
|
||||||
return outerPad.Render(lipgloss.JoinVertical(lipgloss.Top, header, paddedContent, footer))
|
return outerPad.Render(lipgloss.JoinVertical(lipgloss.Top, header, paddedContent, footer))
|
||||||
}
|
}
|
||||||
@@ -194,7 +205,7 @@ type tabEntry struct {
|
|||||||
|
|
||||||
func (m Model) renderTabBar(stats dashboardStats) string {
|
func (m Model) renderTabBar(stats dashboardStats) string {
|
||||||
tabs := []tabEntry{
|
tabs := []tabEntry{
|
||||||
{"Sites", stats.totalMonitors, stats.downCount + stats.lateCount},
|
{"Monitors", stats.totalMonitors, stats.downCount + stats.lateCount},
|
||||||
{"Alerts", len(m.alerts), 0},
|
{"Alerts", len(m.alerts), 0},
|
||||||
{"Logs", 0, 0},
|
{"Logs", 0, 0},
|
||||||
{"Nodes", len(m.nodes), stats.offlineNodes},
|
{"Nodes", len(m.nodes), stats.offlineNodes},
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ func (m Model) viewDetailPanel() string {
|
|||||||
if site.ParentID > 0 {
|
if site.ParentID > 0 {
|
||||||
for _, s := range m.sites {
|
for _, s := range m.sites {
|
||||||
if s.ID == site.ParentID {
|
if s.ID == site.ParentID {
|
||||||
breadcrumb = m.st.subtleStyle.Render(" Sites > "+s.Name+" > ") + m.st.titleStyle.Render(site.Name)
|
breadcrumb = m.st.subtleStyle.Render(" Monitors > "+s.Name+" > ") + m.st.titleStyle.Render(site.Name)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if breadcrumb == "" {
|
if breadcrumb == "" {
|
||||||
breadcrumb = m.st.subtleStyle.Render(" Sites > ") + m.st.titleStyle.Render(site.Name)
|
breadcrumb = m.st.subtleStyle.Render(" Monitors > ") + m.st.titleStyle.Render(site.Name)
|
||||||
}
|
}
|
||||||
b.WriteString(breadcrumb + "\n")
|
b.WriteString(breadcrumb + "\n")
|
||||||
b.WriteString(m.divider() + "\n")
|
b.WriteString(m.divider() + "\n")
|
||||||
|
|||||||