diff --git a/control/internal/web/ui/templates/console.html b/control/internal/web/ui/templates/console.html index a3f5033..13611e7 100644 --- a/control/internal/web/ui/templates/console.html +++ b/control/internal/web/ui/templates/console.html @@ -183,6 +183,13 @@ function esc(s) { return (s||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,"""); } + // 简化错误原因:只保留类型(如 'RTSP 打开失败'),去掉 URL/细节(看板窗口小) + function briefError(e) { + if (!e) return '视频源异常'; + var m = e.match(/^([^::((]+)/); + return '视频源异常:' + (m ? m[1].trim() : '请检查视频源'); + } + // 视频源状态覆盖层:离线红字/连接中/状态未知 function applySourceStatus(tile, status, hlsError) { var overlay = tile.querySelector('.video-status-overlay'); @@ -192,7 +199,8 @@ tile.appendChild(overlay); } if (hlsError) { - overlay.innerHTML = '
无视频输出
HLS 流不可用,请检查视频源
'; + var why = (status && status.last_error) ? briefError(status.last_error) : '视频源异常:请检查视频源'; + overlay.innerHTML = '
无视频输出
' + why + '
'; overlay.style.display = 'flex'; return; } @@ -211,7 +219,7 @@ return; } overlay.innerHTML = '
离线
' + - (status.last_error ? '
' + esc(status.last_error) + '
' : ''); + '
' + briefError(status.last_error) + '
'; overlay.style.display = 'flex'; }