updated preview camera view and removed NPED alert disptach
This commit is contained in:
4
.env
4
.env
@@ -9,4 +9,6 @@ VITE_AGX_BOX_FRONT_URL=http://192.168.0.90:8080/SightingListFront/sightingSummar
|
|||||||
VITE_AGX_BOX_REAR_URL=http://192.168.0.90:8080/SightingListRear/sightingSummary?mostRecentRef=
|
VITE_AGX_BOX_REAR_URL=http://192.168.0.90:8080/SightingListRear/sightingSummary?mostRecentRef=
|
||||||
|
|
||||||
VITE_AGX=http://100.72.72.70:8080/SightingListRear/sightingSummary?mostRecentRef=
|
VITE_AGX=http://100.72.72.70:8080/SightingListRear/sightingSummary?mostRecentRef=
|
||||||
VITE_AGX_FRONT=http://100.72.72.70:8080/SightingListFront/sightingSummary?mostRecentRef=
|
VITE_AGX_FRONT=http://100.72.72.70:8080/SightingListFront/sightingSummary?mostRecentRef=
|
||||||
|
|
||||||
|
VITE_AGX_FRONT_BASE=http://100.72.72.70:8080/
|
||||||
@@ -43,18 +43,21 @@ const SightingModal = ({
|
|||||||
Sighting Details
|
Sighting Details
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col md:flex-row gap-3 items-center mb-2">
|
<div className="flex flex-col md:flex-row gap-3 items-center mb-2 justify-between">
|
||||||
<NumberPlate vrm={sighting?.vrm} motion={motionAway} />
|
<div className="flex flex-col md:flex-row gap-3 items-center">
|
||||||
<img
|
<NumberPlate vrm={sighting?.vrm} motion={motionAway} />
|
||||||
src={sighting?.plateUrlColour}
|
<img
|
||||||
alt="plate patch"
|
src={sighting?.plateUrlColour}
|
||||||
className="h-16 object-contain rounded-md"
|
alt="plate patch"
|
||||||
/>
|
className="h-16 object-contain rounded-md"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
{isHotListHit && (
|
{isHotListHit && (
|
||||||
<img
|
<img
|
||||||
src={HotListImg}
|
src={HotListImg}
|
||||||
alt="hotlistHit"
|
alt="hotlistHit"
|
||||||
className="h-18 object-contain rounded-md"
|
className="h-20 object-contain rounded-md"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import CardHeader from "../UI/CardHeader";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { useSightingFeedContext } from "../../context/SightingFeedContext";
|
import { useSightingFeedContext } from "../../context/SightingFeedContext";
|
||||||
import SightingModal from "../SightingModal/SightingModal";
|
import SightingModal from "../SightingModal/SightingModal";
|
||||||
import { useAlertHitContext } from "../../context/AlertHitContext";
|
// import { useAlertHitContext } from "../../context/AlertHitContext";
|
||||||
import InfoBar from "./InfoBar";
|
import InfoBar from "./InfoBar";
|
||||||
|
|
||||||
function useNow(tickMs = 1000) {
|
function useNow(tickMs = 1000) {
|
||||||
@@ -44,7 +44,7 @@ export default function SightingHistoryWidget({
|
|||||||
selectedSighting,
|
selectedSighting,
|
||||||
} = useSightingFeedContext();
|
} = useSightingFeedContext();
|
||||||
|
|
||||||
const { dispatch } = useAlertHitContext();
|
// const { dispatch } = useAlertHitContext();
|
||||||
|
|
||||||
const hasAutoOpenedRef = useRef(false);
|
const hasAutoOpenedRef = useRef(false);
|
||||||
|
|
||||||
@@ -62,18 +62,18 @@ export default function SightingHistoryWidget({
|
|||||||
[sightings]
|
[sightings]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
rows?.forEach((obj) => {
|
// rows?.forEach((obj) => {
|
||||||
const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404;
|
// const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404;
|
||||||
|
|
||||||
if (isNPEDHit) {
|
// if (isNPEDHit) {
|
||||||
dispatch({
|
// dispatch({
|
||||||
type: "ADD",
|
// type: "ADD",
|
||||||
payload: obj,
|
// payload: obj,
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}, [rows, dispatch]);
|
// }, [rows, dispatch]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasAutoOpenedRef.current) return;
|
if (hasAutoOpenedRef.current) return;
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import { useRef, useCallback, useEffect } from "react";
|
import { useRef, useCallback, useEffect } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
const apiUrl = import.meta.env.VITE_BASEURL;
|
const apiUrl = import.meta.env.VITE_AGX_FRONT_BASE;
|
||||||
const folkstoneUrl = import.meta.env.VITE_FOLKESTONE_BASE;
|
|
||||||
console.log(folkstoneUrl);
|
|
||||||
async function fetchSnapshot(cameraSide: string) {
|
async function fetchSnapshot(cameraSide: string) {
|
||||||
const response = await fetch(
|
const response = await fetch(`${apiUrl}/${cameraSide}-preview`);
|
||||||
// `${folkstoneUrl}/Colour-preview`
|
|
||||||
`${apiUrl}/${cameraSide}-preview`
|
|
||||||
);
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error("Cannot reach endpoint");
|
throw new Error("Cannot reach endpoint");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user