feat(tui,status): add per-site pause, fix viewport, polish status page
Per-site pause: [p] key toggles pause for selected monitor in TUI. Paused monitors skip checks, persist to DB, show on status page. Status page: replace full-page reload with fetch-based DOM updates to eliminate scroll-jump on refresh. Add summary bar (UP/DOWN/PAUSED counts), stale-data indicator, and fix SSL EXP CSS class bug. TUI: constrain tables to terminal width via lipgloss .Width() to prevent row wrapping that pushed header off-screen. Add MaxHeight safety net. Bump subtle style from #383838 to #565f89 for readability on dark terminals.
This commit is contained in:
@@ -26,8 +26,6 @@ var (
|
||||
|
||||
alertBorderStyle = lipgloss.NewStyle().
|
||||
Foreground(lipgloss.Color("#444"))
|
||||
|
||||
alertColWidths = []int{4, 16, 10, 36}
|
||||
)
|
||||
|
||||
type alertFormData struct {
|
||||
@@ -120,27 +118,25 @@ func (m Model) viewAlertsTab() string {
|
||||
})
|
||||
}
|
||||
|
||||
tableWidth := m.termWidth - 6
|
||||
if tableWidth < 40 {
|
||||
tableWidth = 40
|
||||
}
|
||||
|
||||
t := table.New().
|
||||
Border(lipgloss.RoundedBorder()).
|
||||
BorderStyle(alertBorderStyle).
|
||||
Width(tableWidth).
|
||||
Headers("ID", "NAME", "TYPE", "CONFIG").
|
||||
Rows(rows...).
|
||||
StyleFunc(func(row, col int) lipgloss.Style {
|
||||
if row == table.HeaderRow {
|
||||
s := alertHeaderStyle
|
||||
if col < len(alertColWidths) {
|
||||
s = s.Width(alertColWidths[col])
|
||||
}
|
||||
return s
|
||||
return alertHeaderStyle
|
||||
}
|
||||
s := alertCellStyle
|
||||
if row == selectedVisual {
|
||||
s = alertSelectedStyle
|
||||
return alertSelectedStyle
|
||||
}
|
||||
if col < len(alertColWidths) {
|
||||
s = s.Width(alertColWidths[col])
|
||||
}
|
||||
return s
|
||||
return alertCellStyle
|
||||
})
|
||||
|
||||
return "\n" + t.Render()
|
||||
|
||||
Reference in New Issue
Block a user