81 lines
2.6 KiB
TypeScript
81 lines
2.6 KiB
TypeScript
import type { Metadata } from "next";
|
|
|
|
import { cookies } from "next/headers";
|
|
import "./globals.css";
|
|
import crypto from "crypto";
|
|
|
|
import type { Viewport } from "next";
|
|
|
|
export const viewport: Viewport = {
|
|
themeColor: "#00ff88",
|
|
};
|
|
|
|
export const metadata: Metadata = {
|
|
title: "JUMPA.ID | Enterprise Gateway",
|
|
description: "Secure SaaS B2B Ecosystem",
|
|
appleWebApp: {
|
|
capable: true,
|
|
statusBarStyle: "black-translucent",
|
|
title: "JUMPA.ID",
|
|
},
|
|
};
|
|
|
|
import { OmniSyncProvider } from "@/components/OmniSyncProvider";
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const cookieStore = await cookies();
|
|
const locale = cookieStore.get('NEXT_LOCALE')?.value || 'id';
|
|
|
|
// TSM Versioning Format: [TSM.ID].hh.mm.ss.DD.MM.YYYY.XXXX
|
|
const date = new Date();
|
|
const format2 = (n: number) => n.toString().padStart(2, '0');
|
|
const hh = format2(date.getUTCHours());
|
|
const mm = format2(date.getUTCMinutes());
|
|
const ss = format2(date.getUTCSeconds());
|
|
const DD = format2(date.getUTCDate());
|
|
const MM = format2(date.getUTCMonth() + 1);
|
|
const YYYY = date.getUTCFullYear();
|
|
const XXXX = crypto.randomBytes(2).toString('hex').toUpperCase();
|
|
const tsmVersion = `[TSM.ID].${hh}.${mm}.${ss}.${DD}.${MM}.${YYYY}.${XXXX}`;
|
|
|
|
return (
|
|
<html lang={locale}>
|
|
<head>
|
|
<link rel="apple-touch-icon" href="/icon512_maskable.png" />
|
|
<script dangerouslySetInnerHTML={{__html: `
|
|
// PKX NUCLEAR CACHE BUSTER: Unregister all Service Workers & clear all caches
|
|
if ('serviceWorker' in navigator) {
|
|
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
|
for (var i = 0; i < registrations.length; i++) {
|
|
registrations[i].unregister();
|
|
}
|
|
});
|
|
}
|
|
if ('caches' in window) {
|
|
caches.keys().then(function(names) {
|
|
for (var i = 0; i < names.length; i++) {
|
|
caches.delete(names[i]);
|
|
}
|
|
});
|
|
}
|
|
`}} />
|
|
</head>
|
|
<body className={`antialiased font-sans bg-[#050B14] text-white`}>
|
|
<OmniSyncProvider initialLocale={locale as any}>
|
|
{children}
|
|
{/* TSM PERMANENT WATERMARK */}
|
|
<div className="fixed bottom-1 right-1 z-[9999] opacity-30 pointer-events-none select-none">
|
|
<span className="text-[8px] font-mono text-white tracking-widest drop-shadow-[0_0_5px_rgba(255,255,255,0.8)]">
|
|
{tsmVersion}
|
|
</span>
|
|
</div>
|
|
</OmniSyncProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|