mirror of
https://github.com/Gu1llaum-3/sshm.git
synced 2026-01-27 03:04:21 +01:00
feat: add automatic version update checking and notifications
- Add internal/version module for GitHub release checking - Integrate async version check in Bubble Tea UI - Display update notification in main interface - Add version check to --version/-v command output - Include comprehensive version comparison and error handling - Add unit tests for version parsing and comparison logic
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
// NewModel creates a new TUI model with the given SSH hosts
|
||||
func NewModel(hosts []config.SSHHost, configFile string) Model {
|
||||
func NewModel(hosts []config.SSHHost, configFile, currentVersion string) Model {
|
||||
// Initialize the history manager
|
||||
historyManager, err := history.NewHistoryManager()
|
||||
if err != nil {
|
||||
@@ -38,6 +38,7 @@ func NewModel(hosts []config.SSHHost, configFile string) Model {
|
||||
pingManager: pingManager,
|
||||
sortMode: SortByName,
|
||||
configFile: configFile,
|
||||
currentVersion: currentVersion,
|
||||
styles: styles,
|
||||
width: 80,
|
||||
height: 24,
|
||||
@@ -136,8 +137,8 @@ func NewModel(hosts []config.SSHHost, configFile string) Model {
|
||||
}
|
||||
|
||||
// RunInteractiveMode starts the interactive TUI interface
|
||||
func RunInteractiveMode(hosts []config.SSHHost, configFile string) error {
|
||||
m := NewModel(hosts, configFile)
|
||||
func RunInteractiveMode(hosts []config.SSHHost, configFile, currentVersion string) error {
|
||||
m := NewModel(hosts, configFile, currentVersion)
|
||||
|
||||
// Start the application in alt screen mode for clean output
|
||||
p := tea.NewProgram(m, tea.WithAltScreen())
|
||||
|
||||
Reference in New Issue
Block a user