From 985ccc6819b646f9d18f0b23f1555b6c92cb4fdd Mon Sep 17 00:00:00 2001 From: John Rogers Date: Mon, 28 Jul 2025 23:39:01 +0100 Subject: [PATCH] fix: Enable std feature for log and remove clock history Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) --- Cargo.toml | 2 +- src/api.rs | 5 ----- static/index.html | 1 - static/script.js | 3 --- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2321b82..b280adf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ actix-web = "4" actix-files = "0.6" tokio = { version = "1", features = ["full"] } clap = { version = "4.4", features = ["derive"] } -log = "0.4" +log = { version = "0.4", features = ["std"] } daemonize = "0.5.0" diff --git a/src/api.rs b/src/api.rs index bdb1278..eb27fb8 100644 --- a/src/api.rs +++ b/src/api.rs @@ -27,7 +27,6 @@ struct ApiStatus { ntp_active: bool, interfaces: Vec, hardware_offset_ms: i64, - clock_delta_history: Vec, } // AppState to hold shared data @@ -79,8 +78,6 @@ async fn get_status(data: web::Data) -> impl Responder { .map(|ifa| ifa.ip().to_string()) .collect(); - let clock_delta_history: Vec = state.clock_delta_history.iter().cloned().collect(); - HttpResponse::Ok().json(ApiStatus { ltc_status, ltc_timecode, @@ -94,7 +91,6 @@ async fn get_status(data: web::Data) -> impl Responder { ntp_active, interfaces, hardware_offset_ms: hw_offset_ms, - clock_delta_history, }) } @@ -233,7 +229,6 @@ mod tests { assert_eq!(resp.ltc_timecode, "01:02:03:04"); assert_eq!(resp.frame_rate, "25.00fps"); assert_eq!(resp.hardware_offset_ms, 10); - assert_eq!(resp.clock_delta_history, vec![4, 5, 6]); } #[actix_web::test] diff --git a/static/index.html b/static/index.html index f4999e0..d5b2670 100644 --- a/static/index.html +++ b/static/index.html @@ -32,7 +32,6 @@

Clock Offset

Delta: -- ms (-- frames)

Jitter: --

-

History (ms): --

diff --git a/static/script.js b/static/script.js index 439d07c..0944f5e 100644 --- a/static/script.js +++ b/static/script.js @@ -10,7 +10,6 @@ document.addEventListener('DOMContentLoaded', () => { deltaMs: document.getElementById('delta-ms'), deltaFrames: document.getElementById('delta-frames'), jitterStatus: document.getElementById('jitter-status'), - deltaHistory: document.getElementById('delta-history'), interfaces: document.getElementById('interfaces'), logs: document.getElementById('logs'), }; @@ -45,8 +44,6 @@ document.addEventListener('DOMContentLoaded', () => { statusElements.jitterStatus.textContent = data.jitter_status; statusElements.jitterStatus.className = data.jitter_status.toLowerCase(); - statusElements.deltaHistory.textContent = data.clock_delta_history.join(', '); - statusElements.interfaces.innerHTML = ''; if (data.interfaces.length > 0) { data.interfaces.forEach(ip => {