Improve table resizing, add terminal workaround, and expose last check.
This commit is contained in:
1 parent
a19e6fa711
commit
f2ea1297e8
6 files changed
+43
-5
No files matched your search
@@ -87,7 +87,8 @@ type Model struct {
|
||||
rows []watch.Status
|
||||
results map[string]*result // by configured URL
|
||||
cursor int
|
||||
offset int // the first table row on screen
|
||||
offset int // the first table row on screen
|
||||
widths []int // the column widths, reset by resizes and reloads
|
||||
|
||||
logs []LogLine
|
||||
log viewport.Model
|
||||
@@ -138,6 +139,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
switch msg := msg.(type) {
|
||||
case tea.WindowSizeMsg:
|
||||
m.width, m.height = msg.Width, msg.Height
|
||||
m.widths = nil
|
||||
m.layout()
|
||||
case tickMsg:
|
||||
m.now = time.Time(msg)
|
||||
@@ -152,6 +154,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case reloadMsg:
|
||||
m.reloading = false
|
||||
m.rows = m.ctl.Statuses()
|
||||
m.widths = nil
|
||||
m.clampCursor()
|
||||
if msg.err != nil { m.setNote(reloadError(msg.err), true) } else { m.setNote(reloadNote(msg.summary), false) }
|
||||
case openMsg:
|
||||
|
||||
Reference in new issue
Block a user