mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-05 23:17:31 +08:00
webui: add offline-node delete API and remove channels management endpoint
This commit is contained in:
@@ -104,6 +104,25 @@ func (m *Manager) List() []NodeInfo {
|
||||
return out
|
||||
}
|
||||
|
||||
func (m *Manager) Remove(id string) bool {
|
||||
id = strings.TrimSpace(id)
|
||||
if id == "" {
|
||||
return false
|
||||
}
|
||||
m.mu.Lock()
|
||||
_, exists := m.nodes[id]
|
||||
if exists {
|
||||
delete(m.nodes, id)
|
||||
delete(m.handlers, id)
|
||||
}
|
||||
m.mu.Unlock()
|
||||
if exists {
|
||||
m.saveState()
|
||||
m.appendAudit("delete", id, nil)
|
||||
}
|
||||
return exists
|
||||
}
|
||||
|
||||
func (m *Manager) RegisterHandler(nodeID string, h Handler) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user