Adds a per-firmware default-login editor so the operator can set the discovery
credentials each firmware is probed with, rather than a single global pair.
- credentials.rs: a per-firmware store (firmware-credentials.txt, 0600, one
"name<TAB>user<TAB>pass" line per firmware) keyed by the asic-rs firmware
registry's Display name -- the same key the factory uses for
with_firmware_discovery_auth. A firmware_default_creds() table seeds the editor
with each firmware's shipped default (mirrors the asic-rs backends' default_auth
constants; asic-rs does not expose them at the entry level).
- configured_factory() precedence is now: a per-firmware override wins; else the
single global scan credential (unchanged back-compat) applies to every backend;
else the backend's own default_auth. Nothing saved -> plain MinerFactory::new().
- UI: the "Set scan credentials..." dialog gains a "Per-firmware defaults..."
button opening an editor that lists every firmware in the compiled-in registry
(read at runtime, not hard-coded) with editable user/pass fields prefilled from
the saved override or the shipped default. Save persists only rows that differ
from the shipped default (so defaults evolve with asic-rs and the file stays
minimal); Reset to defaults clears all overrides.
Verified under Xvfb: the editor lists all 16 registry firmwares with correct
default logins (AntMiner root/root, WhatsMiner admin/admin, VNish blank/admin,
UMC OS blank/letmein, ...). Round-trip/permissions/precedence covered by a unit
test (folded into the existing HOME-scoped credentials test to avoid a parallel
HOME race); self-test still passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh