@@ -450,13 +469,16 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) {
-
+
@@ -703,4 +725,215 @@ templ ConfigForm(ctx context.Context, data ConfigFormData) {
}
+}
+
+templ formvalidation() {
+
}
\ No newline at end of file
diff --git a/internal/web/handlers/handler.go b/internal/web/handlers/handler.go
index 172ac2c..b95a29d 100644
--- a/internal/web/handlers/handler.go
+++ b/internal/web/handlers/handler.go
@@ -59,7 +59,7 @@ func NewHandlers(database *db.DB, scheduler scheduler.SchedulerInterface, jwtSec
// StartLogBroadcaster starts a goroutine that broadcasts logs to all connected WebSocket clients
func StartLogBroadcaster() {
go func() {
- fmt.Fprintln(os.Stderr, "[DEBUG-BROADCASTER-V4] Broadcaster goroutine started.")
+ fmt.Fprintln(os.Stderr, "[DEBUG-BROADCASTER] Broadcaster goroutine started.")
for {
logEntry := <-LogChannel // Wait for a log entry
@@ -76,7 +76,7 @@ func StartLogBroadcaster() {
continue // Skip if no clients
}
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Received log. Broadcasting to %d clients. Level='%s', Src='%s'\n",
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Received log. Broadcasting to %d clients. Level='%s', Src='%s'\n",
len(clientsToSend), logEntry.Level, logEntry.Source)
var wg sync.WaitGroup
@@ -85,7 +85,7 @@ func StartLogBroadcaster() {
go func(c *websocket.Conn, m *sync.Mutex, entry components.LogEntry) {
defer wg.Done()
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Attempting send to client %v\n", c.RemoteAddr())
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Attempting send to client %v\n", c.RemoteAddr())
// Lock only for this specific client's write
m.Lock()
@@ -93,7 +93,7 @@ func StartLogBroadcaster() {
deadline := time.Now().Add(5 * time.Second) // 5-second deadline
err := c.SetWriteDeadline(deadline)
if err != nil {
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Error setting write deadline for client %v: %v\n", c.RemoteAddr(), err)
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Error setting write deadline for client %v: %v\n", c.RemoteAddr(), err)
// Don't unlock yet, proceed to cleanup
} else {
err = c.WriteJSON(entry)
@@ -101,19 +101,19 @@ func StartLogBroadcaster() {
m.Unlock() // Unlock after write attempt (or deadline error)
if err != nil {
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Error writing to client %v: %v. Initiating removal.\n", c.RemoteAddr(), err)
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Error writing to client %v: %v. Initiating removal.\n", c.RemoteAddr(), err)
WebSocketClientsMutex.Lock()
if _, stillExists := WebSocketClients[c]; stillExists {
delete(WebSocketClients, c)
delete(WebSocketClientWriteMutexes, c)
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Removed client %v from maps.\n", c.RemoteAddr())
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Removed client %v from maps.\n", c.RemoteAddr())
} else {
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Client %v already removed by another process.\n", c.RemoteAddr())
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Client %v already removed by another process.\n", c.RemoteAddr())
}
WebSocketClientsMutex.Unlock()
c.Close() // Close the connection outside the lock
} else {
- fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER-V4] Successfully sent to client %v\n", c.RemoteAddr())
+ fmt.Fprintf(os.Stderr, "[DEBUG-BROADCASTER] Successfully sent to client %v\n", c.RemoteAddr())
}
}(client, mutex, logEntry)
}