mirror of
https://github.com/BetterCorp/BetterFrame.git
synced 2026-05-26 20:16:35 +00:00
fix(admin): mask passwords in stream RTSP URIs on camera detail page
This commit is contained in:
parent
4870426158
commit
2e40e78413
1 changed files with 5 additions and 1 deletions
|
|
@ -1318,7 +1318,7 @@ export function CameraEditPage(props: CameraEditProps) {
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class="badge badge-gray">{s.role}</span></td>
|
<td><span class="badge badge-gray">{s.role}</span></td>
|
||||||
<td>{s.name}</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>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</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 {
|
function formatTime(iso: string): string {
|
||||||
try {
|
try {
|
||||||
const d = new Date(iso);
|
const d = new Date(iso);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue