Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7feab6117b | ||
|
|
808fd4de1d |
@@ -11,6 +11,9 @@ jobs:
|
|||||||
runs-on: alkane-ci
|
runs-on: alkane-ci
|
||||||
env:
|
env:
|
||||||
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
||||||
|
# Set once for the whole job so build/clippy/test/bench steps don't each
|
||||||
|
# re-export it (round 18 #12).
|
||||||
|
WX_RS_WXCONFIG: /root/.cache/wx-3.3.3-linux/bin/wx-config
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (full history for tags)
|
- name: Checkout (full history for tags)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -52,7 +55,6 @@ jobs:
|
|||||||
- name: Clippy (our crate, warnings are errors)
|
- name: Clippy (our crate, warnings are errors)
|
||||||
if: steps.ver.outputs.release == 'true'
|
if: steps.ver.outputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
||||||
rustup component add clippy >/dev/null 2>&1 || true
|
rustup component add clippy >/dev/null 2>&1 || true
|
||||||
cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings
|
cargo clippy -p alkane-gui --no-deps --release --bins --offline -- -D warnings
|
||||||
|
|
||||||
@@ -65,19 +67,16 @@ jobs:
|
|||||||
- name: Build release
|
- name: Build release
|
||||||
if: steps.ver.outputs.release == 'true'
|
if: steps.ver.outputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
||||||
cargo build --release -p alkane-gui --offline
|
cargo build --release -p alkane-gui --offline
|
||||||
|
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
if: steps.ver.outputs.release == 'true'
|
if: steps.ver.outputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
||||||
cargo test -p alkane-gui --offline
|
cargo test -p alkane-gui --offline
|
||||||
|
|
||||||
- name: Microbenchmarks
|
- name: Microbenchmarks
|
||||||
if: steps.ver.outputs.release == 'true'
|
if: steps.ver.outputs.release == 'true'
|
||||||
run: |
|
run: |
|
||||||
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
||||||
cargo test -p alkane-gui --release --offline -- --ignored --nocapture bench_
|
cargo test -p alkane-gui --release --offline -- --ignored --nocapture bench_
|
||||||
|
|
||||||
- name: Headless UI self-test
|
- name: Headless UI self-test
|
||||||
@@ -108,7 +107,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
||||||
PASS=$(cargo test -p alkane-gui --offline 2>&1 \
|
PASS=$(cargo test -p alkane-gui --offline 2>&1 \
|
||||||
| grep -hoE '[0-9]+ passed' | grep -oE '[0-9]+' | awk '{s+=$1} END{print s+0}')
|
| grep -hoE '[0-9]+ passed' | grep -oE '[0-9]+' | awk '{s+=$1} END{print s+0}')
|
||||||
python3 ci/gen-badges.py --tests "${PASS:-0}" --bench "row-render + scan-parse"
|
python3 ci/gen-badges.py --tests "${PASS:-0}" --bench "row-render + scan-parse"
|
||||||
|
|||||||
+12
@@ -19,3 +19,15 @@ license = "MIT OR Apache-2.0"
|
|||||||
thiserror = "2"
|
thiserror = "2"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
sha2 = "0.10"
|
sha2 = "0.10"
|
||||||
|
|
||||||
|
# Release binary: small, self-contained, and fast enough for a fleet GUI whose
|
||||||
|
# hot path is network I/O, not CPU (round 18 #12). opt-level "s" + fat LTO +
|
||||||
|
# one codegen unit + symbol stripping cut the binary substantially. panic stays
|
||||||
|
# "unwind" on purpose: the scan runs many miners on tokio tasks and the wx event
|
||||||
|
# dispatch relies on unwinding so one miner's panic never aborts the whole app.
|
||||||
|
[profile.release]
|
||||||
|
opt-level = "s"
|
||||||
|
lto = "fat"
|
||||||
|
codegen-units = 1
|
||||||
|
strip = true
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 36%">
|
<svg xmlns="http://www.w3.org/2000/svg" width="95.5" height="20" role="img" aria-label="coverage: 35%">
|
||||||
<title>coverage: 36%</title>
|
<title>coverage: 35%</title>
|
||||||
<linearGradient id="s" x2="0" y2="100%">
|
<linearGradient id="s" x2="0" y2="100%">
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||||
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
<text x="32.0" y="15" fill="#010101" fill-opacity=".3">coverage</text>
|
||||||
<text x="32.0" y="14">coverage</text>
|
<text x="32.0" y="14">coverage</text>
|
||||||
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">36%</text>
|
<text x="79.8" y="15" fill="#010101" fill-opacity=".3">35%</text>
|
||||||
<text x="79.8" y="14">36%</text>
|
<text x="79.8" y="14">35%</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 919 B |
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="141.0" height="20" role="img" aria-label="lines of code: 12.5k">
|
<svg xmlns="http://www.w3.org/2000/svg" width="141.0" height="20" role="img" aria-label="lines of code: 13.2k">
|
||||||
<title>lines of code: 12.5k</title>
|
<title>lines of code: 13.2k</title>
|
||||||
<linearGradient id="s" x2="0" y2="100%">
|
<linearGradient id="s" x2="0" y2="100%">
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||||
<text x="48.2" y="15" fill="#010101" fill-opacity=".3">lines of code</text>
|
<text x="48.2" y="15" fill="#010101" fill-opacity=".3">lines of code</text>
|
||||||
<text x="48.2" y="14">lines of code</text>
|
<text x="48.2" y="14">lines of code</text>
|
||||||
<text x="118.8" y="15" fill="#010101" fill-opacity=".3">12.5k</text>
|
<text x="118.8" y="15" fill="#010101" fill-opacity=".3">13.2k</text>
|
||||||
<text x="118.8" y="14">12.5k</text>
|
<text x="118.8" y="14">13.2k</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 952 B |
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" width="121.5" height="20" role="img" aria-label="tests: 94 passing">
|
<svg xmlns="http://www.w3.org/2000/svg" width="121.5" height="20" role="img" aria-label="tests: 99 passing">
|
||||||
<title>tests: 94 passing</title>
|
<title>tests: 99 passing</title>
|
||||||
<linearGradient id="s" x2="0" y2="100%">
|
<linearGradient id="s" x2="0" y2="100%">
|
||||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
<stop offset="1" stop-opacity=".1"/>
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||||
<text x="22.2" y="15" fill="#010101" fill-opacity=".3">tests</text>
|
<text x="22.2" y="15" fill="#010101" fill-opacity=".3">tests</text>
|
||||||
<text x="22.2" y="14">tests</text>
|
<text x="22.2" y="14">tests</text>
|
||||||
<text x="83.0" y="15" fill="#010101" fill-opacity=".3">94 passing</text>
|
<text x="83.0" y="15" fill="#010101" fill-opacity=".3">99 passing</text>
|
||||||
<text x="83.0" y="14">94 passing</text>
|
<text x="83.0" y="14">99 passing</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 935 B |
@@ -2,9 +2,10 @@
|
|||||||
# Compute the next release version for alkane-toolkit from the latest release
|
# Compute the next release version for alkane-toolkit from the latest release
|
||||||
# tag and the paths changed since it. Version scheme X.Y.Z:
|
# tag and the paths changed since it. Version scheme X.Y.Z:
|
||||||
# X - major, bumped manually (ci/version-x.txt); a bump resets Y.Z to 0.0
|
# X - major, bumped manually (ci/version-x.txt); a bump resets Y.Z to 0.0
|
||||||
# Y - backend-logic changes (core/discovery/access/flash/artifacts/cli,
|
# Y - backend-logic changes (the alkane-* crates and any GUI crate source
|
||||||
# scan+model+main in the GUI crate, build/CI config); resets Z to 0
|
# other than the view files below, plus vendored deps and build/CI config);
|
||||||
# Z - UI changes (the GUI view + fixtures + the wx-rs widget bridge)
|
# resets Z to 0
|
||||||
|
# Z - UI changes (the GUI view: ui.rs + fixtures.rs + bin/ + the wx-rs bridge)
|
||||||
# When both backend and UI changed, backend wins (bump Y). Docs-only changes
|
# When both backend and UI changed, backend wins (bump Y). Docs-only changes
|
||||||
# produce no release.
|
# produce no release.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -647,6 +647,10 @@ pub struct App {
|
|||||||
// the first time fill_rows runs with rows present, so the default widths fit
|
// the first time fill_rows runs with rows present, so the default widths fit
|
||||||
// their contents (capped) once and manual resizes afterwards are preserved.
|
// their contents (capped) once and manual resizes afterwards are preserved.
|
||||||
columns_autosized: bool,
|
columns_autosized: bool,
|
||||||
|
// Set when a scan streamed new rows this drain; flushed by tick() at most once
|
||||||
|
// per second (or immediately once the scan ends) so the full table refill runs
|
||||||
|
// ~1 Hz during a scan instead of every fast tick (round 18 #12).
|
||||||
|
rows_dirty: bool,
|
||||||
// The columns the wxDataViewCtrl was actually built with, in creation order.
|
// The columns the wxDataViewCtrl was actually built with, in creation order.
|
||||||
// fill_rows/header_click/reorder index the widget through table_columns() and
|
// fill_rows/header_click/reorder index the widget through table_columns() and
|
||||||
// assume it stays in lockstep; with auto-hide-empty on, a scan can change which
|
// assume it stays in lockstep; with auto-hide-empty on, a scan can change which
|
||||||
@@ -709,6 +713,10 @@ pub struct App {
|
|||||||
// IPs the current config action targets, re-probed after it completes so the
|
// IPs the current config action targets, re-probed after it completes so the
|
||||||
// table reflects the change (e.g. the identify light toggling).
|
// table reflects the change (e.g. the identify light toggling).
|
||||||
action_targets: Vec<String>,
|
action_targets: Vec<String>,
|
||||||
|
// A new password from an in-flight ChangePassword action, applied to the saved
|
||||||
|
// credentials once the action succeeds so the toolkit keeps reaching the miners
|
||||||
|
// it just changed (round 18 #12).
|
||||||
|
pending_password_update: Option<String>,
|
||||||
// Per-miner in-flight operation label (round 14 #4): while a miner has an
|
// Per-miner in-flight operation label (round 14 #4): while a miner has an
|
||||||
// operation running (refresh, config action, light, firmware, restore, access
|
// operation running (refresh, config action, light, firmware, restore, access
|
||||||
// check), its Health cell shows this text instead of the component icons.
|
// check), its Health cell shows this text instead of the component icons.
|
||||||
@@ -1022,6 +1030,7 @@ pub fn build(frame: Widget) -> App {
|
|||||||
progress,
|
progress,
|
||||||
table: None,
|
table: None,
|
||||||
columns_autosized: false,
|
columns_autosized: false,
|
||||||
|
rows_dirty: false,
|
||||||
built_columns: Vec::new(),
|
built_columns: Vec::new(),
|
||||||
table_parent,
|
table_parent,
|
||||||
root_sizer: root,
|
root_sizer: root,
|
||||||
@@ -1053,6 +1062,7 @@ pub fn build(frame: Widget) -> App {
|
|||||||
action_total: 0,
|
action_total: 0,
|
||||||
action_done: 0,
|
action_done: 0,
|
||||||
action_targets: Vec::new(),
|
action_targets: Vec::new(),
|
||||||
|
pending_password_update: None,
|
||||||
op_status: std::collections::HashMap::new(),
|
op_status: std::collections::HashMap::new(),
|
||||||
confirm_dialog: frame,
|
confirm_dialog: frame,
|
||||||
pending_confirm: None,
|
pending_confirm: None,
|
||||||
@@ -1836,13 +1846,17 @@ impl App {
|
|||||||
wx_rs::set_status_text("firmware flash in progress -- wait for it to finish");
|
wx_rs::set_status_text("firmware flash in progress -- wait for it to finish");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// A restore-to-stock is reverting + rebooting miners; writing pools mid-
|
// This path sets self.action directly, so it needs start_action's full
|
||||||
// revert could hit a unit in an undefined state (round 18 #12 -- this path
|
// exclusivity guard: don't write pools during a restore or a live scan
|
||||||
// sets self.action directly, so it needs the same guard as start_action).
|
// (round 18 #12).
|
||||||
if self.restore.is_some() {
|
if self.restore.is_some() {
|
||||||
wx_rs::set_status_text("restore-to-stock in progress -- wait for it to finish");
|
wx_rs::set_status_text("restore-to-stock in progress -- wait for it to finish");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if self.scanning {
|
||||||
|
wx_rs::set_status_text("scan in progress -- wait for it to finish");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Collect the raw rows: (address, account, worker_template, password).
|
// Collect the raw rows: (address, account, worker_template, password).
|
||||||
let mut rows: Vec<(String, String, String, String)> = Vec::new();
|
let mut rows: Vec<(String, String, String, String)> = Vec::new();
|
||||||
for row in 0..3usize {
|
for row in 0..3usize {
|
||||||
@@ -1920,6 +1934,14 @@ impl App {
|
|||||||
wx_rs::set_status_text("restore-to-stock in progress -- wait for it to finish");
|
wx_rs::set_status_text("restore-to-stock in progress -- wait for it to finish");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// A scan is opening its own connections to these same miners; a mutating
|
||||||
|
// action racing the scan's probe traffic can be dropped or interleaved, so
|
||||||
|
// hold it until the scan finishes (round 18 #12 -- matches the flash/restore
|
||||||
|
// invariant).
|
||||||
|
if self.scanning {
|
||||||
|
wx_rs::set_status_text("scan in progress -- wait for it to finish");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Some(old) = self.action.take() {
|
if let Some(old) = self.action.take() {
|
||||||
old.stop();
|
old.stop();
|
||||||
// The superseded action's drain will never run again, so clear its
|
// The superseded action's drain will never run again, so clear its
|
||||||
@@ -1934,6 +1956,13 @@ impl App {
|
|||||||
// line; the bottom-right indicator still surfaces failures at the end.
|
// line; the bottom-right indicator still surfaces failures at the end.
|
||||||
crate::logs::log(format!("apply {} to {} miner(s)", action.label(), ips.len()));
|
crate::logs::log(format!("apply {} to {} miner(s)", action.label(), ips.len()));
|
||||||
self.action_targets = ips.clone();
|
self.action_targets = ips.clone();
|
||||||
|
// Remember a password change so we can update our own saved credentials
|
||||||
|
// once it succeeds -- otherwise the toolkit keeps using the old password
|
||||||
|
// and locks itself out of the miners it just changed (round 18 #12).
|
||||||
|
self.pending_password_update = match &action {
|
||||||
|
scan::ConfigAction::ChangePassword(p) => Some(p.clone()),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
self.set_op_status(&ips, &action.progress_label());
|
self.set_op_status(&ips, &action.progress_label());
|
||||||
self.action = Some(scan::start_config_action(ips, action));
|
self.action = Some(scan::start_config_action(ips, action));
|
||||||
// Clear any stale error/warning from a previous operation; the new
|
// Clear any stale error/warning from a previous operation; the new
|
||||||
@@ -2238,7 +2267,10 @@ impl App {
|
|||||||
Ok(scan::AccessProbeMsg::Result { ip, locked, error }) => {
|
Ok(scan::AccessProbeMsg::Result { ip, locked, error }) => {
|
||||||
op_clear.push(ip.clone());
|
op_clear.push(ip.clone());
|
||||||
if let Some(r) = self.rows.iter_mut().find(|r| r.ip == ip) {
|
if let Some(r) = self.rows.iter_mut().find(|r| r.ip == ip) {
|
||||||
if error.is_none() {
|
// Only a definitive answer updates the cell; an indeterminate
|
||||||
|
// probe (locked = None) must not blank a previously-known
|
||||||
|
// locked/unlocked state (round 18 #12).
|
||||||
|
if error.is_none() && locked.is_some() {
|
||||||
r.write_locked = locked;
|
r.write_locked = locked;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
@@ -2866,6 +2898,13 @@ impl App {
|
|||||||
for (name, user_ctrl, pass_ctrl) in &self.fwcreds_rows {
|
for (name, user_ctrl, pass_ctrl) in &self.fwcreds_rows {
|
||||||
let user = user_ctrl.get_value();
|
let user = user_ctrl.get_value();
|
||||||
let pass = pass_ctrl.get_value();
|
let pass = pass_ctrl.get_value();
|
||||||
|
// A fully-blank row means "no override, use the shipped default" -- the
|
||||||
|
// natural way to clear one firmware's override. Without this, a blanked
|
||||||
|
// row was saved as an explicit ("","") override that then broke auth
|
||||||
|
// fleet-wide for that firmware (round 18 #12).
|
||||||
|
if user.trim().is_empty() && pass.trim().is_empty() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
let default = credentials::firmware_default_for(name);
|
let default = credentials::firmware_default_for(name);
|
||||||
if (user.clone(), pass.clone()) != default {
|
if (user.clone(), pass.clone()) != default {
|
||||||
map.insert(name.clone(), (user, pass));
|
map.insert(name.clone(), (user, pass));
|
||||||
@@ -2942,6 +2981,34 @@ impl App {
|
|||||||
} else {
|
} else {
|
||||||
Some((false, format!("apply: {}/{total} miner(s) failed", total - ok)))
|
Some((false, format!("apply: {}/{total} miner(s) failed", total - ok)))
|
||||||
});
|
});
|
||||||
|
// A password change succeeded on every target: update our own
|
||||||
|
// saved global credential so the toolkit keeps reaching them. On
|
||||||
|
// a partial change we leave saved creds alone (we can't tell which
|
||||||
|
// password now works for which miner) and warn (round 18 #12).
|
||||||
|
// (self.pending_password_update is a different field than self.action,
|
||||||
|
// so this disjoint borrow is fine while `h` still holds self.action.)
|
||||||
|
if let Some(newpass) = self.pending_password_update.take() {
|
||||||
|
if ok == total && total > 0 {
|
||||||
|
let user = credentials::load_credentials()
|
||||||
|
.map(|(u, _)| u)
|
||||||
|
.unwrap_or_else(|| "root".into());
|
||||||
|
match credentials::save_credentials(&user, &newpass) {
|
||||||
|
Ok(()) => crate::logs::log(
|
||||||
|
"saved credentials updated to the new password".to_string(),
|
||||||
|
),
|
||||||
|
Err(e) => crate::logs::log(format!(
|
||||||
|
"could not update saved credentials after password change: {e}"
|
||||||
|
)),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
crate::logs::log(
|
||||||
|
"password change was partial -- saved credentials left unchanged; \
|
||||||
|
update Settings > Credentials manually so the toolkit can reach \
|
||||||
|
the changed miners"
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
finished = true;
|
finished = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3127,7 +3194,15 @@ impl App {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if changed {
|
if changed {
|
||||||
self.fill_rows();
|
if self.scanning {
|
||||||
|
// Still scanning: defer the whole-table refill to tick()'s ~1 Hz
|
||||||
|
// flush so streaming rows don't trigger a refill on every fast tick
|
||||||
|
// (round 18 #12).
|
||||||
|
self.rows_dirty = true;
|
||||||
|
} else {
|
||||||
|
// The scan just ended (or wasn't running): show the final state now.
|
||||||
|
self.fill_rows();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3147,6 +3222,13 @@ impl App {
|
|||||||
// auto-rescan scheduler + idle status only need ~1 Hz, so run them once
|
// auto-rescan scheduler + idle status only need ~1 Hz, so run them once
|
||||||
// per second.
|
// per second.
|
||||||
self.tick_accum = self.tick_accum.wrapping_add(1);
|
self.tick_accum = self.tick_accum.wrapping_add(1);
|
||||||
|
// Flush a scan's batched row updates at most once per second (or right away
|
||||||
|
// once the scan has ended), so the whole-table refill runs ~1 Hz during a
|
||||||
|
// scan rather than on every fast tick (round 18 #12).
|
||||||
|
if self.rows_dirty && (!self.scanning || self.tick_accum.is_multiple_of(TICKS_PER_SEC)) {
|
||||||
|
self.rows_dirty = false;
|
||||||
|
self.fill_rows();
|
||||||
|
}
|
||||||
if !self.tick_accum.is_multiple_of(TICKS_PER_SEC) {
|
if !self.tick_accum.is_multiple_of(TICKS_PER_SEC) {
|
||||||
return to_show;
|
return to_show;
|
||||||
}
|
}
|
||||||
@@ -3194,6 +3276,13 @@ impl App {
|
|||||||
wx_rs::set_status_text("firmware flash in progress -- scan deferred");
|
wx_rs::set_status_text("firmware flash in progress -- scan deferred");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Symmetric to start_action's scan guard: don't start a scan (including an
|
||||||
|
// auto-rescan) while a config action or restore is writing to miners, so
|
||||||
|
// the two never race on the same unit (round 18 #12).
|
||||||
|
if self.action.is_some() || self.restore.is_some() {
|
||||||
|
wx_rs::set_status_text("operation in progress -- scan deferred");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if let Some(old) = self.scan.take() {
|
if let Some(old) = self.scan.take() {
|
||||||
old.stop();
|
old.stop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user