mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: env script
This commit is contained in:
parent
5d01cd15b4
commit
66251f6cac
@ -8,7 +8,7 @@ import getEnv from "@/lib/env-entry";
|
|||||||
|
|
||||||
export default function ServerListClient() {
|
export default function ServerListClient() {
|
||||||
const { data } = useSWR<ServerApi>("/api/server", nezhaFetcher, {
|
const { data } = useSWR<ServerApi>("/api/server", nezhaFetcher, {
|
||||||
refreshInterval: Number(getEnv('NEXT_PUBLIC_NezhaFetchInterval')) || 2000,
|
refreshInterval: Number(getEnv("NEXT_PUBLIC_NezhaFetchInterval")) || 2000,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
|
@ -6,6 +6,7 @@ import { ThemeProvider } from "next-themes";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Viewport } from "next";
|
import { Viewport } from "next";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
import { PublicEnvScript } from "next-runtime-env";
|
||||||
|
|
||||||
const fontSans = FontSans({
|
const fontSans = FontSans({
|
||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
@ -37,6 +38,9 @@ interface RootLayoutProps {
|
|||||||
export default function RootLayout({ children }: RootLayoutProps) {
|
export default function RootLayout({ children }: RootLayoutProps) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning>
|
<html lang="en" suppressHydrationWarning>
|
||||||
|
<head>
|
||||||
|
<PublicEnvScript />
|
||||||
|
</head>
|
||||||
<body
|
<body
|
||||||
className={cn(
|
className={cn(
|
||||||
"min-h-screen bg-background font-sans antialiased",
|
"min-h-screen bg-background font-sans antialiased",
|
||||||
|
@ -6,7 +6,6 @@ import { error } from "console";
|
|||||||
import getEnv from "./env-entry";
|
import getEnv from "./env-entry";
|
||||||
|
|
||||||
export async function GetNezhaData() {
|
export async function GetNezhaData() {
|
||||||
|
|
||||||
var nezhaBaseUrl = getEnv("NezhaBaseUrl");
|
var nezhaBaseUrl = getEnv("NezhaBaseUrl");
|
||||||
if (!nezhaBaseUrl) {
|
if (!nezhaBaseUrl) {
|
||||||
error("NezhaBaseUrl is not set");
|
error("NezhaBaseUrl is not set");
|
||||||
|
Loading…
Reference in New Issue
Block a user