feat: finish rust web dual pane document shell

This commit is contained in:
lix-2026
2026-05-08 23:15:00 +08:00
parent 83805f9254
commit 3d5e0c9d5a
16 changed files with 3776 additions and 761 deletions
+7
View File
@@ -1,5 +1,6 @@
use crate::middleware::request_context::inject_request_context;
use crate::routes::build_router;
use crate::local_folder_watcher_registry::LocalFolderWatcherRegistry;
use axum::Router;
use std::env;
use std::fs;
@@ -132,18 +133,24 @@ fn read_env_or_dotenv(key: &str) -> Option<String> {
#[derive(Debug, Clone)]
pub struct AppState {
config: Arc<AppConfig>,
local_folder_watcher_registry: LocalFolderWatcherRegistry,
}
impl AppState {
pub fn new(config: AppConfig) -> Self {
Self {
config: Arc::new(config),
local_folder_watcher_registry: LocalFolderWatcherRegistry::new(),
}
}
pub fn config(&self) -> &AppConfig {
self.config.as_ref()
}
pub fn local_folder_watcher_registry(&self) -> &LocalFolderWatcherRegistry {
&self.local_folder_watcher_registry
}
}
pub fn build_app(state: AppState) -> Router {