diff --git a/frontend/src/components/header/index.tsx b/frontend/src/components/header/index.tsx index 76a64d6cb..7d23b5497 100644 --- a/frontend/src/components/header/index.tsx +++ b/frontend/src/components/header/index.tsx @@ -53,16 +53,14 @@ export const Header = () => { return (
-
+
- -
- Monitor -
+ + Monitor
-
+
{user && (
-
- {statusIcon && ( - <> - {statusIcon} -
- - )} - {icon} +
+ {statusIcon} + {/* {icon} */}
diff --git a/frontend/src/layouts/layout.tsx b/frontend/src/layouts/layout.tsx index 5d960b786..6f687827d 100644 --- a/frontend/src/layouts/layout.tsx +++ b/frontend/src/layouts/layout.tsx @@ -13,7 +13,7 @@ export const Layout = () => { <>
-
+
diff --git a/frontend/src/layouts/page.tsx b/frontend/src/layouts/page.tsx index 26c0ce8a1..732a67df0 100644 --- a/frontend/src/layouts/page.tsx +++ b/frontend/src/layouts/page.tsx @@ -9,7 +9,7 @@ interface PageProps { export const Page = ({ title, subtitle, actions, content }: PageProps) => (
-
+
{title} {subtitle} diff --git a/frontend/src/layouts/resources.tsx b/frontend/src/layouts/resources.tsx index ca01e399c..1b222d0c5 100644 --- a/frontend/src/layouts/resources.tsx +++ b/frontend/src/layouts/resources.tsx @@ -28,9 +28,9 @@ export const Resources = ({ } actions={ -
+
setSearch(e.target.value)} @@ -48,7 +48,9 @@ export const Resources = ({
} content={ -
{components(search)}
+
+ {components(search)} +
} /> ); diff --git a/frontend/src/pages/dashboard/index.tsx b/frontend/src/pages/dashboard/index.tsx index d5ad51509..453b37fb1 100644 --- a/frontend/src/pages/dashboard/index.tsx +++ b/frontend/src/pages/dashboard/index.tsx @@ -10,13 +10,11 @@ export const Dashboard = () => {
-
-
- -

My Resources

-
+
+ +

My Resources

-
+
diff --git a/frontend/src/resources/build/card.tsx b/frontend/src/resources/build/card.tsx index 3c22e4e28..b9aab156b 100644 --- a/frontend/src/resources/build/card.tsx +++ b/frontend/src/resources/build/card.tsx @@ -15,7 +15,7 @@ export const BuildCard = ({ id }: { id: string }) => { } + statusIcon={} > diff --git a/frontend/src/resources/deployment/card.tsx b/frontend/src/resources/deployment/card.tsx index 3d3db4fbc..ab0ded7b0 100644 --- a/frontend/src/resources/deployment/card.tsx +++ b/frontend/src/resources/deployment/card.tsx @@ -1,7 +1,10 @@ import { useRead } from "@hooks"; import { Link } from "react-router-dom"; -import { DeploymentInfo, DeploymentStatusIcon } from "./util"; -import { Rocket } from "lucide-react"; +import { + DeploymentBuild, + DeploymentServer, + DeploymentStatusIcon, +} from "./util"; import { ResourceCard } from "@layouts/card"; export const DeploymentCard = ({ id }: { id: string }) => { @@ -14,9 +17,12 @@ export const DeploymentCard = ({ id }: { id: string }) => { title={deployment.name} description={deployment.status ?? "not deployed"} statusIcon={} - icon={} + // icon={} > - +
+ + +
// { const { deploymentId } = useParams(); @@ -27,15 +27,15 @@ export const Deployment = () => { } info={ -
- - | -
+
+
- | - + | + + | +
} actions={ diff --git a/frontend/src/resources/deployment/util.tsx b/frontend/src/resources/deployment/util.tsx index 449d32247..2b880b989 100644 --- a/frontend/src/resources/deployment/util.tsx +++ b/frontend/src/resources/deployment/util.tsx @@ -1,6 +1,6 @@ import { useRead } from "@hooks"; import { cn } from "@util/helpers"; -import { Circle, HardDrive, Server } from "lucide-react"; +import { Circle, HardDrive, Rocket, Server } from "lucide-react"; export const DeploymentName = ({ deploymentId, @@ -30,9 +30,9 @@ export const DeploymentStatusIcon = ({ const deployments = useRead("ListDeployments", {}).data; const deployment = deployments?.find((d) => d.id === deploymentId); return ( - { +export const DeploymentServer = ({ + deploymentId, +}: { + deploymentId: string; +}) => { const deployments = useRead("ListDeployments", {}).data; const deployment = deployments?.find((d) => d.id === deploymentId); - return ( -
-
- - server name - {/* */} -
-
- - {/* {data ? deployment?.container?.image ?? "no image" : "..."} */} - build.name @ build.version {deployment?.status} -
+
+ + server name {deployment?.state} + {/* */} +
+ ); +}; + +export const DeploymentBuild = ({ deploymentId }: { deploymentId: string }) => { + const deployments = useRead("ListDeployments", {}).data; + const deployment = deployments?.find((d) => d.id === deploymentId); + return ( +
+ + {/* {data ? deployment?.container?.image ?? "no image" : "..."} */} + build.name @ build.version {deployment?.status}
); }; diff --git a/frontend/src/resources/server/card.tsx b/frontend/src/resources/server/card.tsx index c2cb88a74..117904168 100644 --- a/frontend/src/resources/server/card.tsx +++ b/frontend/src/resources/server/card.tsx @@ -1,7 +1,6 @@ import { useRead } from "@hooks"; import { Link } from "react-router-dom"; -import { ServerStatusIcon, ServerStats } from "./util"; -import { Server } from "lucide-react"; +import { ServerStatusIcon, ServerStats, ServerRegion } from "./util"; import { ResourceCard } from "@layouts/card"; export const ServerCard = ({ id }: { id: string }) => { @@ -15,9 +14,12 @@ export const ServerCard = ({ id }: { id: string }) => { title={server.name} description={server.status} statusIcon={} - icon={} + // icon={} > - +
+ + +
); diff --git a/frontend/src/resources/server/page.tsx b/frontend/src/resources/server/page.tsx index 055c1cc66..db74f4edd 100644 --- a/frontend/src/resources/server/page.tsx +++ b/frontend/src/resources/server/page.tsx @@ -1,8 +1,8 @@ import { useSetRecentlyViewed } from "@hooks"; import { Resource } from "@layouts/resource"; import { useParams } from "react-router-dom"; -import { ServerInfo, ServerName } from "./util"; -import { Server as ServerIcon } from "lucide-react"; +import { ServerName, ServerStats } from "./util"; +import { ServerStatusIcon } from "./util"; import { CardDescription } from "@ui/card"; export const Server = () => { @@ -19,9 +19,9 @@ export const Server = () => { title={} info={
- + | - +
} actions="" diff --git a/frontend/src/resources/server/util.tsx b/frontend/src/resources/server/util.tsx index 26f56c5c2..352380f8b 100644 --- a/frontend/src/resources/server/util.tsx +++ b/frontend/src/resources/server/util.tsx @@ -2,7 +2,14 @@ import { useRead } from "@hooks"; import { ServerStatus } from "@monitor/client/dist/types"; import { CardDescription } from "@ui/card"; import { cn } from "@util/helpers"; -import { Circle, Cpu, Database, MapPin, MemoryStick } from "lucide-react"; +import { + Circle, + Cpu, + Database, + MapPin, + MemoryStick, + Server, +} from "lucide-react"; import { useEffect } from "react"; export const ServerName = ({ serverId }: { serverId: string | undefined }) => { @@ -37,25 +44,28 @@ export const ServerStats = ({ server_id }: { server_id: string }) => { }, [refetch]); return ( -
-
-
- - {data?.cpu_perc.toFixed(2)}% -
-
- - {data?.mem_total_gb.toFixed(2)} GB -
-
- - {data?.disk_total_gb.toFixed(2)} GB -
+
+
+ + {data?.cpu_perc.toFixed(2)}%
- - server.region + + {data?.mem_total_gb.toFixed(2)} GB
+
+ + {data?.disk_total_gb.toFixed(2)} GB +
+
+ ); +}; + +export const ServerRegion = () => { + return ( +
+ + server.region
); }; @@ -70,9 +80,9 @@ export const ServerStatusIcon = ({ const servers = useRead("ListServers", {}).data; const server = servers?.find((s) => s.id === serverId); return ( -