Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions dashboard/src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Separator } from "@/components/ui/separator";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { currentVehicle, currentUser } from "@/consts/config";
import { currentUser } from "@/consts/config";
import { SHA256 } from "crypto-js";
import { useNavigate } from "react-router-dom";
import { logout } from "@/lib/auth";
Expand All @@ -24,8 +21,6 @@ interface HeaderProps {
const Header = (props: HeaderProps) => {
const navigate = useNavigate();

function selectVehicle(vehicleId: string) {}

return (
<nav
className={`fixed top-0 z-20 w-full items-center justify-start transition-all duration-200 ${props.scroll > 24 ? "bg-card shadow-lg" : "bg-background"} ${props.className}`}
Expand Down
169 changes: 2 additions & 167 deletions dashboard/src/consts/config.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
import { Vehicle, initVehicle } from "@/models/car";
import { User, initUser } from "@/models/user";
import AccelerometerLiveWidget from "@/pages/gr24/mobile/widgets/AccelerometerLiveWidget";
import GraphLiveWidget from "@/pages/gr24/mobile/widgets/AltitudeGraphLiveWidget";
import DebugLiveWidget from "@/pages/gr24/mobile/widgets/DebugLiveWidget";
import MapLiveWidget from "@/pages/gr24/mobile/widgets/MapLiveWidget";
import MapSpeedLiveWidget from "@/pages/gr24/mobile/widgets/MapSpeedLiveWidget";
import ACURawWidget from "@/pages/gr24/acu/widgets/DebugRawLiveWidget";
import BCMRawWidget from "@/pages/gr24/bcm/widgets/DebugRawLiveWidget";
import DashPanelRawWidget from "@/pages/gr24/dash_panel/widgets/DebugRawLiveWidget";
import InverterRawWidget from "@/pages/gr24/inverter/widgets/DebugRawLiveWidget";
import PedalRawWidget from "@/pages/gr24/pedal/widgets/DebugRawLiveWidget";
import MobileRawWidget from "@/pages/gr24/mobile/widgets/DebugRawLiveWidget";
import VDMRawWidget from "@/pages/gr24/vdm/widgets/DebugRawLiveWidget";
import WheelRawWidget from "@/pages/gr24/wheel/widgets/DebugRawLiveWidget";
import PedalLiveWidget from "@/pages/gr24/pedal/widgets/PedalLiveWidget";
import SegmentLiveWidget from "@/pages/gr24/acu/widgets/SegmentLiveWidget";
import CellLiveWidget from "@/pages/gr24/acu/widgets/CellLiveWidget";

export const currentUser: User = initUser;
export const currentVehicle: Vehicle = initVehicle;
Expand All @@ -25,154 +9,5 @@ export const MAPACHE_API_URL =
"http://hamilton-ec2.gauchoracing.com:10310";

export const MAPACHE_WS_URL =
import.meta.env.VITE_MAPACHE_WS_URL ?? "ws://hamilton-ec2.gauchoracing.com:10310";

export const acuLiveWidgets = [
{
name: "Segments Live",
width: 1200,
height: 300,
component: <SegmentLiveWidget />,
},
{
name: "Cells Live",
width: 1200,
height: 600,
component: <CellLiveWidget />,
},
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <ACURawWidget />,
},
];

export const bcmLiveWidgets = [
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <BCMRawWidget />,
},
];

export const dashPanelLiveWidgets = [
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <DashPanelRawWidget />,
},
];

export const inverterLiveWidgets = [
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <PedalRawWidget />,
},
];

export const mobileLiveWidgets = [
{
name: "Map",
width: 600,
height: 300,
component: <MapLiveWidget />,
},
{
name: "Map w/ Speed",
width: 600,
height: 300,
component: <MapSpeedLiveWidget />,
},
{
name: "Map w/ Speed Large",
width: 932,
height: 300,
component: <MapSpeedLiveWidget />,
},
{
name: "Accelerometer Plot",
width: 300,
height: 300,
component: <AccelerometerLiveWidget />,
},
{
name: "Altitude Graph",
width: 600,
height: 300,
component: <GraphLiveWidget field="altitude" />,
},
{
name: "Heading Graph",
width: 600,
height: 300,
component: <GraphLiveWidget field="heading" />,
},
{
name: "Accelerometer X Graph",
width: 600,
height: 300,
component: <GraphLiveWidget field="accelerometer_x" />,
},
{
name: "Accelerometer Y Graph",
width: 600,
height: 300,
component: <GraphLiveWidget field="accelerometer_y" />,
},
{
name: "Accelerometer Z Graph",
width: 600,
height: 300,
component: <GraphLiveWidget field="accelerometer_z" />,
},
{
name: "Debug Live",
width: 600,
height: 300,
component: <DebugLiveWidget />,
},
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <MobileRawWidget />,
},
];

export const pedalLiveWidgets = [
{
name: "Pedal Live",
width: 300,
height: 300,
component: <PedalLiveWidget />,
},
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <PedalRawWidget />,
},
];

export const vdmLiveWidgets = [
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <VDMRawWidget />,
},
];

export const wheelLiveWidgets = [
{
name: "Raw Debug Live",
width: 600,
height: 300,
component: <WheelRawWidget />,
},
];
import.meta.env.VITE_MAPACHE_WS_URL ??
"ws://hamilton-ec2.gauchoracing.com:10310";
55 changes: 0 additions & 55 deletions dashboard/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,8 @@ import "/node_modules/react-grid-layout/css/styles.css";
import "/node_modules/react-resizable/css/styles.css";
import "mapbox-gl/dist/mapbox-gl.css";
import { Toaster } from "./components/ui/sonner.tsx";
import PedalPage from "./pages/gr24/pedal/PedalPage.tsx";
import RegisterPage from "./pages/auth/RegisterPage.tsx";
import DashboardPage from "./pages/gr24/dashboard/DashboardPage.tsx";
import NodesPage from "./pages/gr24/nodes/NodesPage.tsx";
import MobilePage from "./pages/gr24/mobile/MobilePage.tsx";
import App from "./App.tsx";
import VDMPage from "./pages/gr24/vdm/VDMPage.tsx";
import WheelPage from "./pages/gr24/wheel/WheelPage.tsx";
import InverterPage from "./pages/gr24/inverter/InverterPage.tsx";
import SteeringWheelPage from "./pages/gr24/steering_wheel/SteeringWheelPage.tsx";
import ACUPage from "./pages/gr24/acu/ACUPage.tsx";
import BCMPage from "./pages/gr24/bcm/BCMPage.tsx";
import DashPanelPage from "./pages/gr24/dash_panel/DashPanelPage.tsx";

const router = createBrowserRouter([
{
Expand All @@ -29,50 +18,6 @@ const router = createBrowserRouter([
path: "/auth/register",
element: <RegisterPage />,
},
{
path: "/dash",
element: <DashboardPage />,
},
{
path: "/gr24/dash",
element: <DashboardPage />,
},
{
path: "/gr24/nodes",
element: <NodesPage />,
},
{
path: "/gr24/acu",
element: <ACUPage />,
},
{
path: "/gr24/bcm",
element: <BCMPage />,
},
{
path: "/gr24/dpanel",
element: <DashPanelPage />,
},
{
path: "/gr24/inverter",
element: <InverterPage />,
},
{
path: "/gr24/mobile",
element: <MobilePage />,
},
{
path: "/gr24/pedal",
element: <PedalPage />,
},
{
path: "/gr24/vdm",
element: <VDMPage />,
},
{
path: "/gr24/wheel",
element: <WheelPage />,
},
]);

ReactDOM.createRoot(document.getElementById("root")!).render(
Expand Down
Loading
Loading