fix(logs): resolve object-child crash and align terminal colors to light theme

This commit is contained in:
2026-06-14 12:46:26 -07:00
parent 4c0754de33
commit 77b24f1a6b
2 changed files with 31 additions and 11 deletions

View File

@@ -44,12 +44,32 @@ export default function LogsPage() {
}),
});
const d = await r.json();
let parsed = "";
try {
parsed = JSON.parse(d.result).logs;
} catch {}
setLogs(parsed || d.result || "No logs returned.");
let out = "";
let obj = d.result;
if (typeof obj === "string") {
try {
obj = JSON.parse(obj);
} catch {}
}
if (typeof obj === "object" && obj !== null) {
if (obj.services) {
out = Object.values(obj.services)
.map((s: any) => s.logs)
.join("\n\n");
} else if (obj.log) {
out = obj.log;
} else if (obj.logs) {
out = obj.logs;
} else {
out = JSON.stringify(obj, null, 2);
}
} else {
out = String(obj || d.error || "No logs available.");
}
setLogs(out || "No logs available.");
} catch {
setLogs("Failed to load logs. Is the container running?");
} finally {
@@ -191,7 +211,7 @@ export default function LogsPage() {
>
<div
style={{
color: "#e5e5e5",
color: THEME.mid,
fontFamily:
"ui-monospace, SFMono-Regular, Menlo, monospace",
fontSize: "0.8rem",

View File

@@ -275,15 +275,15 @@ export const Terminal = ({
<div
ref={containerRef}
className={cn(
"z-0 h-full w-full rounded-xl border border-[#27272a] bg-[#0a0a0a] text-white flex flex-col overflow-hidden",
"z-0 h-full w-full rounded-xl border border-gray-200 bg-white text-gray-900 flex flex-col overflow-hidden",
className,
)}
>
<div className="flex flex-col gap-y-2 border-b border-[#27272a] p-4 shrink-0">
<div className="flex flex-col gap-y-2 border-b border-gray-200 bg-gray-50 p-4 shrink-0">
<div className="flex flex-row gap-x-2">
<div className="h-3 w-3 rounded-full bg-[#ff5f56]"></div>
<div className="h-3 w-3 rounded-full bg-[#ffbd2e]"></div>
<div className="h-3 w-3 rounded-full bg-[#27c93f]"></div>
<div className="h-3 w-3 rounded-full bg-[#ff5f56] border border-[#e0443e]"></div>
<div className="h-3 w-3 rounded-full bg-[#ffbd2e] border border-[#dea123]"></div>
<div className="h-3 w-3 rounded-full bg-[#27c93f] border border-[#1aab29]"></div>
</div>
</div>
<pre className="p-4 flex-1 overflow-auto m-0">