-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 42 KB
/
.eslintcache
1
[{"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/App.tsx":"1","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/components/header/Header.tsx":"2","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/components/uikit/uikit.tsx":"3","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/reportWebVitals.ts":"4","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/index.tsx":"5","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/components/VehicleMarkers.tsx":"6","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/FleetMap.tsx":"7","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/components/MapControlsBanner.tsx":"8","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/MapView.tsx":"9","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/VehiclesView.tsx":"10","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/components/UserPositionMarker.tsx":"11","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/assets/js/SmoothWheelZoom.js":"12","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/GTFSView.tsx":"13","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/context/vehiclesContext.tsx":"14","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/context/userPositionContext.tsx":"15"},{"size":1492,"mtime":1610620827156,"results":"16","hashOfConfig":"17"},{"size":604,"mtime":1610487973000,"results":"18","hashOfConfig":"17"},{"size":33988,"mtime":1614683088036,"results":"19","hashOfConfig":"17"},{"size":425,"mtime":1609862454592,"results":"20","hashOfConfig":"17"},{"size":500,"mtime":1609862454000,"results":"21","hashOfConfig":"17"},{"size":7487,"mtime":1611506884229,"results":"22","hashOfConfig":"17"},{"size":761,"mtime":1611015865498,"results":"23","hashOfConfig":"17"},{"size":8968,"mtime":1612463736608,"results":"24","hashOfConfig":"17"},{"size":2494,"mtime":1610648779000,"results":"25","hashOfConfig":"17"},{"size":10770,"mtime":1611419439334,"results":"26","hashOfConfig":"17"},{"size":1818,"mtime":1610213307000,"results":"27","hashOfConfig":"17"},{"size":3627,"mtime":1610477125000,"results":"28","hashOfConfig":"17"},{"size":1666,"mtime":1610833915000,"results":"29","hashOfConfig":"17"},{"size":1799,"mtime":1611414323034,"results":"30","hashOfConfig":"17"},{"size":754,"mtime":1610125633000,"results":"31","hashOfConfig":"17"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"15mosek",{"filePath":"34","messages":"35","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"36","messages":"37","errorCount":0,"warningCount":23,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"40"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"46"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"49","usedDeprecatedRules":"50"},{"filePath":"51","messages":"52","errorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"53","messages":"54","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"55","usedDeprecatedRules":"43"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":7,"fixableErrorCount":0,"fixableWarningCount":0,"source":"58","usedDeprecatedRules":"43"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"68","usedDeprecatedRules":"69"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"43"},"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/App.tsx",["72","73"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/components/header/Header.tsx",["74","75","76"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/components/uikit/uikit.tsx",["77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/reportWebVitals.ts",[],["100","101"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/index.tsx",[],["102","103"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/components/VehicleMarkers.tsx",["104","105"],"import React, {useContext, useEffect} from 'react';\nimport {Marker, Popup, Tooltip, useMapEvents} from \"react-leaflet\";\nimport L, {LeafletMouseEvent} from \"leaflet\";\nimport Moment from \"react-moment\";\n\nimport iconBus from '../../../assets/images/bus-icon.svg';\nimport bus_image from '../../../assets/images/gps.svg';\nimport {VehiclesContext} from \"../context/vehiclesContext\";\nimport classNames from \"classnames\";\n\n//Vehicle Icon\nlet vehicleIconImg = L.icon({\n iconUrl: iconBus,\n iconSize: [40, 40], // size of the icon\n iconAnchor: [18, 38], // point of the icon which will correspond to marker's location\n popupAnchor: [2, -40], // point from which the popup should open relative to the iconAnchor\n});\nvar vehicleIcon = L.divIcon({\n iconSize: [40, 40], // size of the icon\n iconAnchor: [18, 38], // point of the icon which will correspond to marker's location\n popupAnchor: [2, -40], // point from which the popup should open relative to the iconAnchor\n className: 'realtime-bus-marker bg-label',\n html: `<div class=\"realtime-bus-bg\"></div><img class=\"realtime-bus-icon\" src=${iconBus}>`\n});\nvar vehicleIconOffline = L.divIcon({\n iconSize: [40, 40], // size of the icon\n iconAnchor: [18, 38], // point of the icon which will correspond to marker's location\n popupAnchor: [2, -40], // point from which the popup should open relative to the iconAnchor\n className: 'realtime-bus-marker bg-label not-updated',\n html: `<div class=\"realtime-bus-bg\"></div><img class=\"realtime-bus-icon\" src=${iconBus}>`\n});\nvar vehicleTracked = L.divIcon({\n iconSize: [40, 40], // size of the icon\n iconAnchor: [18, 38], // point of the icon which will correspond to marker's location\n popupAnchor: [2, -40], // point from which the popup should open relative to the iconAnchor\n className: 'realtime-bus-marker tracked-marker',\n html: `<div class=\"realtime-bus-bg\"></div><img class=\"realtime-bus-icon\" src=${iconBus}>`\n});\n\ninterface GPSData {\n \"_id\": string,\n \"unitID\": string,\n \"unitSN\": string,\n \"datetime\": string,\n \"datetime_system\": Date,\n \"latitude\": number,\n \"longitude\": number,\n driverID: string,\n \"driverID_lastupdate\": Date,\n \"speed\": number\n}\n\nconst LeafletPopup: React.FC<GPSData> = ({unitID, unitSN, datetime, driverID_lastupdate, driverID, speed, latitude, longitude}) => {\n return(\n <Popup className=\"realtime-bus-marker-popup bg-white bg-opacity-75 w-screen sm:w-96\" maxWidth={500} /* autoPanPadding={[200, 50]} disable on mobile */>\n <div className=\"flex items-center flex-col w-full p-4 rounded-lg transition-opacity duration-250 text-sm\">\n <div className=\"flex items-center\">\n <img src={bus_image} alt=\"Bus\"\n className=\"w-10 h-10 object-cover mr-4\" />\n <div>\n <h3 className=\"font-medium text-blue-600\">UnitSN: <span className=\"font-bold text-black\">{unitSN}</span></h3>\n <h3 className=\"font-medium text-blue-600\">UnitID: <span className=\"font-bold text-black\">{unitID}</span></h3>\n </div>\n </div>\n <div>\n <br />\n <h3 className=\"font-medium text-gray-900\">[ <span className=\"font-bold\">{latitude} , {longitude} </span>]</h3>\n <br />\n <h3 className=\"font-medium text-blue-600\">Last Update: <Moment className=\"font-bold text-black\" fromNow>{datetime}</Moment></h3>\n <h3 className=\"font-medium text-blue-600\">Timestamp: <Moment className=\"font-bold text-black\" format=\"DD/MM/YYYY HH:ss\" >{datetime}</Moment></h3>\n <h3 className=\"font-medium text-blue-600\">Speed: <span className=\"text-black\"><strong>{speed}</strong> k/h</span></h3>\n <br />\n <h3 className=\"font-medium text-blue-600\">DriverID: <span className=\"font-bold text-black\">{driverID}</span></h3>\n <h3 className=\"font-medium text-blue-600\">DriverID Last Update: <span className=\"font-bold text-black\">{driverID_lastupdate}</span></h3>\n </div>\n </div>\n </Popup>\n )\n}\n\nconst VehicleMarkers: React.FC = () => {\n const {\n vehicles,\n permanentLabels,\n isVehicleRealTime,\n REALTIME_RANGE,\n realtimeVehiclesPosition,\n setVehicleDetails,\n vehicleDetails\n } = useContext(VehiclesContext)\n\n //useMapHook\n const map = useMapEvents({\n dblclick: (e) => {\n //addMarker(e.latlng)\n },\n zoomstart: (e) => {\n //console.log(\"start\")\n map.getPanes().mapPane.classList.add(\"prevent-animation\")\n },\n zoomend: (e) => {\n //console.log(\"end\")\n map.getPanes().mapPane.classList.remove(\"prevent-animation\")\n }\n //alternative to useMapEvents\n /*useEffect(() => {\n console.log(\"renderer\")\n //map here is passed as prop\n map.on(\"dblclick\", (e: LeafletMouseEvent) => {\n addMarker(e.latlng)\n })\n }, [map])*/\n })\n\n useEffect(() => {\n //refresh tooltip\n //reset markers animations\n map.getPanes().mapPane.classList.remove(\"prevent-animation\")\n }, [permanentLabels, realtimeVehiclesPosition])\n\n const handleMarkerEvents = (selected: GPSData) => {\n return {\n click: (e: LeafletMouseEvent) => {\n setVehicleDetails((v: GPSData) => {\n if(v && v.unitID === selected.unitID){\n return null;\n }else{\n //center selected marker\n //map.flyTo([selected.latitude, selected.longitude], map.getZoom())\n return {\n ...selected\n };\n }\n })\n }\n }\n\n }\n\n const realtime_min_time = new Date(Date.now() - 1000 * REALTIME_RANGE) // 30 secs\n\n return (\n <>\n {vehicles.map((v: GPSData) => {\n // @ts-ignore\n // @ts-ignore\n return (\n <Marker key={v.unitID + `_tooltip${permanentLabels}`}\n position={[v.latitude, v.longitude]}\n icon={v.unitID === vehicleDetails?.unitID ? vehicleTracked : realtimeVehiclesPosition ? (isVehicleRealTime(v.datetime_system, realtime_min_time) ? vehicleIcon : vehicleIconOffline) : vehicleIconImg}\n riseOnHover={true}\n eventHandlers={handleMarkerEvents(v)}\n >\n {/*<LeafletPopup {...v}/>*/}\n <Tooltip offset={[0, -45]} direction={\"top\"} className={classNames(\"realtime-bus-marker-tooltip font-medium transition-opacity duration-500\", {'permanent-tooltip': permanentLabels})} permanent={permanentLabels} sticky={false}>\n <h3 className=\"font-medium text-blue-600\">UnitSN: <span className=\"font-bold text-black\">{v.unitSN}</span></h3>\n {v.driverID && <h3 className=\"font-medium text-blue-600\">DriverID: <span className=\"font-bold text-black\">{v.driverID}</span></h3> }\n </Tooltip>\n </Marker>)\n\n })}\n </>\n )\n}\n\nexport default VehicleMarkers;","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/FleetMap.tsx",["106","107","108","109","110"],"import React from 'react';\nimport {Sidebar} from \"../../components/uikit/uikit\";\nimport MapView from \"./MapView\";\n\nimport {GiAerialSignal, IoCloudOfflineSharp} from \"react-icons/all\";\nimport {VscListFilter } from \"react-icons/all\";\nimport {GiRadarSweep } from \"react-icons/all\";\nimport {UserPositionContextProvider} from \"./context/userPositionContext\";\n\nconst FleetMap = () => {\n return (\n <div id=\"FleetMap\" className=\"h-screen w-screen\">\n {/* <Sidebar {...sidebar_content}/> */}\n <div className=\"page-wrapper pt-20 h-full w-full\">\n <UserPositionContextProvider>\n <MapView />\n </UserPositionContextProvider>\n </div>\n\n </div>\n );\n};\n\nexport default FleetMap;",["111","112"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/components/MapControlsBanner.tsx",["113","114","115","116","117","118","119","120","121"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/MapView.tsx",["122","123","124","125","126","127"],"import React, {useContext, useState} from 'react';\n\nimport {LayerGroup, MapContainer as LeafletMap, Marker, MarkerProps, TileLayer, useMap, useMapEvents} from \"react-leaflet\";\nimport L, {LatLngTuple} from 'leaflet';\nimport 'leaflet/dist/leaflet.css';\n\nimport '../../assets/js/SmoothWheelZoom'\n\nimport {UserPositionMarker} from \"./components/UserPositionMarker\";\n\nimport icon from 'leaflet/dist/images/marker-icon.png';\nimport iconShadow from 'leaflet/dist/images/marker-shadow.png';\nimport blurMap from '../../assets/images/blur_map.jpg'\n\nimport './style/fleetmap.css';\n\n//Components\nimport MapControlsBanner from \"./components/MapControlsBanner\";\nimport VehicleMarkers from \"./components/VehicleMarkers\";\nimport {VehiclesContext} from \"./context/vehiclesContext\";\n\n//Leaflet set Default Icon\nlet defaultIcon = L.icon({\n iconUrl: icon,\n shadowUrl: iconShadow,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n});\nL.Marker.prototype.options.icon = defaultIcon;\n\nconst MapView: React.FC = () => {\n const center: LatLngTuple = [41.9109, 12.4818];\n\n const {\n setMap,\n map\n } = useContext(VehiclesContext)\n\n return (\n <div className=\"map-layer h-full w-full\">\n <LeafletMap\n id=\"leaflet-map\"\n center={center}\n zoom={13}\n placeholder={<h1>MAP</h1>}\n zoomControl={false}\n whenCreated={setMap}\n doubleClickZoom={false}\n closePopupOnClick={true}\n preferCanvas={true}\n scrollWheelZoom={false}\n >\n <TileLayer\n attribution='© <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors'\n url=\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\"\n detectRetina={true}\n keepBuffer={5}\n updateWhenIdle={true}\n />\n\n <UserPositionMarker />\n {/*<LayerGroup>\n {map && <GTFSStops />}\n {map && <GTFSRoute />}\n </LayerGroup>*/}\n {/*<LayerGroup>\n {map && <Recognizer map={map}/>}\n </LayerGroup>*/}\n <LayerGroup>\n <VehicleMarkers />\n </LayerGroup>\n </LeafletMap>\n {map && <MapControlsBanner map={map} center={center}/>}\n </div>\n );\n};\n\nexport default MapView;","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/VehiclesView.tsx",["128","129","130","131","132","133","134"],"import React, {useContext, useEffect, useState} from 'react';\nimport {Banner, ContentCard, DetailCard, EmptyCard, Sidebar} from \"../../components/uikit/uikit\";\nimport classNames from \"classnames\";\n\nimport {GiAerialSignal, GiKeyCard, IoCloudOfflineSharp} from \"react-icons/all\";\nimport {GiRadarSweep } from \"react-icons/all\";\nimport busImg from '../../assets/images/cng.jpg'\nimport {GPSData, VehiclesContext} from \"./context/vehiclesContext\";\nimport {LatLngTuple} from \"leaflet\";\nimport axios from \"axios\";\nimport Moment from \"react-moment\";\n\nconst sidebar_content = {\n info: process.env.REACT_APP_SIDEBAR_INFO ? JSON.parse(process.env.REACT_APP_SIDEBAR_INFO) : [],\n classname: \"h-full inline-flex flex-col justify-between bg-white shadow p-6 bg-blurred bg-opacity-75 transition duration-150 xl:w-80\",\n items: [\n {\n name: \"All\",\n link: \"/all\",\n data_url: process.env.REACT_APP_VEHICLES_API_ALL as string,\n icon: <GiRadarSweep />\n },\n {\n name: \"Online\",\n link: \"/online\",\n data_url: process.env.REACT_APP_VEHICLES_API_REALTIME as string,\n icon: <GiAerialSignal />\n },\n {\n name: \"Offline\",\n link: \"/offline\",\n data_url: process.env.REACT_APP_VEHICLES_API_OFFLINE as string,\n icon: <IoCloudOfflineSharp />\n },\n {\n name: \"Driver ID\",\n link: \"/driverids\",\n data_url: process.env.REACT_APP_VEHICLES_API_DRIVERID as string,\n icon: <GiKeyCard />\n },\n ],\n collapsible: true\n}\n\ninterface ViewProps {\n active: boolean\n}\n\nconst VehiclesView: React.FC<ViewProps> = ({active}) => {\n const [intervalRealtime, setIntervalRealtime] = useState<any>(null)\n const {\n vehicles,\n setVehicles,\n vehiclesReady,\n setVehiclesReady,\n isVehicleRealTime,\n REALTIME_RANGE,\n map,\n realtimeVehiclesPosition,\n setRealtimeVehiclesPosition,\n filterVehicles,\n setFilterVehicles,\n setVehicleDetails,\n vehicleDetails\n } = useContext(VehiclesContext)\n\n const realtime_min_time = new Date(Date.now() - 1000 * REALTIME_RANGE) // 30 secs\n\n const locateVehicle = (point: LatLngTuple) => {\n map.flyTo(point, map.getMaxZoom(), {padding: [150, 150]})\n }\n\n const fitMarkersState = () => {\n if(map && vehicles.length){\n map.getPanes().mapPane.classList.add(\"prevent-animation\")\n map.flyToBounds(vehicles.map((item: GPSData) => {\n return [item.latitude, item.longitude]\n }), {padding: [150, 50]})\n //setTimeout(, 2000)\n }\n }\n\n const fitMarkers = (list: GPSData[]) => {\n if(map && list.length){\n map.getPanes().mapPane.classList.add(\"prevent-animation\")\n map.flyToBounds(list.map((item: GPSData) => {\n return [item.latitude, item.longitude]\n }), {padding: [150, 50]})\n //setTimeout(, 2000)\n }\n }\n\n const setVehiclesByStatus = (v: GPSData[], status: boolean) => {\n if(vehicles){\n const offline = v.filter(i => status ? isVehicleRealTime(i.datetime_system, realtime_min_time) : !isVehicleRealTime(i.datetime_system, realtime_min_time))\n setVehicles(offline)\n }\n }\n\n const getVehicles = async (url: string, loop: boolean, fit: boolean) => {\n try {\n const res = await axios(url)\n if (res.data) {\n //TEMP - only when offline api are missing, else just setVehicles - to remove when offline api will be added\n filterVehicles === \"Offline\" ? setVehiclesByStatus(res.data, false) : setVehicles(res.data)\n //setVehicles(res.data)\n if (!loop) {\n setVehiclesReady(true)\n if (fit) {\n fitMarkers(res.data)\n }\n\n }\n }\n } catch (err) {\n //throw new Error('Unable to get data from server.')\n //show alert\n setVehiclesReady(null)\n console.log(\"Unable to get data from server.\")\n }\n }\n\n const getFilterObject = () => {\n return sidebar_content.items.find((i: any) => {\n return i.name === filterVehicles\n })\n }\n\n useEffect(() => {\n if(vehiclesReady === null){\n return\n }\n\n //get filter data\n const selected_filter = getFilterObject()\n if(!selected_filter){\n return\n }\n\n //first request, when data are not ready and interval is not set\n if(vehiclesReady === false){\n //start fetching data\n getVehicles(selected_filter.data_url, false, vehicles.length <= 0)\n }\n\n //if vehiclesReady is true check if realtime is enabled to start loop\n let intvl: any = null;\n if(vehiclesReady === true && realtimeVehiclesPosition){\n //create interval\n intvl = setInterval( () => {\n //now get only real time data\n getVehicles(selected_filter.data_url, true, false)\n\n //to check if interval is running correctly\n console.log(\"Realtime for \" + selected_filter.name)\n }, 6000)\n setIntervalRealtime(intvl)\n }\n\n return () => {\n clearInterval(intvl)\n }\n\n\n }, [vehiclesReady])\n\n useEffect(() => {\n //this function can be executed only if data are ready\n if(!vehiclesReady){\n return\n }\n //set ready to false to start fetching data\n //if no error occurred vehiclesready effect will start loop\n //when ready and realtime flag are true\n if(realtimeVehiclesPosition){\n setVehiclesReady(false)\n }else{\n //stop realtime intervall\n clearInterval(intervalRealtime)\n }\n\n //in this way we know that data were ready,\n // it will refresh data with realtime enabled and it, if no error occurrs it will start the interval\n }, [realtimeVehiclesPosition])\n\n useEffect(() => {\n //when filter view changes\n if(filterVehicles === \"\") {\n setRealtimeVehiclesPosition(false)\n setVehicleDetails(null)\n return\n }\n\n //clean interval for new filter\n clearInterval(intervalRealtime)\n\n //initFilterView\n const selected_filter = getFilterObject()\n if(!selected_filter) return\n //start fetching data\n setVehiclesReady(false)\n //getVehicles(selected_filter.data_url, false, true)\n\n return () => {\n setVehiclesReady(null)\n setVehicles([])\n }\n }, [filterVehicles])\n\n //update vehicleDetails is needed\n useEffect(() => {\n if(vehicleDetails && vehicles){\n const updated_gps = vehicles.find((i: GPSData) => i.unitID === vehicleDetails.unitID)\n //check if it has been changed\n if(updated_gps){\n if(updated_gps.datetime_system !== vehicleDetails.datetime_system){\n setVehicleDetails((v: GPSData) => {\n return {\n ...v,\n ...updated_gps\n }\n })\n if(!(map.getBounds().contains([updated_gps.latitude, updated_gps.longitude]))){\n map.flyTo([updated_gps.latitude, updated_gps.longitude], map.getZoom())\n }\n //create a button to follow the marker real time\n //map.panTo([updated_gps.latitude, updated_gps.longitude], map.getZoom())\n\n }\n }else{\n setVehicleDetails(null);\n }\n\n }\n }, [vehicles])\n\n\n const onClickSidebarItem = (f: string) => {\n if(f === filterVehicles){\n //close filter view\n setFilterVehicles(\"\")\n }else{\n setFilterVehicles(f)\n //if realtime is enabled it will get to fetch data\n }\n }\n\n const collapseVehiclesList = () => {\n //set a boolean state for the banner\n }\n\n return (\n <div id=\"VehiclesView\" className={classNames(\"absolute h-screen left-0 top-0 w-auto pt-20 flex\", { hidden: !active })} style={{zIndex: 999}}>\n\n {/* Sidebar to get GPD Data in realtime, offline or both*/}\n <Sidebar {...sidebar_content} active={filterVehicles} onClickItem={onClickSidebarItem}/>\n\n {/* Sidebar for selectg and follow one vehicle ///// filter === sidebar_content.items[3].name && */}\n {filterVehicles && <div className=\"absolute h-full w-80 top-0 -right-80 px-6 bg-transparent max-h-full\">\n <div className=\"relative w-full h-full inline-flex flex-col pt-44 overflow-y-auto\">\n {/* CARD LIST */}\n {vehiclesReady ? vehicles.length > 0 ? vehicles.map((i: GPSData) => {\n const content = {\n jsx: <div className=\"b-card-body flex flex-col px-4 pb-8\">\n <h3 className=\"font-medium text-blue-300 text-sm\">Driver ID: <span className=\"font-bold text-gray-500\">{i.driverID}</span></h3>\n {i.driverID_lastupdate && <h3 className=\"text-blue-300 text-sm\">badged: <span className=\"font-medium text-gray-400 text-sm\"><Moment format=\"llll\">{i.driverID_lastupdate}</Moment></span></h3>}\n </div>,\n options: {\n isRealtime: isVehicleRealTime(i.datetime_system, realtime_min_time)\n }\n }\n return <ContentCard key={i.unitID} subtitle={i.unitID} title={i.unitSN} img={busImg}\n content={content}\n action={() => locateVehicle([i.latitude, i.longitude])} selected={vehicleDetails?.unitID === i.unitID}/>\n }) : <div className=\"bg-white py-6 px-3 sm:px-6 lg:px-8 rounded-md\"><h1 className=\"text-red-500\">No Vehicle</h1></div> : <EmptyCard></EmptyCard>}\n </div>\n <Banner classname=\"absolute top-24 left-6 right-6 rounded-md bg-blurred bg-opacity-50 bg-blue-50\" onClickClose={() => onClickSidebarItem(filterVehicles)}>\n <h1 className=\"text-blue-500\">{filterVehicles}</h1>\n </Banner>\n </div>}\n </div>\n )\n}\n\nexport default VehiclesView;","/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/components/UserPositionMarker.tsx",[],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/assets/js/SmoothWheelZoom.js",[],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/GTFSView.tsx",[],["135","136"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/context/vehiclesContext.tsx",["137"],"import React, {useState} from 'react';\nimport L, {LeafletEvent} from \"leaflet\";\n\nconst VehiclesContext:any = React.createContext({});\n\nexport interface GPSData {\n \"_id\": string,\n \"unitID\": string,\n \"unitSN\": string,\n \"datetime\": string,\n \"datetime_system\": Date,\n \"latitude\": number,\n \"longitude\": number,\n driverID: string,\n \"driverID_lastupdate\": Date,\n \"speed\": number\n}\n\nconst VehiclesContextProvider = ({ children }: any) => {\n const [vehicles, setVehicles] = useState<GPSData[]>([])\n const [vehicleDetails, setVehicleDetails] = useState<GPSData | null>(null)\n const [vehiclesReady, setVehiclesReady] = useState(null)\n const [realtimeVehiclesPosition, setRealtimeVehiclesPosition] = useState(false)\n const [map, setMap] = useState<L.Map | null>(null)\n const [filterVehicles, setFilterVehicles] = useState<string>( \"\")\n const [permanentLabels, setPermanentLabels] = useState(false)\n const REALTIME_RANGE = 30; // 30 SECONDS\n\n const isVehicleRealTime = (vehicle: Date, time?: Date) => {\n return vehicle > (time ? time : new Date(Date.now() - 1000 * REALTIME_RANGE))\n }\n\n const vehiclesContextValue = {\n vehicles,\n setVehicles,\n vehiclesReady,\n setVehiclesReady,\n permanentLabels,\n setPermanentLabels,\n REALTIME_RANGE,\n isVehicleRealTime,\n map,\n setMap,\n realtimeVehiclesPosition,\n setRealtimeVehiclesPosition,\n filterVehicles,\n setFilterVehicles,\n vehicleDetails,\n setVehicleDetails\n }\n\n return (\n <VehiclesContext.Provider value={vehiclesContextValue}>\n {children}\n </VehiclesContext.Provider>\n )\n}\n\n// and export both objects\nexport { VehiclesContext, VehiclesContextProvider };",["138","139"],"/Users/gssi/Bianchi/Development/vehicle-monitoring-system/src/pages/fleetmap/context/userPositionContext.tsx",[],{"ruleId":"140","severity":1,"message":"141","line":6,"column":8,"nodeType":"142","messageId":"143","endLine":6,"endColumn":12},{"ruleId":"144","severity":1,"message":"145","line":50,"column":36,"nodeType":"146","messageId":"147","endLine":50,"endColumn":38},{"ruleId":"140","severity":1,"message":"148","line":2,"column":8,"nodeType":"142","messageId":"143","endLine":2,"endColumn":18},{"ruleId":"140","severity":1,"message":"149","line":4,"column":10,"nodeType":"142","messageId":"143","endLine":4,"endColumn":14},{"ruleId":"140","severity":1,"message":"150","line":7,"column":8,"nodeType":"142","messageId":"143","endLine":7,"endColumn":11},{"ruleId":"140","severity":1,"message":"151","line":6,"column":9,"nodeType":"142","messageId":"143","endLine":6,"endColumn":20},{"ruleId":"140","severity":1,"message":"152","line":7,"column":8,"nodeType":"142","messageId":"143","endLine":7,"endColumn":14},{"ruleId":"140","severity":1,"message":"153","line":8,"column":9,"nodeType":"142","messageId":"143","endLine":8,"endColumn":16},{"ruleId":"154","severity":1,"message":"155","line":76,"column":33,"nodeType":"156","endLine":76,"endColumn":111},{"ruleId":"154","severity":1,"message":"155","line":93,"column":33,"nodeType":"156","endLine":93,"endColumn":111},{"ruleId":"154","severity":1,"message":"155","line":110,"column":33,"nodeType":"156","endLine":110,"endColumn":111},{"ruleId":"154","severity":1,"message":"155","line":127,"column":33,"nodeType":"156","endLine":127,"endColumn":111},{"ruleId":"154","severity":1,"message":"155","line":144,"column":33,"nodeType":"156","endLine":144,"endColumn":111},{"ruleId":"154","severity":1,"message":"155","line":163,"column":37,"nodeType":"156","endLine":164,"endColumn":144},{"ruleId":"154","severity":1,"message":"155","line":178,"column":37,"nodeType":"156","endLine":179,"endColumn":144},{"ruleId":"154","severity":1,"message":"155","line":244,"column":25,"nodeType":"156","endLine":244,"endColumn":209},{"ruleId":"154","severity":1,"message":"155","line":249,"column":29,"nodeType":"156","endLine":249,"endColumn":87},{"ruleId":"154","severity":1,"message":"155","line":266,"column":25,"nodeType":"156","endLine":266,"endColumn":37},{"ruleId":"154","severity":1,"message":"155","line":291,"column":25,"nodeType":"156","endLine":292,"endColumn":180},{"ruleId":"154","severity":1,"message":"155","line":295,"column":25,"nodeType":"156","endLine":296,"endColumn":223},{"ruleId":"154","severity":1,"message":"155","line":419,"column":17,"nodeType":"156","endLine":419,"endColumn":46},{"ruleId":"157","severity":1,"message":"158","line":420,"column":34,"nodeType":"156","endLine":420,"endColumn":133},{"ruleId":"159","severity":1,"message":"160","line":471,"column":21,"nodeType":"156","endLine":472,"endColumn":33},{"ruleId":"154","severity":1,"message":"155","line":471,"column":21,"nodeType":"156","endLine":472,"endColumn":33},{"ruleId":"161","severity":1,"message":"162","line":477,"column":25,"nodeType":"156","endLine":480,"endColumn":27},{"ruleId":"159","severity":1,"message":"160","line":515,"column":21,"nodeType":"156","endLine":516,"endColumn":33},{"ruleId":"154","severity":1,"message":"155","line":515,"column":21,"nodeType":"156","endLine":516,"endColumn":33},{"ruleId":"161","severity":1,"message":"162","line":520,"column":21,"nodeType":"156","endLine":523,"endColumn":23},{"ruleId":"163","replacedBy":"164"},{"ruleId":"165","replacedBy":"166"},{"ruleId":"163","replacedBy":"167"},{"ruleId":"165","replacedBy":"168"},{"ruleId":"140","severity":1,"message":"169","line":53,"column":7,"nodeType":"142","messageId":"143","endLine":53,"endColumn":38},{"ruleId":"170","severity":1,"message":"171","line":119,"column":8,"nodeType":"172","endLine":119,"endColumn":51,"suggestions":"173"},{"ruleId":"140","severity":1,"message":"174","line":2,"column":9,"nodeType":"142","messageId":"143","endLine":2,"endColumn":16},{"ruleId":"140","severity":1,"message":"175","line":5,"column":9,"nodeType":"142","messageId":"143","endLine":5,"endColumn":23},{"ruleId":"140","severity":1,"message":"176","line":5,"column":25,"nodeType":"142","messageId":"143","endLine":5,"endColumn":44},{"ruleId":"140","severity":1,"message":"177","line":6,"column":9,"nodeType":"142","messageId":"143","endLine":6,"endColumn":22},{"ruleId":"140","severity":1,"message":"178","line":7,"column":9,"nodeType":"142","messageId":"143","endLine":7,"endColumn":21},{"ruleId":"163","replacedBy":"179"},{"ruleId":"165","replacedBy":"180"},{"ruleId":"140","severity":1,"message":"181","line":6,"column":5,"nodeType":"142","messageId":"143","endLine":6,"endColumn":14},{"ruleId":"140","severity":1,"message":"182","line":7,"column":5,"nodeType":"142","messageId":"143","endLine":7,"endColumn":16},{"ruleId":"140","severity":1,"message":"183","line":7,"column":18,"nodeType":"142","messageId":"143","endLine":7,"endColumn":32},{"ruleId":"140","severity":1,"message":"184","line":9,"column":5,"nodeType":"142","messageId":"143","endLine":9,"endColumn":12},{"ruleId":"140","severity":1,"message":"185","line":10,"column":5,"nodeType":"142","messageId":"143","endLine":10,"endColumn":14},{"ruleId":"140","severity":1,"message":"186","line":16,"column":9,"nodeType":"142","messageId":"143","endLine":16,"endColumn":16},{"ruleId":"140","severity":1,"message":"187","line":17,"column":9,"nodeType":"142","messageId":"143","endLine":17,"endColumn":14},{"ruleId":"140","severity":1,"message":"188","line":18,"column":8,"nodeType":"142","messageId":"143","endLine":18,"endColumn":17},{"ruleId":"157","severity":1,"message":"158","line":137,"column":33,"nodeType":"156","endLine":137,"endColumn":84},{"ruleId":"140","severity":1,"message":"189","line":1,"column":28,"nodeType":"142","messageId":"143","endLine":1,"endColumn":36},{"ruleId":"140","severity":1,"message":"190","line":3,"column":49,"nodeType":"142","messageId":"143","endLine":3,"endColumn":55},{"ruleId":"140","severity":1,"message":"191","line":3,"column":57,"nodeType":"142","messageId":"143","endLine":3,"endColumn":68},{"ruleId":"140","severity":1,"message":"192","line":3,"column":81,"nodeType":"142","messageId":"143","endLine":3,"endColumn":87},{"ruleId":"140","severity":1,"message":"193","line":3,"column":89,"nodeType":"142","messageId":"143","endLine":3,"endColumn":101},{"ruleId":"140","severity":1,"message":"194","line":13,"column":8,"nodeType":"142","messageId":"143","endLine":13,"endColumn":15},{"ruleId":"140","severity":1,"message":"195","line":2,"column":30,"nodeType":"142","messageId":"143","endLine":2,"endColumn":40},{"ruleId":"140","severity":1,"message":"196","line":73,"column":11,"nodeType":"142","messageId":"143","endLine":73,"endColumn":26},{"ruleId":"170","severity":1,"message":"197","line":165,"column":8,"nodeType":"172","endLine":165,"endColumn":23,"suggestions":"198"},{"ruleId":"170","severity":1,"message":"199","line":184,"column":8,"nodeType":"172","endLine":184,"endColumn":34,"suggestions":"200"},{"ruleId":"170","severity":1,"message":"201","line":208,"column":8,"nodeType":"172","endLine":208,"endColumn":24,"suggestions":"202"},{"ruleId":"170","severity":1,"message":"203","line":235,"column":8,"nodeType":"172","endLine":235,"endColumn":18,"suggestions":"204"},{"ruleId":"140","severity":1,"message":"205","line":248,"column":11,"nodeType":"142","messageId":"143","endLine":248,"endColumn":31},{"ruleId":"163","replacedBy":"206"},{"ruleId":"165","replacedBy":"207"},{"ruleId":"140","severity":1,"message":"208","line":2,"column":12,"nodeType":"142","messageId":"143","endLine":2,"endColumn":24},{"ruleId":"163","replacedBy":"209"},{"ruleId":"165","replacedBy":"210"},"@typescript-eslint/no-unused-vars","'logo' is defined but never used.","Identifier","unusedVar","array-callback-return","Array.prototype.map() expects a value to be returned at the end of arrow function.","ArrowFunctionExpression","expectedAtEnd","'classNames' is defined but never used.","'Link' is defined but never used.","'css' is defined but never used.","'LatLngTuple' is defined but never used.","'Moment' is defined but never used.","'FaCross' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","jsx-a11y/anchor-has-content","Anchors must have content and the content must be accessible by a screen reader.","jsx-a11y/img-redundant-alt","Redundant alt attribute. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.","no-native-reassign",["211"],"no-negated-in-lhs",["212"],["211"],["212"],"'LeafletPopup' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'map'. Either include it or remove the dependency array.","ArrayExpression",["213"],"'Sidebar' is defined but never used.","'GiAerialSignal' is defined but never used.","'IoCloudOfflineSharp' is defined but never used.","'VscListFilter' is defined but never used.","'GiRadarSweep' is defined but never used.",["211"],["212"],"'GrRefresh' is defined but never used.","'IoMdRefresh' is defined but never used.","'IoRefreshSharp' is defined but never used.","'MdLabel' is defined but never used.","'MdRefresh' is defined but never used.","'GPSData' is defined but never used.","'Popup' is defined but never used.","'bus_image' is defined but never used.","'useState' is defined but never used.","'Marker' is defined but never used.","'MarkerProps' is defined but never used.","'useMap' is defined but never used.","'useMapEvents' is defined but never used.","'blurMap' is defined but never used.","'DetailCard' is defined but never used.","'fitMarkersState' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'getFilterObject', 'getVehicles', 'realtimeVehiclesPosition', and 'vehicles.length'. Either include them or remove the dependency array.",["214"],"React Hook useEffect has missing dependencies: 'intervalRealtime', 'setVehiclesReady', and 'vehiclesReady'. Either include them or remove the dependency array.",["215"],"React Hook useEffect has missing dependencies: 'getFilterObject', 'intervalRealtime', 'setRealtimeVehiclesPosition', 'setVehicleDetails', 'setVehicles', and 'setVehiclesReady'. Either include them or remove the dependency array.",["216"],"React Hook useEffect has missing dependencies: 'map', 'setVehicleDetails', and 'vehicleDetails'. Either include them or remove the dependency array.",["217"],"'collapseVehiclesList' is assigned a value but never used.",["211"],["212"],"'LeafletEvent' is defined but never used.",["211"],["212"],"no-global-assign","no-unsafe-negation",{"desc":"218","fix":"219"},{"desc":"220","fix":"221"},{"desc":"222","fix":"223"},{"desc":"224","fix":"225"},{"desc":"226","fix":"227"},"Update the dependencies array to be: [map, permanentLabels, realtimeVehiclesPosition]",{"range":"228","text":"229"},"Update the dependencies array to be: [getFilterObject, getVehicles, realtimeVehiclesPosition, vehicles.length, vehiclesReady]",{"range":"230","text":"231"},"Update the dependencies array to be: [intervalRealtime, realtimeVehiclesPosition, setVehiclesReady, vehiclesReady]",{"range":"232","text":"233"},"Update the dependencies array to be: [filterVehicles, getFilterObject, intervalRealtime, setRealtimeVehiclesPosition, setVehicleDetails, setVehicles, setVehiclesReady]",{"range":"234","text":"235"},"Update the dependencies array to be: [map, setVehicleDetails, vehicleDetails, vehicles]",{"range":"236","text":"237"},[5352,5395],"[map, permanentLabels, realtimeVehiclesPosition]",[5485,5500],"[getFilterObject, getVehicles, realtimeVehiclesPosition, vehicles.length, vehiclesReady]",[6163,6189],"[intervalRealtime, realtimeVehiclesPosition, setVehiclesReady, vehiclesReady]",[6817,6833],"[filterVehicles, getFilterObject, intervalRealtime, setRealtimeVehiclesPosition, setVehicleDetails, setVehicles, setVehiclesReady]",[7897,7907],"[map, setVehicleDetails, vehicleDetails, vehicles]"]