pub mod audit_log; pub mod menu_config; pub mod permission_inheritance; pub mod rbac; pub mod rbac_ui; use axum::{ extract::State, response::Html, routing::{get, post}, Router, }; use std::sync::Arc; use crate::shared::state::AppState; pub fn configure_settings_routes() -> Router> { Router::new() .route("/api/user/storage", get(get_storage_info)) .route("/api/user/storage/connections", get(get_storage_connections)) .route("/api/user/security/2fa/status", get(get_2fa_status)) .route("/api/user/security/2fa/enable", post(enable_2fa)) .route("/api/user/security/2fa/disable", post(disable_2fa)) .route("/api/user/security/sessions", get(get_active_sessions)) .route( "/api/user/security/sessions/revoke-all", post(revoke_all_sessions), ) .route("/api/user/security/devices", get(get_trusted_devices)) .merge(rbac::configure_rbac_routes()) } async fn get_storage_info(State(_state): State>) -> Html { Html( r##"
2.5 GB used of 10 GB
📄 Documents 1.2 GB
🖼️ Images 800 MB
📧 Emails 500 MB
"## .to_string(), ) } async fn get_storage_connections(State(_state): State>) -> Html { Html( r##"

No external storage connections configured

"## .to_string(), ) } async fn get_2fa_status(State(_state): State>) -> Html { Html( r##"
Two-factor authentication is not enabled
"## .to_string(), ) } async fn enable_2fa(State(_state): State>) -> Html { Html( r##"
Two-factor authentication enabled
"## .to_string(), ) } async fn disable_2fa(State(_state): State>) -> Html { Html( r##"
Two-factor authentication disabled
"## .to_string(), ) } async fn get_active_sessions(State(_state): State>) -> Html { Html( r##"
💻 Current Session This device
Current browser session Active now

No other active sessions

"## .to_string(), ) } async fn revoke_all_sessions(State(_state): State>) -> Html { Html( r##"
All other sessions have been revoked
"## .to_string(), ) } async fn get_trusted_devices(State(_state): State>) -> Html { Html( r##"
💻
Current Device Last active: Just now
Trusted

No other trusted devices

"## .to_string(), ) }