addind dashboard features will come back to finish
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>MAV | BayiQ</title>
|
||||
<title>BayIQ</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import Card from "../../../ui/Card";
|
||||
import CardHeader from "../../../ui/CardHeader";
|
||||
|
||||
type CameraStatusProps = {
|
||||
title: string;
|
||||
status?: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
const CameraStatus = ({ title, status, description }: CameraStatusProps) => {
|
||||
return (
|
||||
<Card className="p-4 w-[40%]">
|
||||
<CardHeader title={title} status={status} />
|
||||
<p className=" text-gray-500">{description}</p>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default CameraStatus;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import CameraStatus from "./CameraStatus";
|
||||
import SystemStatusCard from "./SystemStatusCard";
|
||||
|
||||
const DashboardGrid = () => {
|
||||
return (
|
||||
<div>
|
||||
<div className="grid grid-rows-2">
|
||||
<SystemStatusCard />
|
||||
<CameraStatus title="Camera 1" status={"bg-red-500"} description={"Camera not responding"} />
|
||||
<CameraStatus title="Camera 2" status={"bg-gray-500"} description={"Camera Offline"} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ const SystemStatusCard = () => {
|
||||
{stats ? (
|
||||
<>
|
||||
<div>UTC: {stats["system-clock-utc"]}</div>
|
||||
<span>Local: {stats["system-clock-local"]}</span>
|
||||
<div>Local: {stats["system-clock-local"]}</div>
|
||||
<span>CPU: {stats["memory-cpu-status"]}</span>
|
||||
<span>Threads: {stats["thread-count"]}</span>
|
||||
</>
|
||||
|
||||
@@ -10,3 +10,5 @@ export type InfoBarData = {
|
||||
"memory-cpu-status": string;
|
||||
"thread-count": string;
|
||||
};
|
||||
|
||||
export type StatusIndicator = "neutral-quaternary" | "dark" | "info" | "success" | "warning" | "danger";
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
import clsx from "clsx";
|
||||
import StatusIndicators from "./StatusIndicators";
|
||||
|
||||
type CameraOverviewHeaderProps = {
|
||||
title?: string;
|
||||
status?: string;
|
||||
};
|
||||
const CardHeader = ({ title }: CameraOverviewHeaderProps) => {
|
||||
const CardHeader = ({ title, status }: CameraOverviewHeaderProps) => {
|
||||
console.log(status);
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
"w-full border-b border-gray-600 flex flex-row items-center space-x-2 mb-6 relative justify-between",
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
<div className="flex items-center space-x-1">
|
||||
{/* {icon && <FontAwesomeIcon icon={icon} className="size-4" />} */}
|
||||
{status && <StatusIndicators status={status} />}
|
||||
<h2 className="text-xl">{title}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
9
src/ui/StatusIndicators.tsx
Normal file
9
src/ui/StatusIndicators.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import clsx from "clsx";
|
||||
|
||||
type StatusIndicatorsProps = { status: string };
|
||||
|
||||
const StatusIndicators = ({ status }: StatusIndicatorsProps) => {
|
||||
return <span className={clsx(`flex w-3 h-3 me-2 rounded-full`, status)}></span>;
|
||||
};
|
||||
|
||||
export default StatusIndicators;
|
||||
Reference in New Issue
Block a user