From f52b1212cd3d66ff12c714938193cecbad5d96f8 Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Fri, 5 May 2023 05:04:06 +0300 Subject: [PATCH] add go2rtc version (#6390) Update System.jsx --- docker/rootfs/usr/local/nginx/conf/nginx.conf | 9 +++++++++ web/src/routes/System.jsx | 20 +++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/docker/rootfs/usr/local/nginx/conf/nginx.conf b/docker/rootfs/usr/local/nginx/conf/nginx.conf index 72725efe4..a6b50e317 100644 --- a/docker/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/rootfs/usr/local/nginx/conf/nginx.conf @@ -204,6 +204,15 @@ http { proxy_set_header Host $host; } + location ~* /api/go2rtc([/]?.*)$ { + proxy_pass http://go2rtc; + rewrite ^/api/go2rtc(.*)$ /api$1 break; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + } + location ~* /api/.*\.(jpg|jpeg|png)$ { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS'; diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx index 4eeaa71a7..7ec238596 100644 --- a/web/src/routes/System.jsx +++ b/web/src/routes/System.jsx @@ -39,6 +39,8 @@ export default function System() { const cameraNames = Object.keys(cameras || emptyObject); const processesNames = Object.keys(processes || emptyObject); + const { data: go2rtc } = useSWR('go2rtc'); + const onHandleFfprobe = async (camera, e) => { if (e) { e.stopPropagation(); @@ -93,14 +95,16 @@ export default function System() { System {service.version} {config && ( - - go2rtc dashboard - + go2rtc {go2rtc && ( `${go2rtc.version} ` ) } + + dashboard + + )}