File und Order Struktur wie bai Kai in mockData Verzeichnis
Chart in localhost testen und in die Umgebung development und production
This commit is contained in:
@@ -116,7 +116,7 @@ function Header() {
|
||||
if (environment === "production") {
|
||||
script.src = `/CPL?/CPL/SERVICE/${file}`; // Produktions-Pfad
|
||||
} else {
|
||||
script.src = `/mockData/${file}`; // Entwicklungs-Pfad
|
||||
script.src = `/mockData/SERVICE/${file}`; // Entwicklungs-Pfad
|
||||
}
|
||||
|
||||
script.async = true;
|
||||
|
||||
@@ -47,11 +47,17 @@ function Kue705FO({
|
||||
const handleCloseChartModal = () => {
|
||||
setShowChartModal(false);
|
||||
};
|
||||
|
||||
const environment = process.env.NODE_ENV || "production";
|
||||
let fileData;
|
||||
// Daten laden und den TDR-Chart erstellen
|
||||
const loadTDRChartData = () => {
|
||||
const slot = slotIndex;
|
||||
const fileData = `../cpl?lastTDR/slot${slot}.json`; // TDR-Daten je nach Slot laden
|
||||
//const fileData = `../cpl?lastTDR/slot${slot}.json`; // TDR-Daten je nach Slot laden
|
||||
if (environment === "production") {
|
||||
fileData = `CPL?/SERVICE/lastTDR/slot${slot}.json`; // Produktions-Pfad
|
||||
} else {
|
||||
fileData = `/mockData/lastTDR/slot${slot}.json`; // Mock-Daten-Pfad für Entwicklung
|
||||
}
|
||||
|
||||
fetch(fileData)
|
||||
.then((response) => response.json())
|
||||
@@ -67,7 +73,12 @@ function Kue705FO({
|
||||
// Daten laden und den Schleifenmessungs-Chart erstellen
|
||||
const loadLoopChartData = () => {
|
||||
const slot = slotIndex;
|
||||
const fileData = `../cpl?4000values/slot${slot}.json`; // Schleifenmessdaten je nach Slot laden
|
||||
//const fileData = `../cpl?4000values/slot${slot}.json`; // Schleifenmessdaten je nach Slot laden
|
||||
if (environment === "production") {
|
||||
fileData = `CPL?/SERVICE/4000values/slot${slot}.json`; // Produktions-Pfad
|
||||
} else {
|
||||
fileData = `/mockData/4000values/slot${slot}.json`; // Mock-Daten-Pfad für Entwicklung
|
||||
}
|
||||
|
||||
fetch(fileData)
|
||||
.then((response) => response.json())
|
||||
@@ -146,7 +157,7 @@ function Kue705FO({
|
||||
// Funktion zum Erstellen des TDR-Charts
|
||||
const createTDRChart = (dataTDR) => {
|
||||
const ctx = document.getElementById("myChart").getContext("2d");
|
||||
|
||||
console.log(`TDR-Daten für Slot ${slotIndex + 1}:`, dataTDR);
|
||||
new Chart(ctx, {
|
||||
type: "line",
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user