diff --git a/src/disk_checker/web/web_routes.py b/src/disk_checker/web/web_routes.py index 63fa5b5..7ed22cc 100644 --- a/src/disk_checker/web/web_routes.py +++ b/src/disk_checker/web/web_routes.py @@ -4,6 +4,21 @@ from typing import Dict web_router = APIRouter() +# Navigation configuration - NEW TABS GO HERE! +NAVIGATION = [ + {"name": "home", "label": "Home", "url": "/", "icon": "bi-house"}, + {"name": "benchmark", "label": "Benchmark", "url": "/benchmark", "icon": "bi-hdd"}, + {"name": "jobs", "label": "Job Queue", "url": "/jobs", "icon": "bi-list-task"}, +] + +def get_active_tab(url: str) -> str: + """Determine which navigation tab is active.""" + for nav_item in NAVIGATION: + if nav_item["url"] == url: + return nav_item["name"] + return "home" + + @web_router.get("/") async def render_home(request: Request): """ @@ -14,6 +29,37 @@ async def render_home(request: Request): name="index.html", request=request, context={ - "tools":tools + "tools":tools, + "navigation": NAVIGATION, + "active_tab": get_active_tab("/") + } + ) + +@web_router.get("/benchmark") +async def render_benchmark(request: Request): + """Render the benchmark page.""" + templates: Jinja2Templates = request.app.state.templates + + return templates.TemplateResponse( + name="benchmark.html", + request=request, + context={ + "navigation": NAVIGATION, + "active_tab": get_active_tab("/benchmark") + } + ) + + +@web_router.get("/jobs") +async def render_jobs(request: Request): + """Render the job queue page.""" + templates: Jinja2Templates = request.app.state.templates + + return templates.TemplateResponse( + name="jobs.html", + request=request, + context={ + "navigation": NAVIGATION, + "active_tab": get_active_tab("/jobs") } ) \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 8ce1073..79b79e5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,20 +3,47 @@ - Disk Checker - + Disk Checker - {% block title %}Home{% endblock %} + + + {% block extra_css %}{% endblock %} + -
+ +
{% block content %}{% endblock %}
diff --git a/templates/benchmark.html b/templates/benchmark.html new file mode 100644 index 0000000..92b1047 --- /dev/null +++ b/templates/benchmark.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block title %}Benchmark{% endblock %} + +{% block content %} +
+
+

Benchmark

+

Configure and run disk benchmarks.

+ + +
+
+
Select Drive
+

Choose a drive to benchmark from the list below.

+ + +
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index c83e1a7..74845cd 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,44 +1,50 @@ {% extends "base.html" %} +{% block title %}Home{% endblock %} + {% block content %} -
+
+
+ +

Available Benchmarking Tools

- -

Available Benchmarking Tools

- - - {% if tools %} -
- {% for tool_name, tool in tools.items() %} -
-
-
-
{{ tool.name }}
-

- {% if tool.available %} - Available - {% if tool.version %} - {{ tool.version }} - {% endif %} - {% else %} - Not Installed - {% endif %} -

+ + {% if tools %} +
+ {% for tool_name, tool in tools.items() %} +
+
+
+
{{ tool.name }}
+

+ {% if tool.available %} + Available + {% if tool.version %} + {{ tool.version }} + {% endif %} + {% else %} + Not Installed + {% endif %} +

+
+ {% endfor %}
- {% endfor %} -
- {% endif %} + {% endif %} - -

Available Drives

-

- - Mounted drives are grayed out and cannot be benchmarked. -

-
-
+ +

Available Drives

+

+ + Mounted drives are grayed out and cannot be benchmarked. +

+
+
+
{% endblock %} diff --git a/templates/jobs.html b/templates/jobs.html new file mode 100644 index 0000000..ced952d --- /dev/null +++ b/templates/jobs.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% block title %}Job Queue{% endblock %} + +{% block content %} +
+
+

Job Queue

+

Monitor and manage benchmark jobs.

+ + +
+

Loading jobs...

+
+
+
+
+{% endblock %} + +{% block extra_js %} + +{% endblock %} \ No newline at end of file