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:
@@ -248,11 +248,11 @@ func structuredSourceURL(raw rawSource) (string, error) {
|
||||
if raw.Channel != nil && strings.TrimSpace(*raw.Channel) != "" {
|
||||
channel = strings.TrimSpace(*raw.Channel)
|
||||
}
|
||||
return buildRTSPURL(host, port, strings.TrimSpace(*raw.Username), *raw.Password, channel), nil
|
||||
return BuildRTSPURL(host, port, strings.TrimSpace(*raw.Username), *raw.Password, channel), nil
|
||||
}
|
||||
|
||||
// buildRTSPURL assembles a Hikvision RTSP URL with percent-encoded credentials.
|
||||
func buildRTSPURL(host string, port int, username, password, channel string) string {
|
||||
// BuildRTSPURL assembles a Hikvision RTSP URL with percent-encoded credentials.
|
||||
func BuildRTSPURL(host string, port int, username, password, channel string) string {
|
||||
address := url.URL{
|
||||
Scheme: "rtsp",
|
||||
User: url.UserPassword(username, password),
|
||||
|
||||
Reference in New Issue
Block a user