Highlight port in red if tunnel failed to open
This commit is contained in:
@@ -40,7 +40,12 @@ impl TunnelInner {
|
||||
&self.internal_address,
|
||||
self.port,
|
||||
)
|
||||
.await?;
|
||||
.await
|
||||
.inspect_err(|_| {
|
||||
self.stats.set_failed(true);
|
||||
})?;
|
||||
|
||||
self.stats.set_failed(false);
|
||||
|
||||
Ok(TrackStats::new(channel.into_stream(), self.stats.clone()))
|
||||
}
|
||||
|
||||
@@ -17,9 +17,15 @@ pub struct TunnelRow {
|
||||
|
||||
impl From<&TunnelRow> for Vec<Span<'static>> {
|
||||
fn from(row: &TunnelRow) -> Self {
|
||||
let port = if row.stats.failed() {
|
||||
row.port.clone().red()
|
||||
} else {
|
||||
row.port.clone()
|
||||
};
|
||||
|
||||
vec![
|
||||
row.name.clone(),
|
||||
row.port.clone(),
|
||||
port,
|
||||
row.access.clone(),
|
||||
row.address.clone(),
|
||||
row.stats.connections().to_string().into(),
|
||||
|
||||
Reference in New Issue
Block a user