forked from github-starred/komodo
hide logs when deployment not deployed
This commit is contained in:
@@ -3,6 +3,7 @@ import { Tabs, TabsList, TabsTrigger, TabsContent } from "@ui/tabs";
|
|||||||
import { AlertOctagon, ChevronDown, TerminalSquare } from "lucide-react";
|
import { AlertOctagon, ChevronDown, TerminalSquare } from "lucide-react";
|
||||||
import { useRead } from "@hooks";
|
import { useRead } from "@hooks";
|
||||||
import { Section } from "@layouts/page";
|
import { Section } from "@layouts/page";
|
||||||
|
import { DockerContainerState } from "@monitor/client/dist/types";
|
||||||
|
|
||||||
const to_bottom = (id: string) => () =>
|
const to_bottom = (id: string) => () =>
|
||||||
document
|
document
|
||||||
@@ -19,6 +20,10 @@ export const DeploymentLogs = ({
|
|||||||
{ deployment_id, tail: 200 },
|
{ deployment_id, tail: 200 },
|
||||||
{ refetchInterval: 30000 }
|
{ refetchInterval: 30000 }
|
||||||
).data;
|
).data;
|
||||||
|
const deployments = useRead("ListDeployments", {}).data;
|
||||||
|
const deployment = deployments?.find((d) => d.id === deployment_id);
|
||||||
|
|
||||||
|
if (deployment?.state === DockerContainerState.NotDeployed) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs defaultValue="stdout">
|
<Tabs defaultValue="stdout">
|
||||||
|
|||||||
Reference in New Issue
Block a user