mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 10:22:02 +00:00
Merge pull request #23 from cjfranko/update-ui
Some checks failed
Build for Raspberry Pi / Build for aarch64 (push) Failing after 17s
Some checks failed
Build for Raspberry Pi / Build for aarch64 (push) Failing after 17s
updated UI elements
This commit is contained in:
commit
91f8f7dc96
2 changed files with 6 additions and 8 deletions
|
|
@ -160,11 +160,9 @@ impl LtcState {
|
|||
pub fn get_sync_status(delta_ms: i64, config: &Config) -> &'static str {
|
||||
if config.timeturner_offset.is_active() {
|
||||
"TIMETURNING"
|
||||
} else if config.auto_sync_enabled {
|
||||
"TIME LOCK ACTIVE"
|
||||
} else if delta_ms.abs() <= 8 {
|
||||
} else if delta_ms.abs() <= 1 {
|
||||
"IN SYNC"
|
||||
} else if delta_ms > 10 {
|
||||
} else if delta_ms > 2 {
|
||||
"CLOCK AHEAD"
|
||||
} else {
|
||||
"CLOCK BEHIND"
|
||||
|
|
@ -350,8 +348,8 @@ mod tests {
|
|||
assert_eq!(get_sync_status(-100, &config), "CLOCK BEHIND");
|
||||
|
||||
// Test auto-sync status
|
||||
config.auto_sync_enabled = true;
|
||||
assert_eq!(get_sync_status(0, &config), "TIME LOCK ACTIVE");
|
||||
// config.auto_sync_enabled = true;
|
||||
// assert_eq!(get_sync_status(0, &config), "IN SYNC");
|
||||
|
||||
// Test TIMETURNING status takes precedence
|
||||
config.timeturner_offset = TimeturnerOffset { hours: 1, minutes: 0, seconds: 0, frames: 0, milliseconds: 0 };
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
<!-- LTC Status -->
|
||||
<div class="card">
|
||||
<h2>LTC Status</h2>
|
||||
<p id="ltc-status">--</p>
|
||||
<p id="ltc-timecode">--:--:--:--</p>
|
||||
<p id="ltc-status">--</p>
|
||||
<p id="frame-rate">-- fps</p>
|
||||
<p>Lock Ratio: <span id="lock-ratio">--</span>%</p>
|
||||
</div>
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
</div>
|
||||
<div class="control-group">
|
||||
<label for="date-input">Set System Date:</label>
|
||||
<input type="date" id="date-input">
|
||||
<input type="text" id="date-input" placeholder="YYYY-MM-DD" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}">
|
||||
<button id="set-date">Set Date</button>
|
||||
<span id="date-message"></span>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue