feat(v1): settings camera connection test and preview

Settings tab gains a camera group (host/port/channel/user/masked password),
a background connection-test worker that probes one frame off the GUI
thread and shows it in a preview, and a save button that writes the
structured source to the untracked config.local.json. 60 tests pass;
Qt shell compiles and needs a Windows smoke.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ila
2026-07-21 22:44:09 +08:00
co-authored by Claude Opus 4.8
parent edf8a9a94e
commit 2603a10fb1
8 changed files with 218 additions and 11 deletions
+22
View File
@@ -107,6 +107,28 @@ def test_structured_credentials_are_excluded_from_config_version(tmp_path):
assert first.runtime_config_version == second.runtime_config_version
def test_write_local_camera_source_round_trips_through_load_config(tmp_path):
from v1.config import write_local_camera_source
config_file = tmp_path / "config.local.json"
_write_config(config_file, {"id": "seed", "rtsp_url_env": "SILVER_POSE_RTSP_URL"})
write_local_camera_source(
config_file,
source_id="hik",
host="192.0.2.10",
port=554,
channel="102",
username="admin",
password="p@ss/w:d",
)
config = load_config(config_file)
assert config.source_url == "rtsp://admin:p%40ss%2Fw%3Ad@192.0.2.10:554/Streaming/Channels/102"
assert config.source_mode == "stream"
assert config.source_id == "hik"
def test_public_example_config_has_no_embedded_credentials():
from pathlib import Path