Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
bcb2678a20
|
+2
-2
@@ -413,7 +413,7 @@ func runServe(args []string) {
|
||||
sshSrv := startSSHServer(*port, s, eng, kc)
|
||||
|
||||
if isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) {
|
||||
p := tea.NewProgram(tui.InitialModel(true, s, eng, version), tea.WithAltScreen(), tea.WithMouseCellMotion())
|
||||
p := tea.NewProgram(tui.InitialModel(true, s, eng), tea.WithAltScreen(), tea.WithMouseCellMotion())
|
||||
if _, err := p.Run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
}
|
||||
@@ -449,7 +449,7 @@ func startSSHServer(port int, db store.Store, eng *monitor.Engine, kc *keyCache)
|
||||
}),
|
||||
wish.WithMiddleware(
|
||||
bm.Middleware(func(s ssh.Session) (tea.Model, []tea.ProgramOption) {
|
||||
return tui.InitialModel(false, db, eng, version), []tea.ProgramOption{tea.WithAltScreen(), tea.WithMouseCellMotion()}
|
||||
return tui.InitialModel(false, db, eng), []tea.ProgramOption{tea.WithAltScreen(), tea.WithMouseCellMotion()}
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -131,9 +131,9 @@ func (m Model) groupSparkline(groupID int, width int) string {
|
||||
}
|
||||
for _, up := range aggregated {
|
||||
if up {
|
||||
sb.WriteString(specialStyle.Render("•"))
|
||||
sb.WriteString(specialStyle.Render("●"))
|
||||
} else {
|
||||
sb.WriteString(dangerStyle.Render("•"))
|
||||
sb.WriteString(dangerStyle.Render("●"))
|
||||
}
|
||||
}
|
||||
return sb.String()
|
||||
|
||||
@@ -78,13 +78,13 @@ func (m Model) computeLayout() tableLayout {
|
||||
if nameW < 13 {
|
||||
nameW = 13
|
||||
}
|
||||
if nameW > 35 {
|
||||
nameW = 35
|
||||
if nameW > 40 {
|
||||
nameW = 40
|
||||
}
|
||||
|
||||
sparkW := avail - nameW
|
||||
if sparkW < 15 {
|
||||
sparkW = 15
|
||||
if sparkW < 10 {
|
||||
sparkW = 10
|
||||
}
|
||||
|
||||
widths[1] = nameW
|
||||
|
||||
@@ -66,9 +66,6 @@ func (m Model) renderTable(headers []string, items int, buildRows func(start, en
|
||||
if styleOverride != nil {
|
||||
if s := styleOverride(row, col); s != nil {
|
||||
style := *s
|
||||
if row%2 == 1 {
|
||||
style = style.Background(tableZebraStyle.GetBackground())
|
||||
}
|
||||
if isSelected {
|
||||
style = tableSelectedStyle.Foreground(s.GetForeground())
|
||||
}
|
||||
|
||||
+1
-3
@@ -138,10 +138,9 @@ type Model struct {
|
||||
// demoMode renders a stable status dot instead of the animated pulse so
|
||||
// screenshots/recordings don't capture the spinner mid-frame. Set via UPTOP_DEMO=1.
|
||||
demoMode bool
|
||||
version string
|
||||
}
|
||||
|
||||
func InitialModel(isAdmin bool, s store.Store, eng *monitor.Engine, version string) Model {
|
||||
func InitialModel(isAdmin bool, s store.Store, eng *monitor.Engine) Model {
|
||||
vpLogs := viewport.New(100, 20)
|
||||
vpLogs.SetContent("Waiting for logs...")
|
||||
z := zone.New()
|
||||
@@ -173,7 +172,6 @@ func InitialModel(isAdmin bool, s store.Store, eng *monitor.Engine, version stri
|
||||
theme: theme,
|
||||
themeIndex: themeIdx,
|
||||
demoMode: os.Getenv("UPTOP_DEMO") == "1",
|
||||
version: version,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -275,10 +275,9 @@ func (m Model) renderFooter(stats dashboardStats) string {
|
||||
keys = "[T]Theme [Tab]Switch [q]Quit"
|
||||
}
|
||||
|
||||
ver := subtleStyle.Render("v" + m.version)
|
||||
footer := "\n" + statusLine + " " + subtleStyle.Render(keys) + " " + ver
|
||||
footer := "\n" + statusLine + " " + subtleStyle.Render(keys)
|
||||
if m.filterText != "" && m.currentTab == 0 {
|
||||
footer = "\n" + subtleStyle.Render(fmt.Sprintf("filter: %s", m.filterText)) + " " + statusLine + " " + subtleStyle.Render(keys) + " " + ver
|
||||
footer = "\n" + subtleStyle.Render(fmt.Sprintf("filter: %s", m.filterText)) + " " + statusLine + " " + subtleStyle.Render(keys)
|
||||
}
|
||||
return footer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user