The miner now serves a single page that polls /api/hardware and shows profile, chip, PSU, operating point, chains and EEPROM state, active chains, target and whether hashing stopped. The page is a convenience; the API routes it uses are the interface of record, so a JSON-only client loses nothing. No framework and no new dependency: the request parser is bounded, only GET is accepted, responses close the connection and are not cached. MiningStatus now exposes its hardware and summary documents so the UI and the cgminer-style server build them once, in one place.
This commit is contained in:
@@ -60,6 +60,16 @@ impl MiningStatus {
|
||||
}
|
||||
}
|
||||
|
||||
/// The `hardware` document, for the on-box UI and local clients.
|
||||
pub fn hardware_document(&self) -> Value {
|
||||
hardware_json(self.hardware())
|
||||
}
|
||||
|
||||
/// The `summary` document, for the on-box UI and local clients.
|
||||
pub fn summary_document(&self) -> Value {
|
||||
self.response("summary")
|
||||
}
|
||||
|
||||
fn hardware(&self) -> Option<HardwareSnapshot> {
|
||||
self.hardware.lock().ok().and_then(|slot| slot.clone())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user