From ad44dc0642adde1a72f93085ee239c6fa2971434 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 13 Jul 2025 12:28:52 +0300 Subject: [PATCH] Chore: styles --- assets/style.css | 1 - assets/style.css.gz | Bin 461 -> 454 bytes broker/sse.go | 9 ++++++++- components/room.html | 16 +++++++++------- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/assets/style.css b/assets/style.css index 613e333..db799d7 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,7 +1,6 @@ body{ background-color: #0C1616FF; color: #8896b2; - max-width: 1000px; min-width: 0px; margin: 2em auto !important; margin-left: auto; diff --git a/assets/style.css.gz b/assets/style.css.gz index e4b3e9fbdd6da4b7d13ee5731620a8daa31153e8..5f04e9aa5ca808676f21c16eee78ca343f61b1dc 100644 GIT binary patch literal 454 zcmV;%0XhC3iwFp6TXSdt19NnFY-KKEb8`TVQo)MbFc7`_D^&KPxk*){l=56XA&7-+x@oyNnImmRqetUyGI7%@}Z}Z7uF_5HJQ3Z}i}Z1K9AKP#SDQ zJuwzA>#kqmMq4a<%y4!4A)_tXP9cZT7Wza%jbOu>SpL)?hLt;4YM4 zbQc9SXajP_mG;g+tdfSB%|mf00!V|&8cD2>lPLzAkMle_U^cL z{vAdzVxEjvV%zJ0(;%J$xK6nlJ@QG=xmv-a+$Y*CG(krTE)ca%Hj38Jwq&AZ68W&6 z#h&{7vM}IMn^sH}!7T#;yBkOR&b5PGv2TDyY9XrmqD90W*MrLA3yKCM^11YD= zH&+2~h{1M~d&Q>>?puz_c+rBwZ}ux~tw^0)ra|NplyVDE`)a-^vEH}DL!Ez3O#J8D wvSJ+GCB`AX@p7LPSN|(s&4n)|J&oaqyQ=6_O)sf=^(u$rFTcD?ISB*+0D@uJ1g@)97>9S>^ zr#+M&dMYDpY>UVmGm=TtlK)=Ga z{cAyPu<_NTSYXy|x8O!w%sWiDy#17DL)Pa`|Hi;p$E_#WK(Ecd63+u#@g1!D_`n)W zQh40?9E@&*!5XbcPF!g>7zkC;P`$a&4w(mOFa{=x6>^Nqz~I7u4hLZHcy_Q^=LV>? zZG)|l$n<$x3@|W9Mk}%Hw8v>9p2u=sax*&Qlc96Bf=9WJvRkOV4iQ`sY8zt|jiGJM zM9WE}#cDQt>hsG&k4tZsEXLBaz7Z|5*S15}{>0OuUeN)Rno>G;oNrMYdpI#N6HD4% z%SIZAbGm$=74U`_Y&)fwec9l?;cyry8c_Jnex!{_}laGWH*$;t<|&xzCEr{}mT=;lGxiNB?8E>gY{PFS&X1Q4ZN(^F3gG9|QmZ D1g7bP diff --git a/broker/sse.go b/broker/sse.go index 1946bb4..116c23f 100644 --- a/broker/sse.go +++ b/broker/sse.go @@ -91,7 +91,9 @@ func (broker *Broker) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Listen for new notifications and redistribute them to clients func (broker *Broker) Listen() { + slog.Info("Broker listener started") for { + slog.Info("Broker waiting for event") select { case s := <-broker.newClients: // A new client has connected. @@ -104,16 +106,21 @@ func (broker *Broker) Listen() { delete(broker.clients, s) slog.Info("Client removed", "clients listening", len(broker.clients)) case event := <-broker.Notifier: + slog.Info("Received new event", "event", event.EventName, "payload", event.Payload) // We got a new event from the outside! // Send event to all connected clients + slog.Info("Broadcasting event to clients", "client_count", len(broker.clients)) for clientMessageChan := range broker.clients { + slog.Info("Sending event to client", "client", clientMessageChan) select { case clientMessageChan <- event: + slog.Info("Successfully sent event to client", "client", clientMessageChan) case <-time.After(patience): delete(broker.clients, clientMessageChan) - slog.Info("Client was removed", "clients listening", len(broker.clients)) + slog.Warn("Client timed out, removed", "client", clientMessageChan, "clients listening", len(broker.clients)) } } + slog.Info("Finished broadcasting event") } } } diff --git a/components/room.html b/components/room.html index 1caabbd..e3dd763 100644 --- a/components/room.html +++ b/components/room.html @@ -49,6 +49,15 @@ {{template "teamlist" .Room.RedTeam}}
+
+
+ {{template "actionhistory" .Room.ActionHistory}} +
+
+ {{template "cardtable" .Room}} +
+ +
bot thought:
    @@ -57,13 +66,6 @@ {{end}}
-
- {{template "actionhistory" .Room.ActionHistory}} -
-
-
- {{template "cardtable" .Room}} -
{{if .Room.IsRunning}} {{if and (eq .State.Role "guesser") (eq .State.Team .Room.TeamTurn)}}