Highlight port in red if tunnel failed to open

This commit is contained in:
2025-04-18 14:57:31 +02:00
parent 75bfd4d5cf
commit 95e47c708c
3 changed files with 23 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
use std::pin::Pin;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::task::{Context, Poll};
use pin_project_lite::pin_project;
@@ -14,6 +14,7 @@ pub struct Stats {
connections: AtomicUsize,
rx: AtomicUsize,
tx: AtomicUsize,
failed: AtomicBool,
}
impl Stats {
@@ -33,6 +34,14 @@ impl Stats {
self.connections.load(Ordering::Relaxed)
}
pub fn failed(&self) -> bool {
self.failed.load(Ordering::Relaxed)
}
pub fn set_failed(&self, failed: bool) {
self.failed.store(failed, Ordering::Relaxed);
}
pub fn rx(&self) -> Unit {
Unit::new(self.rx.load(Ordering::Relaxed), "B")
}