diff --git a/Data/Server/WebUI/src/App.jsx b/Data/Server/WebUI/src/App.jsx index a219518..501fc10 100644 --- a/Data/Server/WebUI/src/App.jsx +++ b/Data/Server/WebUI/src/App.jsx @@ -12,13 +12,14 @@ import NavigationSidebar from "./Navigation_Sidebar"; // Styling Imports import { AppBar, Toolbar, Typography, Box, Menu, MenuItem, Button, - CssBaseline, ThemeProvider, createTheme + CssBaseline, ThemeProvider, createTheme, Breadcrumbs } from "@mui/material"; import { KeyboardArrowDown as KeyboardArrowDownIcon, InfoOutlined as InfoOutlinedIcon, GitHub as GitHub, - People as PeopleIcon + People as PeopleIcon, + NavigateNext as NavigateNextIcon } from "@mui/icons-material"; // Workflow Editor Imports @@ -104,6 +105,69 @@ export default function App() { const [editingJob, setEditingJob] = useState(null); const [jobsRefreshToken, setJobsRefreshToken] = useState(0); + // Build breadcrumb items for current view + const breadcrumbs = React.useMemo(() => { + const items = []; + switch (currentPage) { + case "sites": + items.push({ label: "Sites" }); + break; + case "devices": + items.push({ label: "Devices" }); + break; + case "device_details": + items.push({ label: "Devices", page: "devices" }); + items.push({ label: "Device Details" }); + break; + case "jobs": + items.push({ label: "Automation", page: "jobs" }); + items.push({ label: "Scheduled Jobs", page: "jobs" }); + break; + case "create_job": + items.push({ label: "Automation", page: "jobs" }); + items.push({ label: "Scheduled Jobs", page: "jobs" }); + items.push({ label: editingJob ? "Edit Job" : "Create Job" }); + break; + case "workflows": + items.push({ label: "Automation", page: "jobs" }); + items.push({ label: "Workflows" }); + break; + case "workflow-editor": + items.push({ label: "Automation", page: "jobs" }); + items.push({ label: "Workflows", page: "workflows" }); + items.push({ label: "Flow Editor" }); + break; + case "scripts": + items.push({ label: "Automation", page: "jobs" }); + items.push({ label: "Scripts" }); + break; + case "community": + items.push({ label: "Automation", page: "jobs" }); + items.push({ label: "Community Content" }); + break; + case "admin_users": + items.push({ label: "Admin Settings", page: "admin_users" }); + items.push({ label: "User Management" }); + break; + case "server_info": + items.push({ label: "Admin Settings", page: "admin_users" }); + items.push({ label: "Server Info" }); + break; + case "filters": + items.push({ label: "Filters & Groups", page: "filters" }); + items.push({ label: "Filters" }); + break; + case "groups": + items.push({ label: "Filters & Groups", page: "filters" }); + items.push({ label: "Groups" }); + break; + default: + // Fallback to a neutral crumb if unknown + if (currentPage) items.push({ label: String(currentPage) }); + } + return items; + }, [currentPage, selectedDevice, editingJob]); + useEffect(() => { const session = localStorage.getItem("borealis_session"); if (session) { @@ -507,9 +571,60 @@ export default function App() { - + - + {/* Breadcrumbs inline in top bar (transparent), aligned to content area */} + + } + aria-label="breadcrumb" + sx={{ + color: "#9aa0a6", + fontSize: "0.825rem", // 50% larger than previous + '& .MuiBreadcrumbs-separator': { mx: 0.6 }, + pointerEvents: 'auto' + }} + > + {breadcrumbs.map((c, idx) => { + const isLast = idx === breadcrumbs.length - 1; + if (!isLast && c.page) { + return ( + + ); + } + return ( + + {c.label} + + ); + })} + + + {/* Spacer to keep About aligned right */} +