This commit is contained in:
ChristianVisintin
2020-12-01 15:14:49 +01:00
parent 3944367fb3
commit cd3ffae285

View File

@@ -118,7 +118,7 @@ impl AuthActivity {
} }
/// ### change_opt_based_on_protocol /// ### change_opt_based_on_protocol
/// ///
/// Change current options based on the selected protocol /// Change current options based on the selected protocol
fn change_opt_based_on_protocol(&mut self) { fn change_opt_based_on_protocol(&mut self) {
// Change options based on current protocol // Change options based on current protocol
@@ -126,11 +126,11 @@ impl AuthActivity {
InputProtocol::Sftp => { InputProtocol::Sftp => {
self.secure = false; self.secure = false;
self.protocol = FileTransferProtocol::Sftp; self.protocol = FileTransferProtocol::Sftp;
}, }
InputProtocol::Ftp => { InputProtocol::Ftp => {
self.secure = false; self.secure = false;
self.protocol = FileTransferProtocol::Ftp; self.protocol = FileTransferProtocol::Ftp;
}, }
InputProtocol::Ftps => { InputProtocol::Ftps => {
self.secure = true; self.secure = true;
self.protocol = FileTransferProtocol::Ftp; self.protocol = FileTransferProtocol::Ftp;
@@ -335,7 +335,8 @@ impl AuthActivity {
/// ///
/// Draw protocol select /// Draw protocol select
fn draw_protocol_select(&self) -> Tabs { fn draw_protocol_select(&self) -> Tabs {
let protocols: Vec<Spans> = vec![Spans::from("SFTP"), Spans::from("FTP"), Spans::from("FTPS")]; let protocols: Vec<Spans> =
vec![Spans::from("SFTP"), Spans::from("FTP"), Spans::from("FTPS")];
let index: usize = match self.input_protocol { let index: usize = match self.input_protocol {
InputProtocol::Sftp => 0, InputProtocol::Sftp => 0,
InputProtocol::Ftp => 1, InputProtocol::Ftp => 1,
@@ -352,7 +353,7 @@ impl AuthActivity {
Style::default() Style::default()
.add_modifier(Modifier::BOLD) .add_modifier(Modifier::BOLD)
.bg(Color::Green) .bg(Color::Green)
.fg(Color::Black) .fg(Color::Black),
) )
} }
@@ -413,7 +414,7 @@ impl AuthActivity {
} }
/// ### draw_popup /// ### draw_popup
/// ///
/// Draw popup block /// Draw popup block
fn draw_popup(&self, r: Rect) -> (Paragraph, Rect) { fn draw_popup(&self, r: Rect) -> (Paragraph, Rect) {
let popup_layout = Layout::default() let popup_layout = Layout::default()
@@ -560,8 +561,8 @@ impl Activity for AuthActivity {
Some(mut ctx) => { Some(mut ctx) => {
let _ = ctx.terminal.clear(); let _ = ctx.terminal.clear();
Some(ctx) Some(ctx)
}, }
None => None None => None,
} }
} }
} }