add: You can switch in /config/config.js linesColorApi or GisLinesStatus , locally or remotely API-Endpoint-Function from Webservice
This commit is contained in:
@@ -219,6 +219,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const mapGisStationsMeasurementsUrl = config.mapGisStationsMeasurementsUrl;
|
||||
const mapGisSystemStaticUrl = config.mapGisSystemStaticUrl;
|
||||
const mapDataIconUrl = config.mapDataIconUrl;
|
||||
const webserviceGisLinesStatusUrl = config.webserviceGisLinesStatusUrl;
|
||||
|
||||
const openVersionInfoModal = () => {
|
||||
setShowVersionInfoModal(true);
|
||||
@@ -2085,11 +2086,11 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
useEffect(() => {
|
||||
const fetchLinesColor = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/linesColorApi");
|
||||
const response = await fetch(webserviceGisLinesStatusUrl);
|
||||
const data = await response.json();
|
||||
const colorsByModule = {};
|
||||
data.linesColor.Statis.forEach((item) => {
|
||||
colorsByModule[item.IdModul] = item.Co;
|
||||
data.Statis.forEach((item) => {
|
||||
colorsByModule[item.Modul] = item.PrioColor;
|
||||
});
|
||||
setLineColors(colorsByModule);
|
||||
} catch (error) {
|
||||
|
||||
@@ -11,7 +11,8 @@ let mapGisStationsStaticDistrictUrl,
|
||||
mapGisStationsStatusDistrictUrl,
|
||||
mapGisStationsMeasurementsUrl,
|
||||
mapGisSystemStaticUrl,
|
||||
mapDataIconUrl;
|
||||
mapDataIconUrl,
|
||||
webserviceGisLinesStatusUrl;
|
||||
|
||||
// Prüfen, ob das Code im Browser ausgeführt wird
|
||||
if (typeof window !== "undefined") {
|
||||
@@ -36,6 +37,9 @@ if (typeof window !== "undefined") {
|
||||
mapGisSystemStaticUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic?idMap=${c}&idUser=${user}`;
|
||||
mapDataIconUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GetIconsStatic`;
|
||||
|
||||
//webserviceGisLinesStatusUrl = `http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisLinesStatus?idMap=${c}`;
|
||||
webserviceGisLinesStatusUrl = `http://localhost:3000/api/linesColorApi`;
|
||||
|
||||
//http://10.10.0.13/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic?idMap=12&idUser=484
|
||||
|
||||
/* mapGisStationsStaticDistrictUrl = `${serverURL}/talas5/ClientData/WebserviceMap.asmx/GisStationsStaticDistrict`;
|
||||
@@ -61,4 +65,5 @@ export {
|
||||
mapGisStationsMeasurementsUrl,
|
||||
mapGisSystemStaticUrl,
|
||||
mapDataIconUrl,
|
||||
webserviceGisLinesStatusUrl,
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// http://10.10.0.13/talas5/ClientData/WebServiceMap.asmx/GisStationsStatusDistrict
|
||||
|
||||
export default function handler(req, res) {
|
||||
const linesColor = {
|
||||
/* const linesColor = {
|
||||
Statis: [
|
||||
{
|
||||
IdModul: 1,
|
||||
@@ -32,6 +32,46 @@ export default function handler(req, res) {
|
||||
Icon: 0,
|
||||
},
|
||||
],
|
||||
}; */
|
||||
const linesColor = {
|
||||
Statis: [
|
||||
{
|
||||
IdLD: 25440,
|
||||
Modul: 1,
|
||||
DpName: "KUE01_Ausfall",
|
||||
ModulName: "42 Wippershain Sender",
|
||||
ModulTyp: "nicht vorhanden",
|
||||
Message: "KUEG 01: 42 Wippershain Sender Messwerkausfall kommend",
|
||||
Level: 4,
|
||||
PrioColor: "#FF00FF",
|
||||
PrioName: "system",
|
||||
Value: "?",
|
||||
},
|
||||
{
|
||||
IdLD: 25440,
|
||||
Modul: 3,
|
||||
DpName: "KUE03_Ausfall",
|
||||
ModulName: "42 Solz Sender",
|
||||
ModulTyp: "nicht vorhanden",
|
||||
Message: "KÜG 03: 42 Solz Sender Messwerkausfall kommend",
|
||||
Level: 4,
|
||||
PrioColor: "#FF00FF",
|
||||
PrioName: "system",
|
||||
Value: "?",
|
||||
},
|
||||
{
|
||||
IdLD: 25440,
|
||||
Modul: 4,
|
||||
DpName: "KUE04_Ausfall",
|
||||
ModulName: "42/13 Bad Hersfeld Gaswerk",
|
||||
ModulTyp: "Kü705-FO",
|
||||
Message: "KÜG 04: 42/13 Bad Hersfeld Gaswerk Messwerkausfall kommend",
|
||||
Level: 4,
|
||||
PrioColor: "#FF00FF",
|
||||
PrioName: "system",
|
||||
Value: "?",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
res.status(200).json({ linesColor });
|
||||
|
||||
Reference in New Issue
Block a user