Skip to content

Commit 6c401fd

Browse files
committed
fix: correct SELF_HOST environment variable reference in utils and enhance EvolutionPage for online mode
1 parent 46f9c10 commit 6c401fd

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

apps/platform/src/app/evaluation/page.tsx

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import React from "react";
33
import { EvolutionContent } from "./_components/evolution-view";
44
import { Navbar } from "@/components/core/navbar";
55
import { Footer } from "@/components/core/footer";
6+
import { serverSession } from "@/lib/data";
7+
import { SELF_HOST } from "@/lib/utils";
8+
import Link from "next/link";
9+
import { Button } from "@/components/ui/button";
610

711
async function fetchData() {
812
try {
@@ -80,9 +84,45 @@ async function fetchData() {
8084

8185
export default async function EvolutionPage() {
8286
const data = await fetchData();
87+
88+
if (!SELF_HOST) {
89+
return (
90+
<div className="h-screen">
91+
<Navbar transparent={false} />
92+
<div className="flex items-center justify-center h-[80vh] p-8 text-center flex-col gap-4">
93+
<p className="text-xl">
94+
We currently do not support this feature in online mode.
95+
<br />
96+
Please use the self-hosted version of KBNET to access this feature.
97+
<br />
98+
</p>
99+
<Link href="/pad">
100+
<Button>Go to Pad</Button>
101+
</Link>
102+
</div>
103+
<Footer />
104+
</div>
105+
);
106+
}
107+
83108
if (!data) {
84-
return <div>Error fetching evolution data</div>;
109+
return (
110+
<div className="h-screen">
111+
<Navbar transparent={false} />
112+
<div className="flex items-center justify-center h-[80vh] p-8 text-center flex-col gap-4">
113+
<p className="text-xl">
114+
No evaluations found. Please create a map and wait for the
115+
evaluation to see results.
116+
</p>
117+
<Link href="/pad">
118+
<Button>Go to Pad</Button>
119+
</Link>
120+
</div>
121+
<Footer />
122+
</div>
123+
);
85124
}
125+
86126
return (
87127
<div>
88128
<Navbar transparent={false} />

apps/platform/src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const secondaryFonts = Delicious_Handrawn({
2828
variable: "--font-heading",
2929
});
3030

31-
export const SELF_HOST = process.env.NEXT_PUBLIC_SELF_HOST === "true";
31+
export const SELF_HOST = process.env.NEXT_PUBLIC_SELF_HOSTED === "true";
3232

3333
export const SERVER_URL =
3434
process.env.NEXT_PUBLIC_SERVER_URL || "http://localhost:8000";

0 commit comments

Comments
 (0)