feat: Meldung für Events darstellen (Kalibrierung, TDR ud Schleifenmessung)
This commit is contained in:
@@ -11,6 +11,9 @@ import Header from "@/components/header/Header";
|
||||
import Navigation from "@/components/navigation/Navigation";
|
||||
import Footer from "@/components/footer/Footer";
|
||||
import { store } from "@/redux/store";
|
||||
import Script from "next/script";
|
||||
import DeviceEventsBridge from "@/components/common/DeviceEventsBridge";
|
||||
import GlobalActivityOverlay from "@/components/common/GlobalActivityOverlay";
|
||||
|
||||
// Thunks importieren
|
||||
import { getKueDataThunk } from "@/redux/thunks/getKueDataThunk";
|
||||
@@ -40,7 +43,18 @@ import "@/styles/globals.css";
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
{/* Load global data: dev -> API mock JS; prod -> real device JS from public */}
|
||||
{process.env.NODE_ENV === "development" ? (
|
||||
<Script
|
||||
src="/api/cpl/kabelueberwachungAPIHandler"
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
) : (
|
||||
<Script src="/CPL/SERVICE/kueData.js" strategy="afterInteractive" />
|
||||
)}
|
||||
<AppContent Component={Component} pageProps={pageProps} />
|
||||
{/* Bridge window events -> Redux (works across all pages) */}
|
||||
<DeviceEventsBridge />
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
@@ -146,6 +160,7 @@ function AppContent({
|
||||
)}
|
||||
<Component {...pageProps} />
|
||||
<ToastContainer position="top-right" autoClose={3000} />
|
||||
<GlobalActivityOverlay />
|
||||
</main>
|
||||
</div>
|
||||
<Footer />
|
||||
|
||||
@@ -18,6 +18,9 @@ export default async function handler(
|
||||
|
||||
try {
|
||||
const data = await fs.readFile(filePath, "utf-8");
|
||||
res.setHeader("Content-Type", "application/javascript; charset=utf-8");
|
||||
// Prevent caching during development
|
||||
res.setHeader("Cache-Control", "no-store, max-age=0");
|
||||
res.status(200).send(data);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user