bugfixes nov2025 (#3)

* Fix enter misbehaving.
* Cleanup after previous tui implementation.
* Fix race condition and improve logging
* Add filtering of the namespaces by text input in the wizard UI
This commit is contained in:
2025-11-24 11:09:23 +00:00
committed by GitHub
parent f41c316b2b
commit 7df161aee0
18 changed files with 1098 additions and 447 deletions
+12 -3
View File
@@ -298,6 +298,11 @@ func (m *Manager) startWorker(fwd config.Forward) error {
// stopWorker stops and removes a forward worker.
func (m *Manager) stopWorker(id string) error {
return m.stopWorkerInternal(id, true)
}
// stopWorkerInternal stops a worker with option to remove from UI or just update status
func (m *Manager) stopWorkerInternal(id string, removeFromUI bool) error {
m.workersMu.Lock()
worker, exists := m.workers[id]
if !exists {
@@ -310,9 +315,13 @@ func (m *Manager) stopWorker(id string) error {
// Unregister from health checker
m.healthChecker.Unregister(id)
// Notify UI to remove the forward
// Notify UI - either remove or update to disabled status
if m.statusUI != nil {
m.statusUI.Remove(id)
if removeFromUI {
m.statusUI.Remove(id)
} else {
m.statusUI.UpdateStatus(id, "Disabled")
}
}
// Stop the worker
@@ -363,7 +372,7 @@ func (m *Manager) getResourceForPort(forwards []config.Forward, port int) string
// DisableForward temporarily stops a forward by ID
func (m *Manager) DisableForward(id string) error {
if err := m.stopWorker(id); err != nil {
if err := m.stopWorkerInternal(id, false); err != nil {
return err
}
log.Printf("Disabled: %s", id)