feat: auto-trunk creation, SIP gateway in metrics, gateway WS broadcast
- SIPGateway field in NodeMetric model - HasNode() engine method - OnNewNode callback in NATS subscriber - Auto-create balance trunk from new node metric - BroadcastGatewayEvent on WS hub - Gateway status indicators in trunks UI (green/red/gray) - SPA fallback for frontend routing
This commit is contained in:
@@ -144,6 +144,14 @@ func (e *Engine) GetNodeHistory(nodeID string) []NodeSnapshot {
|
||||
return ring.snapshot()
|
||||
}
|
||||
|
||||
// HasNode возвращает true, если нода уже зарегистрирована в engine.
|
||||
func (e *Engine) HasNode(nodeID string) bool {
|
||||
e.mu.RLock()
|
||||
defer e.mu.RUnlock()
|
||||
_, exists := e.nodes[nodeID]
|
||||
return exists
|
||||
}
|
||||
|
||||
// ToggleNode включает/выключает ноду из распределения.
|
||||
func (e *Engine) ToggleNode(nodeID string, disabled bool, reason string) error {
|
||||
e.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user