forked from github-starred/komodo
fix log to bottom
This commit is contained in:
@@ -25,10 +25,9 @@ import { Card, CardHeader } from "@ui/card";
|
||||
import { RunBuild } from "../build/actions";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@ui/tabs";
|
||||
import { DeploymentConfig } from "./config";
|
||||
import { atomWithStorage } from "jotai/utils";
|
||||
import { useAtom } from "jotai";
|
||||
import { useState } from "react";
|
||||
|
||||
const configOrLog = atomWithStorage("config-or-log-v1", "Config");
|
||||
// const configOrLog = atomWithStorage("config-or-log-v1", "Config");
|
||||
|
||||
export const useDeployment = (id?: string) =>
|
||||
useRead("ListDeployments", {}, { refetchInterval: 5000 }).data?.find(
|
||||
@@ -36,7 +35,8 @@ export const useDeployment = (id?: string) =>
|
||||
);
|
||||
|
||||
const ConfigOrLog = ({ id }: { id: string }) => {
|
||||
const [view, setView] = useAtom(configOrLog);
|
||||
// const [view, setView] = useAtom(configOrLog);
|
||||
const [view, setView] = useState("Config");
|
||||
const state = useDeployment(id)?.info.state;
|
||||
const logsDisabled =
|
||||
state === undefined ||
|
||||
|
||||
@@ -130,7 +130,11 @@ const NoSearchLogs = (id: string, tail: string, stream: string) => {
|
||||
{ refetchInterval: 30000 }
|
||||
);
|
||||
return {
|
||||
Log: <Log log={log} stream={stream as "stdout" | "stderr"} />,
|
||||
Log: (
|
||||
<div className="relative">
|
||||
<Log log={log} stream={stream as "stdout" | "stderr"} />
|
||||
</div>
|
||||
),
|
||||
refetch,
|
||||
stderr: !!log?.stderr,
|
||||
};
|
||||
@@ -178,7 +182,7 @@ const Log = ({
|
||||
className="-scroll-mt-24"
|
||||
/>
|
||||
</div>
|
||||
<Button className="absolute bottom-4 right-4" onClick={scroll}>
|
||||
<Button variant="secondary" className="absolute top-4 right-4" onClick={scroll}>
|
||||
<ChevronDown className="h-4 w-4" />
|
||||
</Button>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user