add: implement Prioritätskonfiguration fetchPriorityConfig function
This commit is contained in:
@@ -49,6 +49,22 @@ const plusRoundIcon = L.icon({
|
||||
});
|
||||
|
||||
const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const [priorityConfig, setPriorityConfig] = useState([]);
|
||||
|
||||
const fetchPriorityConfig = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/talas_v5_DB/priorityConfig");
|
||||
const data = await response.json();
|
||||
console.log("Prioritätskonfiguration:", data);
|
||||
setPriorityConfig(data);
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Laden der Prioritätskonfiguration:", error);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchPriorityConfig();
|
||||
}, []);
|
||||
/*
|
||||
path.includes("critical") || // Priorität 1
|
||||
path.includes("major") || // Priorität 2
|
||||
@@ -465,10 +481,12 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
|
||||
// Wenn der Pfad das Wort "critical" oder "major" enthält, dann den Marker bouncing options setzen
|
||||
if (
|
||||
path.includes("critical") || // Priorität 1
|
||||
path.includes("major") || // Priorität 2
|
||||
path.includes("minor") || // Priorität 3
|
||||
path.includes("system") // Priorität 4
|
||||
//Stationsausfall
|
||||
path.includes("Stationsausfall") || // Priorität 1, Level 0
|
||||
path.includes("critical") || // Priorität 2, Level 1
|
||||
path.includes("major") || // Priorität 3, Level 2
|
||||
path.includes("minor") || // Priorität 4, Level 3
|
||||
path.includes("system") // Priorität 5, Level 4
|
||||
) {
|
||||
// Setze Bouncing-Optionen
|
||||
marker.setBouncingOptions({
|
||||
@@ -1231,7 +1249,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const { latitude, longitude } = parsePoint(location.position);
|
||||
const poiTypName = poiTypMap.get(location.idPoiTyp) || "Unbekannt";
|
||||
const deviceName = await fetchDeviceNameById(location.idLD);
|
||||
console.log("deviceName:", deviceName); // Das ist in Modal POI hinzufügen
|
||||
//console.log("deviceName:", deviceName); // Das ist in Modal POI hinzufügen
|
||||
|
||||
const canDrag = userRights ? userRights.includes(56) : false;
|
||||
const matchingIcon = poiData.find(
|
||||
|
||||
Reference in New Issue
Block a user