acitivity is back and emergency is highlighted

This commit is contained in:
Luke Berndt
2025-07-12 10:43:04 -04:00
parent 0f69a3e9da
commit 57d3cb87da
8 changed files with 47 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ const build_call_list = (items) => {
time: item.time, time: item.time,
srcList: item.srcList, srcList: item.srcList,
star: item.star, star: item.star,
emergency: item.emergency,
freq: item.freq, freq: item.freq,
patches: item.patches, patches: item.patches,
len: Math.round(item.len) len: Math.round(item.len)
@@ -37,6 +38,7 @@ async function get_calls(query, numResults, middleDate, res) {
path: true, path: true,
name: true, name: true,
time: true, time: true,
emergency: true,
srcList: true, srcList: true,
freq: true, freq: true,
patches: true, patches: true,
@@ -216,6 +218,7 @@ function package_call(item) {
freq: item.freq, freq: item.freq,
srcList: item.srcList, srcList: item.srcList,
star: item.star, star: item.star,
emergency: item.emergency,
len: Math.round(item.len) len: Math.round(item.len)
}; };
return call; return call;

View File

@@ -25,7 +25,6 @@ services:
- frontend - frontend
- account - account
- admin - 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: certbot:
image: certbot/certbot:latest image: certbot/certbot:latest

View File

@@ -177,13 +177,17 @@ function CallPlayer(props) {
} }
}, [system]) }, [system])
useEffect(async () => { useEffect(() => {
try { const requestWakeLock = async () => {
const wakeLock = await navigator.wakeLock.request("screen"); try {
} catch (err) { const wakeLock = await navigator.wakeLock.request("screen");
// the wake lock request fails - usually system related, such being low on battery } catch (err) {
console.log(`${err.name}, ${err.message}`); // the wake lock request fails - usually system related, such being low on battery
} console.log(`${err.name}, ${err.message}`);
}
};
requestWakeLock();
}, []); }, []);
const handleStatusDismiss = () => { const handleStatusDismiss = () => {

View File

@@ -26,6 +26,7 @@ function CallInfoPane(props) {
let patchString = ""; let patchString = "";
let header = "Call Info" let header = "Call Info"
let title = "" let title = ""
let callEmergnecy = (<> </>);
const currentCall = props.call ? props.call : false; const currentCall = props.call ? props.call : false;
const { callLink, callDownload, callTweet } = useCallLink(props.call) const { callLink, callDownload, callTweet } = useCallLink(props.call)
const { data: allSystems, isSuccess } = useGetSystemsQuery(); const { data: allSystems, isSuccess } = useGetSystemsQuery();
@@ -54,6 +55,10 @@ function CallInfoPane(props) {
callLength = currentCall.len; callLength = currentCall.len;
talkgroupNum = currentCall.talkgroupNum; talkgroupNum = currentCall.talkgroupNum;
patches = currentCall.patches; patches = currentCall.patches;
if (currentCall.emergency) {
callEmergnecy = (<div><Icon name="warning sign" color="red" /> Emergency </div>)
}
if(patches && (patches.length > 1)) { if(patches && (patches.length > 1)) {
patchString = patches.join(", "); patchString = patches.join(", ");
@@ -100,6 +105,7 @@ function CallInfoPane(props) {
return ( return (
<> <>
<Header as='h1'>{header}</Header> <Header as='h1'>{header}</Header>
{callEmergnecy}
<List bulleted horizontal link> <List bulleted horizontal link>
{srcList} {srcList}
</List> </List>

View File

@@ -108,6 +108,7 @@ const CallItem = (props) => {
} else if (call.emergency) { } else if (call.emergency) {
rowSelected = { rowSelected = {
positive: true, positive: true,
error: true,
color: "red", color: "red",
key: "red", key: "red",
inverted: "true" inverted: "true"

View File

@@ -115,9 +115,9 @@ const MediaPlayer = (props) => {
} }
if (regionsPlugin) { if (regionsPlugin) {
try { try {
regionsPlugin.destroy(); regionsPlugin.clearRegions();
} catch (error) { } catch (error) {
console.warn('Error destroying regions plugin:', error); console.warn('Error clearing regions in cleanup:', error);
} }
} }
}; };

View File

@@ -24,3 +24,7 @@ COPY *.conf /etc/nginx/
# Add virtual hosts # Add virtual hosts
COPY ${STAGE}/vhosts/ /etc/nginx/conf.d/ COPY ${STAGE}/vhosts/ /etc/nginx/conf.d/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

20
nginx-proxy/entrypoint.sh Normal file
View File

@@ -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;'