add SPA config UI, wire media/rss adapters, event-driven layout push
- React SPA: dashboard, data sources CRUD, widgets CRUD, layout builder, presets. TanStack Router + Query, shadcn/ui, Vite proxy to :3000 - wire media + rss adapters into polling loop, remove xtb source type - media adapter: read username/password from headers, proper subsonic auth - event handler: subscribe to LayoutChanged, push screen update to clients - fix clippy warnings across workspace (Default impls, collapsible ifs, redundant closures, is_none_or, unused imports)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use std::sync::Mutex;
|
||||
use std::collections::HashMap;
|
||||
use domain::{
|
||||
ConfigRepository, EventPublisher,
|
||||
DataSource, DataSourceId, Layout, LayoutPreset, LayoutPresetId,
|
||||
WidgetConfig, WidgetId, DomainEvent,
|
||||
ConfigRepository, DataSource, DataSourceId, DomainEvent, EventPublisher, Layout, LayoutPreset,
|
||||
LayoutPresetId, WidgetConfig, WidgetId,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Mutex;
|
||||
|
||||
pub struct InMemoryConfigRepository {
|
||||
widgets: Mutex<HashMap<WidgetId, WidgetConfig>>,
|
||||
@@ -45,7 +44,10 @@ impl ConfigRepository for InMemoryConfigRepository {
|
||||
}
|
||||
|
||||
async fn save_widget(&self, config: &WidgetConfig) -> Result<(), Self::Error> {
|
||||
self.widgets.lock().unwrap().insert(config.id, config.clone());
|
||||
self.widgets
|
||||
.lock()
|
||||
.unwrap()
|
||||
.insert(config.id, config.clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -59,11 +61,20 @@ impl ConfigRepository for InMemoryConfigRepository {
|
||||
}
|
||||
|
||||
async fn list_data_sources(&self) -> Result<Vec<DataSource>, Self::Error> {
|
||||
Ok(self.data_sources.lock().unwrap().values().cloned().collect())
|
||||
Ok(self
|
||||
.data_sources
|
||||
.lock()
|
||||
.unwrap()
|
||||
.values()
|
||||
.cloned()
|
||||
.collect())
|
||||
}
|
||||
|
||||
async fn save_data_source(&self, source: &DataSource) -> Result<(), Self::Error> {
|
||||
self.data_sources.lock().unwrap().insert(source.id, source.clone());
|
||||
self.data_sources
|
||||
.lock()
|
||||
.unwrap()
|
||||
.insert(source.id, source.clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -90,7 +101,10 @@ impl ConfigRepository for InMemoryConfigRepository {
|
||||
}
|
||||
|
||||
async fn save_preset(&self, preset: &LayoutPreset) -> Result<(), Self::Error> {
|
||||
self.presets.lock().unwrap().insert(preset.id, preset.clone());
|
||||
self.presets
|
||||
.lock()
|
||||
.unwrap()
|
||||
.insert(preset.id, preset.clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user