Merge pull request #231 from Corfirean/feat/weekly-restart-log-cleanup-on-master

Settings: weekly world restart and server log auto-cleanup
This commit is contained in:
Corfirean authored and GitHub committed 2026-11-20 21:43:38 +05:00
commit de3af82e5d
16 files changed
+795 -41

No files matched your search

+36
View File
@@ -814,6 +814,15 @@ async fn get_settings(
blocking(move || config::load(&root, scope)).await
}
#[tauri::command]
async fn server_logging_state(
state: State<'_, AppState>,
id: String,
) -> std::result::Result<coa_core::server_logging::ServerLoggingView, UiError> {
let root = path_of(&state, &id)?;
blocking(move || Ok(coa_core::server_logging::state(&root))).await
}
#[tauri::command]
async fn server_logging_preset(
state: State<'_, AppState>,
@@ -828,6 +837,30 @@ async fn server_logging_preset(
}).await
}
#[tauri::command]
async fn server_logging_settings_save(
state: State<'_, AppState>,
id: String,
settings: coa_core::server_logging::LogSettings,
) -> std::result::Result<coa_core::server_logging::ServerLoggingView, UiError> {
let root = path_of(&state, &id)?;
let _guard = BusyGuard::acquire(&state, &id)?;
blocking(move || {
coa_core::server_logging::save_settings(&root, &settings)?;
Ok(coa_core::server_logging::state(&root))
}).await
}
#[tauri::command]
async fn server_logs_clean(
state: State<'_, AppState>,
id: String,
) -> std::result::Result<coa_core::server_logging::CleanLogsReport, UiError> {
let root = path_of(&state, &id)?;
let _guard = BusyGuard::acquire(&state, &id)?;
blocking(move || coa_core::server_logging::clean_logs(&root)).await
}
#[tauri::command]
async fn save_settings(
state: State<'_, AppState>,
@@ -3118,7 +3151,10 @@ pub fn run() {
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_process::init())
.invoke_handler(tauri::generate_handler![
server_logging_state,
server_logging_preset,
server_logging_settings_save,
server_logs_clean,
release_history,
default_install_dir,
game_data_folder,