2025-03-06 12:32:59 +08:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
use tokio::sync::RwLock;
|
|
|
|
|
|
|
|
|
|
use crate::config::Config;
|
|
|
|
|
use crate::database::Database;
|
|
|
|
|
use crate::recorder_manager::RecorderManager;
|
2025-11-02 11:20:27 +08:00
|
|
|
use crate::task::TaskManager;
|
2025-09-07 18:38:16 +08:00
|
|
|
use crate::webhook::poster::WebhookPoster;
|
2025-03-06 12:32:59 +08:00
|
|
|
|
2025-04-30 10:22:11 +08:00
|
|
|
#[cfg(feature = "headless")]
|
2025-09-11 01:33:38 +08:00
|
|
|
use crate::progress::progress_manager::ProgressManager;
|
2025-04-30 10:22:11 +08:00
|
|
|
|
2025-03-06 12:32:59 +08:00
|
|
|
#[derive(Clone)]
|
|
|
|
|
pub struct State {
|
|
|
|
|
pub db: Arc<Database>,
|
|
|
|
|
pub config: Arc<RwLock<Config>>,
|
2025-09-07 18:38:16 +08:00
|
|
|
pub webhook_poster: WebhookPoster,
|
2025-03-06 12:32:59 +08:00
|
|
|
pub recorder_manager: Arc<RecorderManager>,
|
2025-11-02 11:20:27 +08:00
|
|
|
pub task_manager: Arc<TaskManager>,
|
2025-04-28 21:25:35 +08:00
|
|
|
#[cfg(not(feature = "headless"))]
|
2025-03-06 12:32:59 +08:00
|
|
|
pub app_handle: tauri::AppHandle,
|
2025-04-30 10:22:11 +08:00
|
|
|
#[cfg(feature = "headless")]
|
2025-04-29 17:48:50 +08:00
|
|
|
pub progress_manager: Arc<ProgressManager>,
|
2025-06-18 01:09:58 +08:00
|
|
|
#[cfg(feature = "headless")]
|
|
|
|
|
pub readonly: bool,
|
2025-03-25 16:44:28 +08:00
|
|
|
}
|