From 57d3cb87daae76e21faad33b3a4189aaa6554f2a Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Sat, 12 Jul 2025 10:43:04 -0400 Subject: [PATCH] acitivity is back and emergency is highlighted --- backend/controllers/calls.js | 3 +++ docker-compose.yml | 1 - frontend/src/Call/CallPlayer.js | 18 +++++++++++------- frontend/src/Call/components/CallInfoPane.js | 6 ++++++ frontend/src/Call/components/CallItem.js | 1 + frontend/src/Call/components/MediaPlayer.js | 4 ++-- nginx-proxy/Dockerfile | 4 ++++ nginx-proxy/entrypoint.sh | 20 ++++++++++++++++++++ 8 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 nginx-proxy/entrypoint.sh diff --git a/backend/controllers/calls.js b/backend/controllers/calls.js index 060e820..a8fa53c 100644 --- a/backend/controllers/calls.js +++ b/backend/controllers/calls.js @@ -19,6 +19,7 @@ const build_call_list = (items) => { time: item.time, srcList: item.srcList, star: item.star, + emergency: item.emergency, freq: item.freq, patches: item.patches, len: Math.round(item.len) @@ -37,6 +38,7 @@ async function get_calls(query, numResults, middleDate, res) { path: true, name: true, time: true, + emergency: true, srcList: true, freq: true, patches: true, @@ -216,6 +218,7 @@ function package_call(item) { freq: item.freq, srcList: item.srcList, star: item.star, + emergency: item.emergency, len: Math.round(item.len) }; return call; diff --git a/docker-compose.yml b/docker-compose.yml index 7093c68..57ad39d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,7 +25,6 @@ services: - frontend - account - admin - command: /bin/bash -c "envsubst '$$DOMAIN_NAME' < /etc/nginx/conf.d/site.template > /etc/nginx/conf.d/default.conf && while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'" certbot: image: certbot/certbot:latest diff --git a/frontend/src/Call/CallPlayer.js b/frontend/src/Call/CallPlayer.js index c30bd9e..fe4c121 100644 --- a/frontend/src/Call/CallPlayer.js +++ b/frontend/src/Call/CallPlayer.js @@ -177,13 +177,17 @@ function CallPlayer(props) { } }, [system]) - useEffect(async () => { - try { - const wakeLock = await navigator.wakeLock.request("screen"); - } catch (err) { - // the wake lock request fails - usually system related, such being low on battery - console.log(`${err.name}, ${err.message}`); - } + useEffect(() => { + const requestWakeLock = async () => { + try { + const wakeLock = await navigator.wakeLock.request("screen"); + } catch (err) { + // the wake lock request fails - usually system related, such being low on battery + console.log(`${err.name}, ${err.message}`); + } + }; + + requestWakeLock(); }, []); const handleStatusDismiss = () => { diff --git a/frontend/src/Call/components/CallInfoPane.js b/frontend/src/Call/components/CallInfoPane.js index a92c368..e8b08aa 100644 --- a/frontend/src/Call/components/CallInfoPane.js +++ b/frontend/src/Call/components/CallInfoPane.js @@ -26,6 +26,7 @@ function CallInfoPane(props) { let patchString = ""; let header = "Call Info" let title = "" + let callEmergnecy = (<> ); const currentCall = props.call ? props.call : false; const { callLink, callDownload, callTweet } = useCallLink(props.call) const { data: allSystems, isSuccess } = useGetSystemsQuery(); @@ -54,6 +55,10 @@ function CallInfoPane(props) { callLength = currentCall.len; talkgroupNum = currentCall.talkgroupNum; patches = currentCall.patches; + + if (currentCall.emergency) { + callEmergnecy = (
Emergency
) + } if(patches && (patches.length > 1)) { patchString = patches.join(", "); @@ -100,6 +105,7 @@ function CallInfoPane(props) { return ( <>
{header}
+ {callEmergnecy} {srcList} diff --git a/frontend/src/Call/components/CallItem.js b/frontend/src/Call/components/CallItem.js index f48d670..74c87c6 100644 --- a/frontend/src/Call/components/CallItem.js +++ b/frontend/src/Call/components/CallItem.js @@ -108,6 +108,7 @@ const CallItem = (props) => { } else if (call.emergency) { rowSelected = { positive: true, + error: true, color: "red", key: "red", inverted: "true" diff --git a/frontend/src/Call/components/MediaPlayer.js b/frontend/src/Call/components/MediaPlayer.js index 2b14ff1..a9ff14e 100644 --- a/frontend/src/Call/components/MediaPlayer.js +++ b/frontend/src/Call/components/MediaPlayer.js @@ -115,9 +115,9 @@ const MediaPlayer = (props) => { } if (regionsPlugin) { try { - regionsPlugin.destroy(); + regionsPlugin.clearRegions(); } catch (error) { - console.warn('Error destroying regions plugin:', error); + console.warn('Error clearing regions in cleanup:', error); } } }; diff --git a/nginx-proxy/Dockerfile b/nginx-proxy/Dockerfile index 60005e1..776cfb0 100644 --- a/nginx-proxy/Dockerfile +++ b/nginx-proxy/Dockerfile @@ -24,3 +24,7 @@ COPY *.conf /etc/nginx/ # Add virtual hosts COPY ${STAGE}/vhosts/ /etc/nginx/conf.d/ + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/nginx-proxy/entrypoint.sh b/nginx-proxy/entrypoint.sh new file mode 100644 index 0000000..8ddf48b --- /dev/null +++ b/nginx-proxy/entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +# Render the config from template +envsubst '$DOMAIN_NAME' < /etc/nginx/conf.d/site.template > /etc/nginx/conf.d/default.conf + +# Test Nginx config +nginx -t + +# Background job: reload Nginx every 6 hours to pick up new certs +( + while true; do + sleep 6h + echo "[nginx] Reloading config..." + nginx -s reload && echo "[nginx] Reload succeeded" || echo "[nginx] Reload failed" + done +) & + +# Start Nginx in the foreground +exec nginx -g 'daemon off;' \ No newline at end of file