file rename (#9089)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-08-16 12:55:58 +08:00
committed by GitHub
parent 579e0fac36
commit ed18e3c786
59 changed files with 507 additions and 50 deletions

View File

@@ -2274,6 +2274,22 @@ impl Connection {
job.confirm(&r);
}
}
Some(file_action::Union::Rename(r)) => {
self.send_fs(ipc::FS::Rename {
id: r.id,
path: r.path.clone(),
new_name: r.new_name.clone(),
});
self.send_to_cm(ipc::Data::FileTransferLog((
"rename".to_string(),
serde_json::to_string(&FileRenameLog {
conn_id: self.inner.id(),
path: r.path,
new_name: r.new_name,
})
.unwrap_or_default(),
)));
}
_ => {}
}
}
@@ -3451,6 +3467,14 @@ struct FileActionLog {
dir: bool,
}
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
struct FileRenameLog {
conn_id: i32,
path: String,
new_name: String,
}
struct FileRemoveLogControl {
conn_id: i32,
instant: Instant,