feat: Enhance project and scenario creation with monitoring metrics
- Added monitoring metrics for project creation success and error handling in `ProjectRepository`. - Implemented similar monitoring for scenario creation in `ScenarioRepository`. - Refactored `run_monte_carlo` function in `simulation.py` to include timing and success/error metrics. - Introduced new CSS styles for headers, alerts, and navigation buttons in `main.css` and `projects.css`. - Created a new JavaScript file for navigation logic to handle chevron buttons. - Updated HTML templates to include new navigation buttons and improved styling for buttons. - Added tests for reporting service and routes to ensure proper functionality and access control. - Removed unused imports and optimized existing test files for better clarity and performance.
This commit is contained in:
@@ -260,6 +260,33 @@ body {
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
margin: 0 0 0.5rem 0;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: var(--font-size-2xl);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: var(--font-size-xl);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: var(--font-size-lg);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 0 1rem 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--brand);
|
||||
}
|
||||
@@ -296,18 +323,46 @@ a {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
display: inline-flex;
|
||||
.sidebar-nav-controls {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.nav-chevron {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-chevron:hover,
|
||||
.nav-chevron:focus {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.nav-chevron:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.brand-logo {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(0deg, var(--brand-3), var(--accent));
|
||||
color: var(--color-text-invert);
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
letter-spacing: 1px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
@@ -927,6 +982,24 @@ tbody tr:nth-child(even) {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: var(--radius-sm);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.alert-error {
|
||||
background: rgba(209, 75, 75, 0.2);
|
||||
border: 1px solid rgba(209, 75, 75, 0.4);
|
||||
color: var(--color-text-invert);
|
||||
}
|
||||
|
||||
.alert-info {
|
||||
background: rgba(43, 168, 143, 0.2);
|
||||
border: 1px solid rgba(43, 168, 143, 0.4);
|
||||
color: var(--color-text-invert);
|
||||
}
|
||||
|
||||
.site-footer {
|
||||
background-color: var(--brand);
|
||||
color: var(--color-text-invert);
|
||||
@@ -939,6 +1012,19 @@ tbody tr:nth-child(even) {
|
||||
justify-content: center;
|
||||
padding: 1rem 0;
|
||||
font-size: 0.9rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.footer-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.footer-logo-img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.sidebar-toggle {
|
||||
|
||||
@@ -153,18 +153,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: var(--radius-sm);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.alert-error {
|
||||
background: rgba(209, 75, 75, 0.2);
|
||||
border: 1px solid rgba(209, 75, 75, 0.4);
|
||||
color: var(--color-text-invert);
|
||||
}
|
||||
|
||||
.form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
53
static/js/navigation.js
Normal file
53
static/js/navigation.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// Navigation chevron buttons logic
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const navPrev = document.getElementById("nav-prev");
|
||||
const navNext = document.getElementById("nav-next");
|
||||
|
||||
if (!navPrev || !navNext) return;
|
||||
|
||||
// Define the navigation order (main pages)
|
||||
const navPages = [
|
||||
"/",
|
||||
"/projects/ui",
|
||||
"/imports/ui",
|
||||
"/ui/simulations",
|
||||
"/ui/reporting",
|
||||
"/ui/settings",
|
||||
];
|
||||
|
||||
const currentPath = window.location.pathname;
|
||||
|
||||
// Find current index
|
||||
let currentIndex = -1;
|
||||
for (let i = 0; i < navPages.length; i++) {
|
||||
if (currentPath.startsWith(navPages[i])) {
|
||||
currentIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If not found, disable both
|
||||
if (currentIndex === -1) {
|
||||
navPrev.disabled = true;
|
||||
navNext.disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up prev button
|
||||
if (currentIndex > 0) {
|
||||
navPrev.addEventListener("click", function () {
|
||||
window.location.href = navPages[currentIndex - 1];
|
||||
});
|
||||
} else {
|
||||
navPrev.disabled = true;
|
||||
}
|
||||
|
||||
// Set up next button
|
||||
if (currentIndex < navPages.length - 1) {
|
||||
navNext.addEventListener("click", function () {
|
||||
window.location.href = navPages[currentIndex + 1];
|
||||
});
|
||||
} else {
|
||||
navNext.disabled = true;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user