feat(v2): T-309 test-connection button with result popup

Adds a 测试连接摄像头 button next to save; it builds the RTSP URL from the
current form fields and runs ffprobe (8s timeout) off the UI thread, then
shows a result popup (success WxH@fps, or a redacted failure). Exports
config.BuildRTSPURL and source.Probe/Redact for it. Cross-compiles for
Windows; config/source tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ila
2026-07-23 22:05:52 +08:00
co-authored by Claude Opus 4.8
parent aced262f6b
commit 4b7dfc2db6
4 changed files with 138 additions and 6 deletions
+6
View File
@@ -199,6 +199,12 @@ func waitContext(ctx context.Context, duration time.Duration) error {
}
}
// Probe attempts to read stream metadata once, for a settings "test connection".
func Probe(ctx context.Context, config Config) (Metadata, error) { return probe(ctx, config) }
// Redact removes the source URL/credentials from text for safe display.
func Redact(text, sourceURL string) string { return redact(text, sourceURL) }
func probe(ctx context.Context, config Config) (Metadata, error) {
if strings.TrimSpace(config.FFprobePath) == "" {
return Metadata{}, errors.New("FFprobe executable is not configured")