feat(backup): 实例备份第1轮——独立备份库迁移、settings 仓库路径字段、备份进度事件
This commit is contained in:
1 parent
95a3e00b03
commit
e91ba2ae74
11 files changed
+298
-1
No files matched your search
@@ -1,6 +1,7 @@
|
||||
use super::{FriendPayload, LoadingBarId};
|
||||
use crate::event::{
|
||||
CommandPayload, EventError, InstanceBulkUpdateProgressPayload,
|
||||
CommandPayload, EventError, InstanceBackupProgressPayload,
|
||||
InstanceBulkUpdateProgressPayload,
|
||||
InstancePayloadType, LoadingBar, LoadingBarType, ProcessPayloadType,
|
||||
ServerPayloadType,
|
||||
};
|
||||
@@ -358,6 +359,21 @@ pub async fn emit_instance_bulk_update_progress(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
pub async fn emit_instance_backup_progress(
|
||||
payload: InstanceBackupProgressPayload,
|
||||
) -> crate::Result<()> {
|
||||
#[cfg(feature = "tauri")]
|
||||
{
|
||||
let event_state = crate::EventState::get()?;
|
||||
event_state
|
||||
.app
|
||||
.emit("instance_backup_progress", payload)
|
||||
.map_err(EventError::from)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// emit_command(CommandPayload::Something { something })
|
||||
// ie: installing a pack, opening an .mrpack, etc
|
||||
// Generally used for url deep links and file opens that we want to handle in the frontend
|
||||
|
||||
Reference in new issue
Block a user