remote: Polish for connection progress & error dialogs (#19379)
Before/after:   Before/after (I feel like text-wrapping would be more useful than text-ellipsis here, but I don't see any wrap function):   Before/after:   Release Notes: - N/A
This commit is contained in:
parent
34b8655bf6
commit
2db9090a2f
2 changed files with 10 additions and 6 deletions
|
@ -175,7 +175,7 @@ impl Render for SshPrompt {
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.p_2()
|
.p_2()
|
||||||
.flex_wrap()
|
.flex()
|
||||||
.child(if self.error_message.is_some() {
|
.child(if self.error_message.is_some() {
|
||||||
Icon::new(IconName::XCircle)
|
Icon::new(IconName::XCircle)
|
||||||
.size(IconSize::Medium)
|
.size(IconSize::Medium)
|
||||||
|
@ -195,6 +195,7 @@ impl Render for SshPrompt {
|
||||||
})
|
})
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
|
.ml_1()
|
||||||
.text_ellipsis()
|
.text_ellipsis()
|
||||||
.overflow_x_hidden()
|
.overflow_x_hidden()
|
||||||
.when_some(self.error_message.as_ref(), |el, error| {
|
.when_some(self.error_message.as_ref(), |el, error| {
|
||||||
|
@ -205,7 +206,7 @@ impl Render for SshPrompt {
|
||||||
|el| {
|
|el| {
|
||||||
el.child(
|
el.child(
|
||||||
Label::new(format!(
|
Label::new(format!(
|
||||||
"-{}…",
|
"{}…",
|
||||||
self.status_message.clone().unwrap()
|
self.status_message.clone().unwrap()
|
||||||
))
|
))
|
||||||
.size(LabelSize::Small),
|
.size(LabelSize::Small),
|
||||||
|
|
|
@ -1321,7 +1321,10 @@ impl SshRemoteConnection {
|
||||||
let mut stderr = master_process.stderr.take().unwrap();
|
let mut stderr = master_process.stderr.take().unwrap();
|
||||||
stderr.read_to_end(&mut output).await?;
|
stderr.read_to_end(&mut output).await?;
|
||||||
|
|
||||||
let error_message = format!("failed to connect: {}", String::from_utf8_lossy(&output));
|
let error_message = format!(
|
||||||
|
"failed to connect: {}",
|
||||||
|
String::from_utf8_lossy(&output).trim()
|
||||||
|
);
|
||||||
delegate.set_error(error_message.clone(), cx);
|
delegate.set_error(error_message.clone(), cx);
|
||||||
Err(anyhow!(error_message))?;
|
Err(anyhow!(error_message))?;
|
||||||
}
|
}
|
||||||
|
@ -1382,14 +1385,14 @@ impl SshRemoteConnection {
|
||||||
let server_mode = 0o755;
|
let server_mode = 0o755;
|
||||||
|
|
||||||
let t0 = Instant::now();
|
let t0 = Instant::now();
|
||||||
delegate.set_status(Some("uploading remote development server"), cx);
|
delegate.set_status(Some("Uploading remote development server"), cx);
|
||||||
log::info!("uploading remote development server ({}kb)", size / 1024);
|
log::info!("uploading remote development server ({}kb)", size / 1024);
|
||||||
self.upload_file(&src_path, &dst_path_gz)
|
self.upload_file(&src_path, &dst_path_gz)
|
||||||
.await
|
.await
|
||||||
.context("failed to upload server binary")?;
|
.context("failed to upload server binary")?;
|
||||||
log::info!("uploaded remote development server in {:?}", t0.elapsed());
|
log::info!("uploaded remote development server in {:?}", t0.elapsed());
|
||||||
|
|
||||||
delegate.set_status(Some("extracting remote development server"), cx);
|
delegate.set_status(Some("Extracting remote development server"), cx);
|
||||||
run_cmd(
|
run_cmd(
|
||||||
self.socket
|
self.socket
|
||||||
.ssh_command("gunzip")
|
.ssh_command("gunzip")
|
||||||
|
@ -1398,7 +1401,7 @@ impl SshRemoteConnection {
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
delegate.set_status(Some("unzipping remote development server"), cx);
|
delegate.set_status(Some("Marking remote development server executable"), cx);
|
||||||
run_cmd(
|
run_cmd(
|
||||||
self.socket
|
self.socket
|
||||||
.ssh_command("chmod")
|
.ssh_command("chmod")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue