mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
More logs, some improvements
This commit is contained in:
@@ -602,6 +602,7 @@ impl FileTransferActivity {
|
|||||||
.change_wrkdir(PathBuf::from(path))
|
.change_wrkdir(PathBuf::from(path))
|
||||||
{
|
{
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
self.log(LogLevel::Info, format!("Changed directory on local: {}", path.display()).as_str());
|
||||||
// Reload files
|
// Reload files
|
||||||
self.local_scan(path);
|
self.local_scan(path);
|
||||||
// Push prev_dir to stack
|
// Push prev_dir to stack
|
||||||
@@ -623,7 +624,13 @@ impl FileTransferActivity {
|
|||||||
Ok(prev_dir) => {
|
Ok(prev_dir) => {
|
||||||
// Change directory
|
// Change directory
|
||||||
match self.client.change_dir(path) {
|
match self.client.change_dir(path) {
|
||||||
Ok(_) => self.remote.pushd(prev_dir.as_path()), // Push prev_dir to stack
|
Ok(_) => {
|
||||||
|
self.log(LogLevel::Info, format!("Changed directory on remote: {}", path.display()).as_str());
|
||||||
|
// Update files
|
||||||
|
self.remote_scan(path);
|
||||||
|
// Push prev_dir to stack
|
||||||
|
self.remote.pushd(prev_dir.as_path())
|
||||||
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
// Report err
|
// Report err
|
||||||
self.input_mode = InputMode::Popup(PopupType::Alert(
|
self.input_mode = InputMode::Popup(PopupType::Alert(
|
||||||
@@ -632,8 +639,6 @@ impl FileTransferActivity {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Update files
|
|
||||||
self.remote_scan(path);
|
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
// Report err
|
// Report err
|
||||||
@@ -861,20 +866,8 @@ impl FileTransferActivity {
|
|||||||
if let Some(entry) = files.get(self.remote.index) {
|
if let Some(entry) = files.get(self.remote.index) {
|
||||||
if let FsEntry::Directory(dir) = entry {
|
if let FsEntry::Directory(dir) = entry {
|
||||||
// Get current directory
|
// Get current directory
|
||||||
match self.client.pwd() {
|
|
||||||
Ok(prev_dir) => {
|
|
||||||
// Change directory
|
|
||||||
self.remote_changedir(dir.abs_path.as_path());
|
self.remote_changedir(dir.abs_path.as_path());
|
||||||
}
|
}
|
||||||
Err(err) => {
|
|
||||||
// Report err
|
|
||||||
self.input_mode = InputMode::Popup(PopupType::Alert(
|
|
||||||
Color::Red,
|
|
||||||
format!("Could not change working directory: {}", err),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeyCode::Backspace => {
|
KeyCode::Backspace => {
|
||||||
@@ -1152,6 +1145,8 @@ impl FileTransferActivity {
|
|||||||
DialogYesNoOption::No => no_cb(self),
|
DialogYesNoOption::No => no_cb(self),
|
||||||
DialogYesNoOption::Yes => yes_cb(self),
|
DialogYesNoOption::Yes => yes_cb(self),
|
||||||
}
|
}
|
||||||
|
// Reset choice option to yes
|
||||||
|
self.choice_opt = DialogYesNoOption::Yes;
|
||||||
}
|
}
|
||||||
KeyCode::Right => self.choice_opt = DialogYesNoOption::No, // Set to NO
|
KeyCode::Right => self.choice_opt = DialogYesNoOption::No, // Set to NO
|
||||||
KeyCode::Left => self.choice_opt = DialogYesNoOption::Yes, // Set to YES
|
KeyCode::Left => self.choice_opt = DialogYesNoOption::Yes, // Set to YES
|
||||||
@@ -1178,7 +1173,7 @@ impl FileTransferActivity {
|
|||||||
self.local_changedir(PathBuf::from(input.as_str()).as_path());
|
self.local_changedir(PathBuf::from(input.as_str()).as_path());
|
||||||
}
|
}
|
||||||
FileExplorerTab::Remote => {
|
FileExplorerTab::Remote => {
|
||||||
//TODO: here
|
self.remote_changedir(PathBuf::from(input.as_str()).as_path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1507,6 +1502,7 @@ impl FileTransferActivity {
|
|||||||
// Draw log
|
// Draw log
|
||||||
f.render_stateful_widget(self.draw_log_list(), chunks[2], &mut log_state);
|
f.render_stateful_widget(self.draw_log_list(), chunks[2], &mut log_state);
|
||||||
// Draw footer
|
// Draw footer
|
||||||
|
// FIXME: doesn't work for some reason...
|
||||||
f.render_widget(self.draw_footer(), chunks[3]);
|
f.render_widget(self.draw_footer(), chunks[3]);
|
||||||
// Draw popup
|
// Draw popup
|
||||||
if let InputMode::Popup(popup) = &self.input_mode {
|
if let InputMode::Popup(popup) = &self.input_mode {
|
||||||
@@ -1740,7 +1736,7 @@ impl FileTransferActivity {
|
|||||||
.block(
|
.block(
|
||||||
Block::default()
|
Block::default()
|
||||||
.borders(Borders::ALL)
|
.borders(Borders::ALL)
|
||||||
.title("Please wait..."),
|
.title("Please wait"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user