Littwin config
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_HOST=192.168.10.58
|
#DB_HOST=192.168.10.58
|
||||||
DB_USER=root
|
DB_USER=root
|
||||||
DB_PASSWORD="root#$"
|
DB_PASSWORD="root#$"
|
||||||
DB_NAME=talas_v5
|
DB_NAME=talas_v5
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
|||||||
const zoomTrigger = useRecoilValue(zoomTriggerState);
|
const zoomTrigger = useRecoilValue(zoomTriggerState);
|
||||||
const offlineTileLayer = "/mapTiles/{z}/{x}/{y}.png";
|
const offlineTileLayer = "/mapTiles/{z}/{x}/{y}.png";
|
||||||
//const onlineTileLayer = "/mapTiles/{z}/{x}/{y}.png";
|
//const onlineTileLayer = "/mapTiles/{z}/{x}/{y}.png";
|
||||||
const onlineTileLayer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
//const onlineTileLayer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
||||||
//const onlineTileLayer = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Talas_v5 Server
|
const onlineTileLayer = "http://10.10.0.13:3000/mapTiles/{z}/{x}/{y}.png"; //Talas_v5 Server
|
||||||
// Create map layers
|
// Create map layers
|
||||||
const TALAS = new L.layerGroup();
|
const TALAS = new L.layerGroup();
|
||||||
const ECI = new L.layerGroup();
|
const ECI = new L.layerGroup();
|
||||||
@@ -898,6 +898,7 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
|||||||
console.log("poiTypName in poiLayer:", poiTypName);
|
console.log("poiTypName in poiLayer:", poiTypName);
|
||||||
//console.log("location.idPoiTyp poiLayer:", location.idPoiTyp);
|
//console.log("location.idPoiTyp poiLayer:", location.idPoiTyp);
|
||||||
console.log("location.idPoiTyp poiLayer:", location);
|
console.log("location.idPoiTyp poiLayer:", location);
|
||||||
|
console.log("location.idPoiTyp:", location.idPoiTyp);
|
||||||
|
|
||||||
const marker = L.marker([latitude, longitude], {
|
const marker = L.marker([latitude, longitude], {
|
||||||
icon: L.icon({
|
icon: L.icon({
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
|||||||
setPoiTypeId(poiData.idPoiTyp);
|
setPoiTypeId(poiData.idPoiTyp);
|
||||||
|
|
||||||
setDescription(poiData.description);
|
setDescription(poiData.description);
|
||||||
|
setDeviceName(poiData.idLD);
|
||||||
console.log("Loaded POI Data for editing:", poiData);
|
console.log("Loaded POI Data for editing:", poiData);
|
||||||
console.log("POI ID:", poiData.idPoi);
|
console.log("POI ID:", poiData.idPoi);
|
||||||
console.log("POI Name:", poiData.name);
|
console.log("POI Name:", poiData.name);
|
||||||
@@ -110,8 +111,9 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
//console.log("Standort- und Gerätedaten:", data);
|
//console.log("Standort- und Gerätedaten:", data);
|
||||||
setLocationDeviceData(data);
|
setLocationDeviceData(data);
|
||||||
if (data.length > 0) {
|
if (poiData && poiData.idLD) {
|
||||||
setDeviceName(data[0].name); // Set initial device name
|
const selectedDevice = data.find(device => device.id === poiData.idLD);
|
||||||
|
setDeviceName(selectedDevice ? selectedDevice.id : data[0].id); // Hier wird die ID als initialer Zustand gesetzt
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
@@ -144,7 +146,7 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
|||||||
name: name,
|
name: name,
|
||||||
description: description,
|
description: description,
|
||||||
idPoiTyp: poiTypeId,
|
idPoiTyp: poiTypeId,
|
||||||
idLD: idLD,
|
idLD: deviceName,
|
||||||
//idLD: parseInt(deviceName, 10), // Konvertieren in eine Ganzzahl
|
//idLD: parseInt(deviceName, 10), // Konvertieren in eine Ganzzahl
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -198,7 +200,7 @@ const PoiUpdateModal = ({ onClose, poiData }) => {
|
|||||||
className="block p-2 w-full border-2 border-gray-200 rounded-md text-sm"
|
className="block p-2 w-full border-2 border-gray-200 rounded-md text-sm"
|
||||||
>
|
>
|
||||||
{locationDeviceData.map((device, index) => (
|
{locationDeviceData.map((device, index) => (
|
||||||
<option key={index} value={device.name}>
|
<option key={index} value={device.id}>
|
||||||
{device.name}
|
{device.name}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ if (typeof window !== "undefined") {
|
|||||||
|
|
||||||
// Konstruktion von URLs, die auf spezifische Ressourcen auf dem Server zeigen
|
// Konstruktion von URLs, die auf spezifische Ressourcen auf dem Server zeigen
|
||||||
//http://localhost:3000/?m=10&u=485
|
//http://localhost:3000/?m=10&u=485
|
||||||
/* mapGisStationsStaticDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStaticDistrict?idMap=${c}&idUser=${user}`; //idMap: 10, idUser: 484
|
mapGisStationsStaticDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStaticDistrict?idMap=${c}&idUser=${user}`; //idMap: 10, idUser: 484
|
||||||
mapGisStationsStatusDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStatusDistrict?idMap=${c}&idUser=${user}`;
|
mapGisStationsStatusDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStatusDistrict?idMap=${c}&idUser=${user}`;
|
||||||
mapGisStationsMeasurementsUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsMeasurements?idMap=${c}`;
|
mapGisStationsMeasurementsUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsMeasurements?idMap=${c}`;
|
||||||
mapGisSystemStaticUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic?idMap=${c}&idUser=${user}`;
|
mapGisSystemStaticUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic?idMap=${c}&idUser=${user}`;
|
||||||
mapDataIconUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`; */
|
mapDataIconUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`;
|
||||||
|
|
||||||
mapGisStationsStaticDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStaticDistrict`;
|
/* mapGisStationsStaticDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStaticDistrict`;
|
||||||
mapGisStationsStatusDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStatusDistrict`;
|
mapGisStationsStatusDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStatusDistrict`;
|
||||||
mapGisStationsMeasurementsUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsMeasurements`;
|
mapGisStationsMeasurementsUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsMeasurements`;
|
||||||
mapGisSystemStaticUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic`;
|
mapGisSystemStaticUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic`;
|
||||||
mapDataIconUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`;
|
mapDataIconUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`; */
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export der definierten Variablen und URLs, damit sie in anderen Teilen der Anwendung verwendet werden können
|
// Export der definierten Variablen und URLs, damit sie in anderen Teilen der Anwendung verwendet werden können
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
import { createProxyMiddleware } from "http-proxy-middleware";
|
import { createProxyMiddleware } from "http-proxy-middleware";
|
||||||
|
|
||||||
export default createProxyMiddleware({
|
export default createProxyMiddleware({
|
||||||
target: "http://192.168.10.58:3001",
|
//target: "http://192.168.10.58:3001",
|
||||||
// target: "http://10.10.0.13", // Ziel-URL des Proxys
|
target: "http://10.10.0.13", // Ziel-URL des Proxys
|
||||||
//target: "http://192.168.10.187:3000", // Ziel-URL des Proxys
|
//target: "http://192.168.10.187:3000", // Ziel-URL des Proxys
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
|||||||
@@ -1,24 +1,20 @@
|
|||||||
// pages/api/readPoiTyp.js
|
// pages/api/readPoiTyp.js
|
||||||
import mysql from "mysql";
|
import mysql from 'mysql';
|
||||||
|
|
||||||
const dbConfig = {
|
const pool = mysql.createPool({
|
||||||
|
connectionLimit: 10,
|
||||||
host: process.env.DB_HOST,
|
host: process.env.DB_HOST,
|
||||||
user: process.env.DB_USER,
|
user: process.env.DB_USER,
|
||||||
password: process.env.DB_PASSWORD,
|
password: process.env.DB_PASSWORD,
|
||||||
database: process.env.DB_NAME,
|
database: process.env.DB_NAME,
|
||||||
port: process.env.DB_PORT,
|
port: process.env.DB_PORT,
|
||||||
};
|
});
|
||||||
|
|
||||||
export default function handler(req, res) {
|
export default function handler(req, res) {
|
||||||
if (req.method === "GET") {
|
if (req.method === "GET") {
|
||||||
console.log("Empfangene Query-Parameter:", req.query); // Gibt alle empfangenen Query-Parameter aus
|
const query = "SELECT * FROM poityp";
|
||||||
|
|
||||||
const connection = mysql.createConnection(dbConfig);
|
pool.query(query, (error, results) => {
|
||||||
const query = "SELECT * FROM poityp"; // Vereinfachte Abfrage zum Testen
|
|
||||||
|
|
||||||
connection.query(query, (error, results) => {
|
|
||||||
connection.end();
|
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error("Fehler beim Abfragen der Datenbank:", error);
|
console.error("Fehler beim Abfragen der Datenbank:", error);
|
||||||
return res.status(500).json({ error: "Ein Fehler ist aufgetreten" });
|
return res.status(500).json({ error: "Ein Fehler ist aufgetreten" });
|
||||||
|
|||||||
Reference in New Issue
Block a user