fix(admin): mask passwords in stream RTSP URIs on camera detail page

This commit is contained in:
Mitchell R 2026-05-21 16:29:24 +02:00
parent 4870426158
commit 2e40e78413
No known key found for this signature in database

View file

@ -1318,7 +1318,7 @@ export function CameraEditPage(props: CameraEditProps) {
<tr>
<td><span class="badge badge-gray">{s.role}</span></td>
<td>{s.name}</td>
<td style="font-size:0.8rem; word-break:break-all">{s.rtsp_uri}</td>
<td style="font-size:0.8rem; word-break:break-all">{maskRtspPassword(s.rtsp_uri)}</td>
</tr>
))}
</tbody>
@ -2846,6 +2846,10 @@ function parseRtspUrl(url: string): { host: string; port: string; path: string;
};
}
function maskRtspPassword(uri: string): string {
return uri.replace(/(rtsp:\/\/[^:]+:)([^@]+)(@)/, "$1**********$3");
}
function formatTime(iso: string): string {
try {
const d = new Date(iso);