mirror of
https://github.com/veeso/termscp.git
synced 2026-09-27 22:41:19 -07:00
285 feature request multi host (#293)
This commit is contained in:
+650
-175
@@ -4,7 +4,10 @@
|
||||
|
||||
use tuirealm::{State, StateValue};
|
||||
|
||||
use super::{AuthActivity, ExitReason, FormMsg, Id, InputMask, Msg, UiMsg, Update};
|
||||
use super::{
|
||||
AuthActivity, AuthFormId, ExitReason, FormMsg, FormTab, HostBridgeProtocol, Id, InputMask, Msg,
|
||||
UiAuthFormMsg, UiMsg, Update,
|
||||
};
|
||||
|
||||
impl Update<Msg> for AuthActivity {
|
||||
fn update(&mut self, msg: Option<Msg>) -> Option<Msg> {
|
||||
@@ -21,19 +24,26 @@ impl AuthActivity {
|
||||
fn update_form(&mut self, msg: FormMsg) -> Option<Msg> {
|
||||
match msg {
|
||||
FormMsg::Connect => {
|
||||
match self.collect_host_params() {
|
||||
Err(err) => {
|
||||
// mount error
|
||||
self.mount_error(err);
|
||||
}
|
||||
Ok(params) => {
|
||||
self.save_recent();
|
||||
// Set file transfer params to context
|
||||
self.context_mut().set_ftparams(params);
|
||||
// Set exit reason
|
||||
self.exit_reason = Some(super::ExitReason::Connect);
|
||||
}
|
||||
}
|
||||
let Ok(remote_params) = self.collect_remote_host_params() else {
|
||||
// mount error
|
||||
self.mount_error("Invalid remote params parameters");
|
||||
return None;
|
||||
};
|
||||
|
||||
let Ok(host_bridge_params) = self.collect_host_bridge_params() else {
|
||||
// mount error
|
||||
self.mount_error("Invalid host bridge params parameters");
|
||||
return None;
|
||||
};
|
||||
|
||||
self.save_recent();
|
||||
// Set file transfer params to context
|
||||
self.context_mut().set_remote_params(remote_params);
|
||||
// set host bridge params
|
||||
self.context_mut()
|
||||
.set_host_bridge_params(host_bridge_params);
|
||||
// Set exit reason
|
||||
self.exit_reason = Some(super::ExitReason::Connect);
|
||||
}
|
||||
FormMsg::DeleteBookmark => {
|
||||
if let Ok(State::One(StateValue::Usize(idx))) = self.app.state(&Id::BookmarksList) {
|
||||
@@ -62,50 +72,86 @@ impl AuthActivity {
|
||||
self.install_update();
|
||||
}
|
||||
FormMsg::LoadBookmark(i) => {
|
||||
self.load_bookmark(i);
|
||||
self.load_bookmark(self.last_form_tab, i);
|
||||
// Give focus to input password (or to protocol if not generic)
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::Password,
|
||||
InputMask::Smb => &Id::Password,
|
||||
InputMask::AwsS3 => &Id::S3Bucket,
|
||||
InputMask::Kube => &Id::KubeNamespace,
|
||||
InputMask::WebDAV => &Id::Password,
|
||||
})
|
||||
.is_ok());
|
||||
let focus = match self.last_form_tab {
|
||||
FormTab::Remote => match self.remote_input_mask() {
|
||||
InputMask::Localhost => &Id::Remote(AuthFormId::LocalDirectory),
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Password),
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::Password),
|
||||
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3Bucket),
|
||||
InputMask::Kube => &Id::Remote(AuthFormId::KubeNamespace),
|
||||
InputMask::WebDAV => &Id::Remote(AuthFormId::Password),
|
||||
},
|
||||
FormTab::HostBridge => match self.host_bridge_input_mask() {
|
||||
InputMask::Localhost => &Id::HostBridge(AuthFormId::LocalDirectory),
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
|
||||
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3Bucket),
|
||||
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeNamespace),
|
||||
InputMask::WebDAV => &Id::HostBridge(AuthFormId::Password),
|
||||
},
|
||||
};
|
||||
|
||||
assert!(self.app.active(focus).is_ok());
|
||||
}
|
||||
FormMsg::LoadRecent(i) => {
|
||||
self.load_recent(i);
|
||||
self.load_recent(self.last_form_tab, i);
|
||||
// Give focus to input password (or to protocol if not generic)
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::Password,
|
||||
InputMask::Smb => &Id::Password,
|
||||
InputMask::AwsS3 => &Id::S3Bucket,
|
||||
InputMask::Kube => &Id::KubeNamespace,
|
||||
InputMask::WebDAV => &Id::Password,
|
||||
})
|
||||
.is_ok());
|
||||
let focus = match self.last_form_tab {
|
||||
FormTab::Remote => match self.remote_input_mask() {
|
||||
InputMask::Localhost => &Id::Remote(AuthFormId::LocalDirectory),
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Password),
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::Password),
|
||||
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3Bucket),
|
||||
InputMask::Kube => &Id::Remote(AuthFormId::KubeNamespace),
|
||||
InputMask::WebDAV => &Id::Remote(AuthFormId::Password),
|
||||
},
|
||||
FormTab::HostBridge => match self.host_bridge_input_mask() {
|
||||
InputMask::Localhost => &Id::HostBridge(AuthFormId::LocalDirectory),
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
|
||||
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3Bucket),
|
||||
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeNamespace),
|
||||
InputMask::WebDAV => &Id::HostBridge(AuthFormId::Password),
|
||||
},
|
||||
};
|
||||
|
||||
assert!(self.app.active(focus).is_ok());
|
||||
}
|
||||
FormMsg::ProtocolChanged(protocol) => {
|
||||
self.protocol = protocol;
|
||||
FormMsg::HostBridgeProtocolChanged(protocol) => {
|
||||
self.host_bridge_protocol = protocol;
|
||||
// Update port
|
||||
let port: u16 = self.get_input_port();
|
||||
let port: u16 = self.get_input_port(FormTab::HostBridge);
|
||||
if let HostBridgeProtocol::Remote(remote_protocol) = protocol {
|
||||
if Self::is_port_standard(port) {
|
||||
self.mount_port(
|
||||
FormTab::HostBridge,
|
||||
Self::get_default_port_for_protocol(remote_protocol),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
FormMsg::RemoteProtocolChanged(protocol) => {
|
||||
self.remote_protocol = protocol;
|
||||
// Update port
|
||||
let port: u16 = self.get_input_port(FormTab::Remote);
|
||||
if Self::is_port_standard(port) {
|
||||
self.mount_port(Self::get_default_port_for_protocol(protocol));
|
||||
self.mount_port(
|
||||
FormTab::Remote,
|
||||
Self::get_default_port_for_protocol(protocol),
|
||||
);
|
||||
}
|
||||
}
|
||||
FormMsg::Quit => {
|
||||
self.exit_reason = Some(ExitReason::Quit);
|
||||
}
|
||||
FormMsg::SaveBookmark => {
|
||||
FormMsg::SaveBookmark(form_tab) => {
|
||||
// get bookmark name
|
||||
let (name, save_password) = self.get_new_bookmark();
|
||||
// Save bookmark
|
||||
if !name.is_empty() {
|
||||
self.save_bookmark(name, save_password);
|
||||
self.save_bookmark(form_tab, name, save_password);
|
||||
}
|
||||
// Umount popup
|
||||
self.umount_bookmark_save_dialog();
|
||||
@@ -118,16 +164,30 @@ impl AuthActivity {
|
||||
|
||||
fn update_ui(&mut self, msg: UiMsg) -> Option<Msg> {
|
||||
match msg {
|
||||
UiMsg::AddressBlurDown => {
|
||||
let id = if cfg!(windows) && self.input_mask() == InputMask::Smb {
|
||||
&Id::SmbShare
|
||||
UiMsg::HostBridge(UiAuthFormMsg::AddressBlurDown) => {
|
||||
let id = if cfg!(windows) && self.host_bridge_input_mask() == InputMask::Smb {
|
||||
&Id::HostBridge(AuthFormId::SmbShare)
|
||||
} else {
|
||||
&Id::Port
|
||||
&Id::HostBridge(AuthFormId::Port)
|
||||
};
|
||||
assert!(self.app.active(id).is_ok());
|
||||
}
|
||||
UiMsg::AddressBlurUp => {
|
||||
assert!(self.app.active(&Id::Protocol).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::AddressBlurDown) => {
|
||||
let id = if cfg!(windows) && self.remote_input_mask() == InputMask::Smb {
|
||||
&Id::Remote(AuthFormId::SmbShare)
|
||||
} else {
|
||||
&Id::Remote(AuthFormId::Port)
|
||||
};
|
||||
assert!(self.app.active(id).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::AddressBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::AddressBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Protocol)).is_ok());
|
||||
}
|
||||
UiMsg::BookmarksListBlur => {
|
||||
assert!(self.app.active(&Id::RecentsList).is_ok());
|
||||
@@ -136,7 +196,21 @@ impl AuthActivity {
|
||||
assert!(self.app.active(&Id::BookmarkSavePassword).is_ok());
|
||||
}
|
||||
UiMsg::BookmarksTabBlur => {
|
||||
assert!(self.app.active(&Id::Protocol).is_ok());
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::ChangeFormTab) => {
|
||||
self.last_form_tab = FormTab::Remote;
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Protocol)).is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::ChangeFormTab) => {
|
||||
self.last_form_tab = FormTab::HostBridge;
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::CloseDeleteBookmark => {
|
||||
assert!(self.app.umount(&Id::DeleteBookmarkPopup).is_ok());
|
||||
@@ -162,185 +236,554 @@ impl AuthActivity {
|
||||
assert!(self.app.umount(&Id::BookmarkName).is_ok());
|
||||
assert!(self.app.umount(&Id::BookmarkSavePassword).is_ok());
|
||||
}
|
||||
UiMsg::LocalDirectoryBlurDown => {
|
||||
assert!(self.app.active(&Id::Protocol).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::LocalDirectoryBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::LocalDirectoryBlurUp => {
|
||||
assert!(self.app.active(&Id::RemoteDirectory).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::LocalDirectoryBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Protocol)).is_ok());
|
||||
}
|
||||
UiMsg::ParamsFormBlur => {
|
||||
UiMsg::HostBridge(UiAuthFormMsg::LocalDirectoryBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::LocalDirectoryBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::ParamsFormBlur) => {
|
||||
assert!(self.app.active(&Id::BookmarksList).is_ok());
|
||||
}
|
||||
UiMsg::PasswordBlurDown => {
|
||||
UiMsg::Remote(UiAuthFormMsg::ParamsFormBlur) => {
|
||||
assert!(self.app.active(&Id::BookmarksList).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::PasswordBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::RemoteDirectory,
|
||||
.active(match self.host_bridge_input_mask() {
|
||||
InputMask::Localhost => unreachable!(),
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||
#[cfg(unix)]
|
||||
InputMask::Smb => &Id::SmbWorkgroup,
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
InputMask::Smb => &Id::RemoteDirectory,
|
||||
InputMask::AwsS3 => panic!("this shouldn't happen (password on s3)"),
|
||||
InputMask::Kube => panic!("this shouldn't happen (password on kube)"),
|
||||
InputMask::WebDAV => &Id::RemoteDirectory,
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
||||
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
||||
InputMask::WebDAV => &Id::HostBridge(AuthFormId::RemoteDirectory),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::PasswordBlurUp => {
|
||||
assert!(self.app.active(&Id::Username).is_ok());
|
||||
}
|
||||
UiMsg::PortBlurDown => {
|
||||
UiMsg::Remote(UiAuthFormMsg::PasswordBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::Username,
|
||||
InputMask::Smb => &Id::SmbShare,
|
||||
InputMask::AwsS3 | InputMask::Kube | InputMask::WebDAV =>
|
||||
panic!("this shouldn't happen (port on s3/kube/webdav)"),
|
||||
.active(match self.remote_input_mask() {
|
||||
InputMask::Localhost => unreachable!(),
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||
#[cfg(unix)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (password on s3)"),
|
||||
InputMask::Kube => unreachable!("this shouldn't happen (password on kube)"),
|
||||
InputMask::WebDAV => &Id::Remote(AuthFormId::RemoteDirectory),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::PortBlurUp => {
|
||||
assert!(self.app.active(&Id::Address).is_ok());
|
||||
}
|
||||
UiMsg::ProtocolBlurDown => {
|
||||
UiMsg::HostBridge(UiAuthFormMsg::PasswordBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::Address,
|
||||
InputMask::Smb => &Id::Address,
|
||||
InputMask::AwsS3 => &Id::S3Bucket,
|
||||
InputMask::Kube => &Id::KubeNamespace,
|
||||
InputMask::WebDAV => &Id::WebDAVUri,
|
||||
.active(&Id::HostBridge(AuthFormId::Username))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::PasswordBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Username)).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::PortBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.host_bridge_input_mask() {
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Username),
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbShare),
|
||||
InputMask::Localhost
|
||||
| InputMask::AwsS3
|
||||
| InputMask::Kube
|
||||
| InputMask::WebDAV =>
|
||||
unreachable!("this shouldn't happen (port on s3/kube/webdav)"),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::ProtocolBlurUp => {
|
||||
assert!(self.app.active(&Id::LocalDirectory).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::PortBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.remote_input_mask() {
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Username),
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbShare),
|
||||
InputMask::Localhost
|
||||
| InputMask::AwsS3
|
||||
| InputMask::Kube
|
||||
| InputMask::WebDAV =>
|
||||
unreachable!("this shouldn't happen (port on s3/kube/webdav)"),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::PortBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Address))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::PortBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Address)).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::ProtocolBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.host_bridge_input_mask() {
|
||||
InputMask::Localhost => &Id::HostBridge(AuthFormId::LocalDirectory),
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Address),
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::Address),
|
||||
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3Bucket),
|
||||
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeNamespace),
|
||||
InputMask::WebDAV => &Id::HostBridge(AuthFormId::WebDAVUri),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::ProtocolBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.remote_input_mask() {
|
||||
InputMask::Localhost => &Id::Remote(AuthFormId::LocalDirectory),
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Address),
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::Address),
|
||||
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3Bucket),
|
||||
InputMask::Kube => &Id::Remote(AuthFormId::KubeNamespace),
|
||||
InputMask::WebDAV => &Id::Remote(AuthFormId::WebDAVUri),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::ProtocolBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::LocalDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::ProtocolBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::LocalDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::RececentsListBlur => {
|
||||
assert!(self.app.active(&Id::BookmarksList).is_ok());
|
||||
}
|
||||
UiMsg::RemoteDirectoryBlurDown => {
|
||||
assert!(self.app.active(&Id::LocalDirectory).is_ok());
|
||||
}
|
||||
UiMsg::RemoteDirectoryBlurUp => {
|
||||
UiMsg::HostBridge(UiAuthFormMsg::RemoteDirectoryBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::Password,
|
||||
.active(&Id::HostBridge(AuthFormId::LocalDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::RemoteDirectoryBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::LocalDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::RemoteDirectoryBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.host_bridge_input_mask() {
|
||||
InputMask::Localhost => unreachable!(),
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Password),
|
||||
#[cfg(unix)]
|
||||
InputMask::Smb => &Id::SmbWorkgroup,
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
InputMask::Smb => &Id::Password,
|
||||
InputMask::Kube => &Id::KubeClientKey,
|
||||
InputMask::AwsS3 => &Id::S3NewPathStyle,
|
||||
InputMask::WebDAV => &Id::Password,
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::Password),
|
||||
InputMask::Kube => &Id::HostBridge(AuthFormId::KubeClientKey),
|
||||
InputMask::AwsS3 => &Id::HostBridge(AuthFormId::S3NewPathStyle),
|
||||
InputMask::WebDAV => &Id::HostBridge(AuthFormId::Password),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3BucketBlurDown => {
|
||||
assert!(self.app.active(&Id::S3Region).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::RemoteDirectoryBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.remote_input_mask() {
|
||||
InputMask::Localhost => unreachable!(),
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Password),
|
||||
#[cfg(unix)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbWorkgroup),
|
||||
#[cfg(windows)]
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::Password),
|
||||
InputMask::Kube => &Id::Remote(AuthFormId::KubeClientKey),
|
||||
InputMask::AwsS3 => &Id::Remote(AuthFormId::S3NewPathStyle),
|
||||
InputMask::WebDAV => &Id::Remote(AuthFormId::Password),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3BucketBlurUp => {
|
||||
assert!(self.app.active(&Id::Protocol).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3BucketBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Region))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3RegionBlurDown => {
|
||||
assert!(self.app.active(&Id::S3Endpoint).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3BucketBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Region)).is_ok());
|
||||
}
|
||||
UiMsg::S3RegionBlurUp => {
|
||||
assert!(self.app.active(&Id::S3Bucket).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3BucketBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3EndpointBlurDown => {
|
||||
assert!(self.app.active(&Id::S3Profile).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3BucketBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Protocol)).is_ok());
|
||||
}
|
||||
UiMsg::S3EndpointBlurUp => {
|
||||
assert!(self.app.active(&Id::S3Region).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3RegionBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Endpoint))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3ProfileBlurDown => {
|
||||
assert!(self.app.active(&Id::S3AccessKey).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3RegionBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Endpoint)).is_ok());
|
||||
}
|
||||
UiMsg::S3ProfileBlurUp => {
|
||||
assert!(self.app.active(&Id::S3Endpoint).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3RegionBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Bucket))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3AccessKeyBlurDown => {
|
||||
assert!(self.app.active(&Id::S3SecretAccessKey).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3RegionBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Bucket)).is_ok());
|
||||
}
|
||||
UiMsg::S3AccessKeyBlurUp => {
|
||||
assert!(self.app.active(&Id::S3Profile).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3EndpointBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Profile))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3SecretAccessKeyBlurDown => {
|
||||
assert!(self.app.active(&Id::S3SecurityToken).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3EndpointBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Profile)).is_ok());
|
||||
}
|
||||
UiMsg::S3SecretAccessKeyBlurUp => {
|
||||
assert!(self.app.active(&Id::S3AccessKey).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3EndpointBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Region))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3SecurityTokenBlurDown => {
|
||||
assert!(self.app.active(&Id::S3SessionToken).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3EndpointBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Region)).is_ok());
|
||||
}
|
||||
UiMsg::S3SecurityTokenBlurUp => {
|
||||
assert!(self.app.active(&Id::S3SecretAccessKey).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3ProfileBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3AccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3SessionTokenBlurDown => {
|
||||
assert!(self.app.active(&Id::S3NewPathStyle).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3ProfileBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3AccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3SessionTokenBlurUp => {
|
||||
assert!(self.app.active(&Id::S3SecurityToken).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3ProfileBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Endpoint))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::S3NewPathStyleBlurDown => {
|
||||
assert!(self.app.active(&Id::RemoteDirectory).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3ProfileBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Endpoint)).is_ok());
|
||||
}
|
||||
UiMsg::S3NewPathStyleBlurUp => {
|
||||
assert!(self.app.active(&Id::S3SessionToken).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3AccessKeyBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3SecretAccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeClientCertBlurDown => {
|
||||
assert!(self.app.active(&Id::KubeClientKey).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3AccessKeyBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3SecretAccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeClientCertBlurUp => {
|
||||
assert!(self.app.active(&Id::KubeUsername).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3AccessKeyBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3Profile))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeClientKeyBlurDown => {
|
||||
assert!(self.app.active(&Id::RemoteDirectory).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3AccessKeyBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::S3Profile)).is_ok());
|
||||
}
|
||||
UiMsg::KubeClientKeyBlurUp => {
|
||||
assert!(self.app.active(&Id::KubeClientCert).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3SecretAccessKeyBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3SecurityToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeNamespaceBlurDown => {
|
||||
assert!(self.app.active(&Id::KubeClusterUrl).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3SecretAccessKeyBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3SecurityToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeNamespaceBlurUp => {
|
||||
assert!(self.app.active(&Id::Protocol).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3SecretAccessKeyBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3AccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeClusterUrlBlurDown => {
|
||||
assert!(self.app.active(&Id::KubeUsername).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3SecretAccessKeyBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3AccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeClusterUrlBlurUp => {
|
||||
assert!(self.app.active(&Id::KubeNamespace).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3SecurityTokenBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3SessionToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeUsernameBlurDown => {
|
||||
assert!(self.app.active(&Id::KubeClientCert).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3SecurityTokenBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3SessionToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::KubeUsernameBlurUp => {
|
||||
assert!(self.app.active(&Id::KubeClusterUrl).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3SecurityTokenBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3SecretAccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::SmbShareBlurDown => {
|
||||
assert!(self.app.active(&Id::Username).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::S3SecurityTokenBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3SecretAccessKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::SmbShareBlurUp => {
|
||||
let id = if cfg!(windows) && self.input_mask() == InputMask::Smb {
|
||||
&Id::Address
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3SessionTokenBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3NewPathStyle))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::S3SessionTokenBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3NewPathStyle))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3SessionTokenBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3SecurityToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::S3SessionTokenBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3SecurityToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3NewPathStyleBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::S3NewPathStyleBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::S3NewPathStyleBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::S3SessionToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::S3NewPathStyleBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::S3SessionToken))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeClientCertBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeClientKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeClientCertBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeClientKey))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeClientCertBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeUsername))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeClientCertBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeUsername))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeClientKeyBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeClientKeyBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeClientKeyBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeClientCert))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeClientKeyBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeClientCert))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeNamespaceBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeClusterUrl))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeNamespaceBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeClusterUrl))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeNamespaceBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeNamespaceBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Protocol)).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeClusterUrlBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeUsername))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeClusterUrlBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeUsername))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeClusterUrlBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeNamespace))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeClusterUrlBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeNamespace))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeUsernameBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeClientCert))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeUsernameBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeClientCert))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::KubeUsernameBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::KubeClusterUrl))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::KubeUsernameBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::KubeClusterUrl))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::SmbShareBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Username))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::SmbShareBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Username)).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::SmbShareBlurUp) => {
|
||||
let id = if cfg!(windows) && self.host_bridge_input_mask() == InputMask::Smb {
|
||||
&Id::HostBridge(AuthFormId::Address)
|
||||
} else {
|
||||
&Id::Port
|
||||
&Id::HostBridge(AuthFormId::Port)
|
||||
};
|
||||
assert!(self.app.active(id).is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::SmbShareBlurUp) => {
|
||||
let id = if cfg!(windows) && self.remote_input_mask() == InputMask::Smb {
|
||||
&Id::Remote(AuthFormId::Address)
|
||||
} else {
|
||||
&Id::Remote(AuthFormId::Port)
|
||||
};
|
||||
assert!(self.app.active(id).is_ok());
|
||||
}
|
||||
#[cfg(unix)]
|
||||
UiMsg::SmbWorkgroupDown => {
|
||||
assert!(self.app.active(&Id::RemoteDirectory).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::SmbWorkgroupDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
#[cfg(unix)]
|
||||
UiMsg::SmbWorkgroupUp => {
|
||||
assert!(self.app.active(&Id::Password).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::SmbWorkgroupDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::Remote(AuthFormId::RemoteDirectory))
|
||||
.is_ok());
|
||||
}
|
||||
#[cfg(unix)]
|
||||
UiMsg::HostBridge(UiAuthFormMsg::SmbWorkgroupUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Password))
|
||||
.is_ok());
|
||||
}
|
||||
#[cfg(unix)]
|
||||
UiMsg::Remote(UiAuthFormMsg::SmbWorkgroupUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Password)).is_ok());
|
||||
}
|
||||
UiMsg::SaveBookmarkPasswordBlur => {
|
||||
assert!(self.app.active(&Id::BookmarkName).is_ok());
|
||||
@@ -361,28 +804,60 @@ impl AuthActivity {
|
||||
self.mount_release_notes();
|
||||
}
|
||||
UiMsg::ShowSaveBookmarkPopup => {
|
||||
self.mount_bookmark_save_dialog();
|
||||
self.mount_bookmark_save_dialog(self.get_current_form_tab());
|
||||
}
|
||||
UiMsg::UsernameBlurDown => {
|
||||
assert!(self.app.active(&Id::Password).is_ok());
|
||||
}
|
||||
UiMsg::UsernameBlurUp => {
|
||||
UiMsg::HostBridge(UiAuthFormMsg::UsernameBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.input_mask() {
|
||||
InputMask::Generic => &Id::Port,
|
||||
InputMask::Smb => &Id::SmbShare,
|
||||
InputMask::Kube => panic!("this shouldn't happen (username on kube)"),
|
||||
InputMask::AwsS3 => panic!("this shouldn't happen (username on s3)"),
|
||||
InputMask::WebDAV => &Id::WebDAVUri,
|
||||
.active(&Id::HostBridge(AuthFormId::Password))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::UsernameBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Password)).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::UsernameBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.host_bridge_input_mask() {
|
||||
InputMask::Localhost => unreachable!(),
|
||||
InputMask::Generic => &Id::HostBridge(AuthFormId::Port),
|
||||
InputMask::Smb => &Id::HostBridge(AuthFormId::SmbShare),
|
||||
InputMask::Kube => unreachable!("this shouldn't happen (username on kube)"),
|
||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (username on s3)"),
|
||||
InputMask::WebDAV => &Id::HostBridge(AuthFormId::WebDAVUri),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::WebDAVUriBlurDown => {
|
||||
assert!(self.app.active(&Id::Username).is_ok());
|
||||
UiMsg::Remote(UiAuthFormMsg::UsernameBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(match self.remote_input_mask() {
|
||||
InputMask::Localhost => unreachable!(),
|
||||
InputMask::Generic => &Id::Remote(AuthFormId::Port),
|
||||
InputMask::Smb => &Id::Remote(AuthFormId::SmbShare),
|
||||
InputMask::Kube => unreachable!("this shouldn't happen (username on kube)"),
|
||||
InputMask::AwsS3 => unreachable!("this shouldn't happen (username on s3)"),
|
||||
InputMask::WebDAV => &Id::Remote(AuthFormId::WebDAVUri),
|
||||
})
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::WebDAVUriBlurUp => {
|
||||
assert!(self.app.active(&Id::Protocol).is_ok());
|
||||
UiMsg::HostBridge(UiAuthFormMsg::WebDAVUriBlurDown) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Username))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::WebDAVUriBlurDown) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Username)).is_ok());
|
||||
}
|
||||
UiMsg::HostBridge(UiAuthFormMsg::WebDAVUriBlurUp) => {
|
||||
assert!(self
|
||||
.app
|
||||
.active(&Id::HostBridge(AuthFormId::Protocol))
|
||||
.is_ok());
|
||||
}
|
||||
UiMsg::Remote(UiAuthFormMsg::WebDAVUriBlurUp) => {
|
||||
assert!(self.app.active(&Id::Remote(AuthFormId::Protocol)).is_ok());
|
||||
}
|
||||
UiMsg::WindowResized => {
|
||||
self.redraw = true;
|
||||
|
||||
Reference in New Issue
Block a user