Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d93260529b | |||
| 41e1be451e |
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.255"
|
version = "0.1.257"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -301,7 +301,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.255"
|
version = "0.1.257"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -325,7 +325,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.255"
|
version = "0.1.257"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.256"
|
version = "0.1.258"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -178,6 +178,18 @@ impl SystemdCollector {
|
|||||||
service_type: "torrent_stats".to_string(),
|
service_type: "torrent_stats".to_string(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add active torrent copy status
|
||||||
|
if let Some(torrent_name) = self.get_active_torrent_copy() {
|
||||||
|
let metrics = Vec::new();
|
||||||
|
|
||||||
|
sub_services.push(SubServiceData {
|
||||||
|
name: format!("Copy: {}", torrent_name),
|
||||||
|
service_status: Status::Info,
|
||||||
|
metrics,
|
||||||
|
service_type: "torrent_copy".to_string(),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if service_name == "nftables" && status_info.active_state == "active" {
|
if service_name == "nftables" && status_info.active_state == "active" {
|
||||||
@@ -186,7 +198,7 @@ impl SystemdCollector {
|
|||||||
if !tcp_ports.is_empty() {
|
if !tcp_ports.is_empty() {
|
||||||
let metrics = Vec::new();
|
let metrics = Vec::new();
|
||||||
sub_services.push(SubServiceData {
|
sub_services.push(SubServiceData {
|
||||||
name: format!("TCP: {}", tcp_ports),
|
name: format!("wan tcp: {}", tcp_ports),
|
||||||
service_status: Status::Info,
|
service_status: Status::Info,
|
||||||
metrics,
|
metrics,
|
||||||
service_type: "firewall_port".to_string(),
|
service_type: "firewall_port".to_string(),
|
||||||
@@ -196,7 +208,7 @@ impl SystemdCollector {
|
|||||||
if !udp_ports.is_empty() {
|
if !udp_ports.is_empty() {
|
||||||
let metrics = Vec::new();
|
let metrics = Vec::new();
|
||||||
sub_services.push(SubServiceData {
|
sub_services.push(SubServiceData {
|
||||||
name: format!("UDP: {}", udp_ports),
|
name: format!("wan udp: {}", udp_ports),
|
||||||
service_status: Status::Info,
|
service_status: Status::Info,
|
||||||
metrics,
|
metrics,
|
||||||
service_type: "firewall_port".to_string(),
|
service_type: "firewall_port".to_string(),
|
||||||
@@ -1088,6 +1100,18 @@ impl SystemdCollector {
|
|||||||
|
|
||||||
Some((active_count, download_mbps, upload_mbps))
|
Some((active_count, download_mbps, upload_mbps))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Check if torrent copy script is actively running
|
||||||
|
/// Returns: Some(torrent_name) if copy is in progress, None otherwise
|
||||||
|
fn get_active_torrent_copy(&self) -> Option<String> {
|
||||||
|
let marker_path = "/tmp/torrent-copy-active";
|
||||||
|
|
||||||
|
// Check if marker file exists and read torrent name
|
||||||
|
std::fs::read_to_string(marker_path)
|
||||||
|
.ok()
|
||||||
|
.map(|content| content.trim().to_string())
|
||||||
|
.filter(|name| !name.is_empty())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.256"
|
version = "0.1.258"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -556,7 +556,14 @@ impl TuiApp {
|
|||||||
));
|
));
|
||||||
|
|
||||||
if Some(host) == self.current_host.as_ref() {
|
if Some(host) == self.current_host.as_ref() {
|
||||||
// Selected host in bold background color against status background
|
// Selected host with brackets in bold background color against status background
|
||||||
|
host_spans.push(Span::styled(
|
||||||
|
"[",
|
||||||
|
Style::default()
|
||||||
|
.fg(Theme::background())
|
||||||
|
.bg(background_color)
|
||||||
|
.add_modifier(Modifier::BOLD),
|
||||||
|
));
|
||||||
host_spans.push(Span::styled(
|
host_spans.push(Span::styled(
|
||||||
host.clone(),
|
host.clone(),
|
||||||
Style::default()
|
Style::default()
|
||||||
@@ -564,6 +571,13 @@ impl TuiApp {
|
|||||||
.bg(background_color)
|
.bg(background_color)
|
||||||
.add_modifier(Modifier::BOLD),
|
.add_modifier(Modifier::BOLD),
|
||||||
));
|
));
|
||||||
|
host_spans.push(Span::styled(
|
||||||
|
"]",
|
||||||
|
Style::default()
|
||||||
|
.fg(Theme::background())
|
||||||
|
.bg(background_color)
|
||||||
|
.add_modifier(Modifier::BOLD),
|
||||||
|
));
|
||||||
} else {
|
} else {
|
||||||
// Other hosts in normal background color against status background
|
// Other hosts in normal background color against status background
|
||||||
host_spans.push(Span::styled(
|
host_spans.push(Span::styled(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.256"
|
version = "0.1.258"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user