Prepared for serving
This commit is contained in:
parent
fd71714fc0
commit
6526b51429
6 changed files with 39 additions and 17 deletions
|
@ -61,9 +61,10 @@ export default function Navbar(props) {
|
|||
}));
|
||||
|
||||
const navHeader = () => {
|
||||
const pathStr =
|
||||
location.pathname.charAt(1).toUpperCase() + location.pathname.slice(2);
|
||||
if (location.pathname !== "/failing") return pathStr;
|
||||
const name = location.pathname.split("/").pop();
|
||||
|
||||
const pathStr = name.charAt(0).toUpperCase() + name.slice(1);
|
||||
if (location.pathname !== "/qualiteer/failing") return pathStr;
|
||||
return (
|
||||
<SideBadge
|
||||
badgeContent={store.failing.length}
|
||||
|
@ -107,8 +108,8 @@ export default function Navbar(props) {
|
|||
<ListItemButton
|
||||
key={text}
|
||||
component={Link}
|
||||
to={"/" + text}
|
||||
selected={location.pathname === "/" + text}
|
||||
to={"/qualiteer/" + text}
|
||||
selected={location.pathname === "/qualiteer/" + text}
|
||||
onClick={closeDrawer}
|
||||
>
|
||||
<ListItemIcon>{icons[index]}</ListItemIcon>
|
||||
|
@ -126,7 +127,7 @@ export default function Navbar(props) {
|
|||
<Avatar
|
||||
style={{ cursor: "pointer" }}
|
||||
alt="QA"
|
||||
src="/assets/QA.png"
|
||||
src="/qualiteer/assets/QA.png"
|
||||
onClick={reloadPage}
|
||||
/>
|
||||
</Toolbar>
|
||||
|
|
3
src/views/NotFound.jsx
Normal file
3
src/views/NotFound.jsx
Normal file
|
@ -0,0 +1,3 @@
|
|||
export default function NotFound() {
|
||||
return <h1>Error 404 not found!</h1>;
|
||||
}
|
|
@ -11,6 +11,7 @@ import Jobs from "./jobs/Jobs.jsx";
|
|||
import Catalog from "./catalog/Catalog.jsx";
|
||||
import Settings from "./settings/Settings.jsx";
|
||||
import About from "./about/About.jsx";
|
||||
import NotFound from "./NotFound.jsx";
|
||||
|
||||
export default function Views() {
|
||||
return (
|
||||
|
@ -20,13 +21,24 @@ export default function Views() {
|
|||
<Box component="main" sx={{ flexGrow: 1, p: 3 }}>
|
||||
<Toolbar />
|
||||
<Routes>
|
||||
<Route exact path="/" element={<Navigate to="/failing" replace />} />
|
||||
<Route path="/failing" element={<Failing />} />
|
||||
<Route path="/alerting" element={<Alerting />} />
|
||||
<Route path="/jobs" element={<Jobs />} />
|
||||
<Route path="/catalog" element={<Catalog />} />
|
||||
<Route path="/settings" element={<Settings />} />
|
||||
<Route path="/about" element={<About />} />
|
||||
<Route
|
||||
exact
|
||||
path="/qualiteer/"
|
||||
element={<Navigate to="/qualiteer/failing" replace />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/"
|
||||
element={<Navigate to="/qualiteer/failing" replace />}
|
||||
/>
|
||||
<Route path="/qualiteer/failing" element={<Failing />} />
|
||||
<Route path="/qualiteer/alerting" element={<Alerting />} />
|
||||
<Route path="/qualiteer/jobs" element={<Jobs />} />
|
||||
<Route path="/qualiteer/catalog" element={<Catalog />} />
|
||||
<Route path="/qualiteer/settings" element={<Settings />} />
|
||||
<Route path="/qualiteer/about" element={<About />} />
|
||||
<Route path="/qualiteer/404" element={<NotFound />} />
|
||||
<Route path="*" element={<Navigate to="/qualiteer/404" replace />} />
|
||||
</Routes>
|
||||
</Box>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue