Datasheet Markdown
This commit is contained in:
@@ -49,29 +49,25 @@ export const useMapComponentState = () => {
|
||||
|
||||
const fetchDeviceData = async () => {
|
||||
try {
|
||||
const protocol = window.location.protocol;
|
||||
const host = window.location.hostname;
|
||||
const port = host === "10.10.0.70" ? "3000" : "80";
|
||||
|
||||
//const apiBaseUrl = `http://${host}:${port}/talas5/ClientData/WebServiceMap.asmx`;
|
||||
const apiBaseUrl = `http://10.10.0.70/talas5/ClientData/WebServiceMap.asmx`;
|
||||
// WebService läuft immer auf Port 80 (kein :port anhängen)
|
||||
const apiBaseUrl = `${protocol}//${host}/talas5/ClientData/WebServiceMap.asmx`;
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const idMap = params.get("m");
|
||||
//console.log("idMap:", idMap);
|
||||
const url = `${apiBaseUrl}/GisStationsStatic?idMap=${idMap}`;
|
||||
|
||||
//console.log("URL:", url);
|
||||
const url = `${apiBaseUrl}/GisStationsStatic?idMap=${idMap}`;
|
||||
console.log("🌐 Geräte-API:", url);
|
||||
|
||||
const response = await fetch(url);
|
||||
|
||||
// 🔄 KORREKT: Webservice liefert direkt JSON
|
||||
const data = await response.json();
|
||||
//console.log("Standort- und Gerätedaten:", data);
|
||||
|
||||
setLocationDeviceData(data.Points || []);
|
||||
if (data.Points && data.Points.length > 0) {
|
||||
setDeviceName(data.Points[0].LD_Name);
|
||||
//console.log("Gerätename:", data.Points[0].LD_Name);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("❌ Fehler beim Abrufen der Gerätedaten:", error);
|
||||
|
||||
Reference in New Issue
Block a user