modularize frontend and implement new css and themes

This commit is contained in:
2026-08-24 13:10:37 +01:00
parent 13116899db
commit 02b7ba317c
14 changed files with 1572 additions and 1768 deletions
+2 -4
View File
@@ -7,7 +7,8 @@ use std::{
use tokio::sync::broadcast;
pub const RESET_EVENT: &str = "__reset__";
pub const CHAT_RESET_INTERVAL: Duration = Duration::from_secs(3 * 60);
// Changed from 3 minutes to 20 minutes
pub const CHAT_RESET_INTERVAL: Duration = Duration::from_secs(20 * 60);
pub const RATE_LIMIT_WINDOW: Duration = CHAT_RESET_INTERVAL;
pub const MESSAGE_LIMIT_PER_WINDOW: u32 = 60;
pub const SESSION_LIMIT_PER_WINDOW: u32 = 10;
@@ -20,11 +21,8 @@ pub struct RateLimitEntry {
pub struct AppState {
pub sessions: DashMap<String, ChatSession>,
// broadcast channel: session_id -> sender
pub notifiers: DashMap<String, broadcast::Sender<String>>,
// supporter broadcast for new sessions and updates
pub supporter_notifier: broadcast::Sender<String>,
// in-memory rate limits, wiped with all other state every three minutes
pub rate_limits: DashMap<String, RateLimitEntry>,
reset_started: Mutex<Instant>,
}