mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: disable prefetch
This commit is contained in:
parent
c48c2e385b
commit
14b9cad856
@ -1,31 +1,13 @@
|
||||
import ServerList from "../../../components/ServerList";
|
||||
import ServerOverview from "../../../components/ServerOverview";
|
||||
import getEnv from "../../../lib/env-entry";
|
||||
import { GetNezhaData } from "../../../lib/serverFetch";
|
||||
import { SWRConfig } from "swr";
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
|
||||
const disablePrefetch = getEnv("ServerDisablePrefetch") === "true";
|
||||
const fallback = disablePrefetch
|
||||
? {}
|
||||
: {
|
||||
"/api/server": GetNezhaData(),
|
||||
};
|
||||
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<SWRConfig
|
||||
value={{
|
||||
fallback: fallback,
|
||||
}}
|
||||
>
|
||||
<div className="mx-auto grid w-full max-w-5xl gap-4 md:gap-6">
|
||||
<ServerOverview />
|
||||
<ServerList />
|
||||
</div>
|
||||
</SWRConfig>
|
||||
<div className="mx-auto grid w-full max-w-5xl gap-4 md:gap-6">
|
||||
<ServerOverview />
|
||||
<ServerList />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user