feat(tui): add state change history view with outage duration #55
@@ -110,11 +110,7 @@ func fmtSSL(site models.Site) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func fmtRetries(site models.Site) string {
|
func fmtRetries(site models.Site) string {
|
||||||
retriesDone := site.FailureCount - 1
|
dispCount := site.FailureCount
|
||||||
if retriesDone < 0 {
|
|
||||||
retriesDone = 0
|
|
||||||
}
|
|
||||||
dispCount := retriesDone
|
|
||||||
if dispCount > site.MaxRetries {
|
if dispCount > site.MaxRetries {
|
||||||
dispCount = site.MaxRetries
|
dispCount = site.MaxRetries
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
|
switch msg := msg.(type) {
|
||||||
|
case tea.WindowSizeMsg:
|
||||||
|
return m.handleResize(msg)
|
||||||
|
case time.Time:
|
||||||
|
return m.handleTick(msg)
|
||||||
|
}
|
||||||
|
|
||||||
if m.state == stateConfirmDelete {
|
if m.state == stateConfirmDelete {
|
||||||
return m.handleConfirmDelete(msg)
|
return m.handleConfirmDelete(msg)
|
||||||
}
|
}
|
||||||
@@ -18,10 +25,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case tea.WindowSizeMsg:
|
|
||||||
return m.handleResize(msg)
|
|
||||||
case time.Time:
|
|
||||||
return m.handleTick(msg)
|
|
||||||
case tea.MouseMsg:
|
case tea.MouseMsg:
|
||||||
return m.handleMouse(msg)
|
return m.handleMouse(msg)
|
||||||
case tea.KeyMsg:
|
case tea.KeyMsg:
|
||||||
|
|||||||
Reference in New Issue
Block a user