chore: split dev and production deployment env
This commit is contained in:
@@ -1029,6 +1029,22 @@ textarea:focus-visible {
|
||||
color: var(--accent-ink);
|
||||
}
|
||||
|
||||
.environment-badge {
|
||||
background: rgba(20, 20, 24, 0.86);
|
||||
border-radius: 999px;
|
||||
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
font-weight: 750;
|
||||
letter-spacing: 0;
|
||||
line-height: 1;
|
||||
padding: 8px 10px;
|
||||
position: fixed;
|
||||
right: 12px;
|
||||
top: 12px;
|
||||
z-index: 60;
|
||||
}
|
||||
|
||||
.skeleton {
|
||||
animation: pulse 1.2s ease-in-out infinite;
|
||||
background: linear-gradient(90deg, #ececef, #fafafa, #ececef);
|
||||
|
||||
+12
-2
@@ -1,4 +1,5 @@
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import { connection } from "next/server";
|
||||
|
||||
import "./globals.css";
|
||||
|
||||
@@ -24,10 +25,19 @@ export const viewport: Viewport = {
|
||||
themeColor: "#ffffff"
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
||||
export default async function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
||||
await connection();
|
||||
|
||||
const environmentLabel = process.env.APP_ENV_LABEL || "生产环境";
|
||||
|
||||
return (
|
||||
<html lang="zh-CN">
|
||||
<body>{children}</body>
|
||||
<body>
|
||||
<div className="environment-badge" aria-label={`当前环境:${environmentLabel}`}>
|
||||
{environmentLabel}
|
||||
</div>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user