aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswa Kalyan Bhuyan <[email protected]> 2025-05-03 21:51:05 +0530
committerLibravatarLibravatar Biswa Kalyan Bhuyan <[email protected]> 2025-05-03 21:51:05 +0530
commit8aa594fc59de2d73624b4fcc064c538454cd6443 (patch)
treedc09eed3f75ef0fea78b1daa82fd7d7cfd7b0a9d
parent27fa556f6320705afa342b7ece828a285798b2cf (diff)
downloadchronos-8aa594fc59de2d73624b4fcc064c538454cd6443.tar.gz
chronos-8aa594fc59de2d73624b4fcc064c538454cd6443.tar.bz2
chronos-8aa594fc59de2d73624b4fcc064c538454cd6443.zip
fix: removed all the console logs in the codebase
-rw-r--r--static/js/main.js34
1 files changed, 0 insertions, 34 deletions
diff --git a/static/js/main.js b/static/js/main.js
index a5be8d4..cf65833 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -131,7 +131,6 @@ function removeToken() {
function showMetrics() {
if (!metricsSection) {
- console.error("Metrics section not found in DOM");
return;
}
@@ -149,7 +148,6 @@ function showMetrics() {
startDataUpdates();
}
} catch (error) {
- console.error("Error showing metrics:", error);
alert("There was an error displaying the metrics. Please try refreshing the page.");
}
}
@@ -323,8 +321,6 @@ function calculateRates(data) {
function createChartContainers(metrics) {
if (!domReady) {
- console.warn("DOM not ready for creating chart containers");
- // Wait a bit and try again
setTimeout(() => createChartContainers(metrics), 300);
return;
}
@@ -332,14 +328,12 @@ function createChartContainers(metrics) {
if (!metricsSection) {
metricsSection = document.getElementById('metrics-section');
if (!metricsSection) {
- console.error("Metrics section not found in DOM");
return;
}
}
const metricGrid = metricsSection.querySelector('.metric-grid');
if (!metricGrid) {
- console.error("Metric grid not found in DOM");
return;
}
@@ -397,7 +391,6 @@ function createChartContainers(metrics) {
}
}
} catch (error) {
- console.error("Error creating chart containers:", error);
}
}
@@ -423,8 +416,6 @@ function createMetricCard(container, metricName, definition) {
if (domReady) {
expandChart(metricAttr, labelAttr);
} else {
- console.warn("DOM not ready for chart expansion, delaying...");
- // Delay expansion until DOM is ready
setTimeout(() => {
if (typeof expandChart === 'function') {
expandChart(metricAttr, labelAttr);
@@ -433,14 +424,11 @@ function createMetricCard(container, metricName, definition) {
}
}
} catch (error) {
- console.error("Error expanding chart:", error);
- // Fallback if there's an error - show a simple alert
alert(`Could not expand the ${displayName} chart. Please try again later.`);
}
});
}
} catch (error) {
- console.error("Error creating metric card:", error);
}
}
@@ -790,7 +778,6 @@ function handleMetricsVisibilityChange() {
stopDataUpdates();
}
} catch (error) {
- console.error("Error handling metrics visibility change:", error);
// Don't show alert here since this might be called repeatedly
// Just log the error to console
}
@@ -808,7 +795,6 @@ function expandChart(metricName, displayName) {
// Check that we have all required elements
if (!chartModal || !chartModalTitle || !expandedChartCanvas) {
- console.error("Chart modal elements not found even after creation attempt");
alert("Unable to display expanded chart. Please refresh the page and try again.");
return;
}
@@ -822,7 +808,6 @@ function expandChart(metricName, displayName) {
const ctx = expandedChartCanvas.getContext('2d');
if (!ctx) {
- console.error("Could not get canvas context");
return;
}
@@ -831,14 +816,12 @@ function expandChart(metricName, displayName) {
try {
window.expandedChart.destroy();
} catch (error) {
- console.warn("Error destroying previous chart:", error);
}
}
// Clone the options and data from the original chart
const originalChart = charts[metricName];
if (!originalChart) {
- console.error(`Chart for ${metricName} not found`);
return;
}
@@ -865,7 +848,6 @@ function expandChart(metricName, displayName) {
options: chartOptions
});
} catch (error) {
- console.error("Error creating expanded chart:", error);
}
}
@@ -876,7 +858,6 @@ function closeChartModal(modalElement) {
const chartModal = modalElement || document.getElementById('chart-modal');
if (!chartModal) {
- console.error("Chart modal element not found");
return;
}
@@ -886,7 +867,6 @@ function closeChartModal(modalElement) {
chartModal.style.display = 'none';
}, 300);
} catch (error) {
- console.error("Error closing chart modal:", error);
}
}
@@ -896,9 +876,6 @@ function ensureChartModalExists() {
// If the chart modal doesn't exist, create it programmatically
if (!chartModalEl) {
- console.log("Chart modal not found in DOM, creating it dynamically");
-
- // First, ensure we have the required CSS styles
ensureModalStyles();
// Create the modal elements
@@ -947,12 +924,6 @@ function ensureChartModalExists() {
closeChartModalBtn = closeButton;
closeChartBtn = null; // No longer used
- console.log("Chart modal created dynamically", {
- chartModal: !!chartModal,
- chartModalTitle: !!chartModalTitle,
- closeChartModalBtn: !!closeChartModalBtn
- });
-
return true;
}
@@ -1055,8 +1026,6 @@ function ensureModalStyles() {
// Add the styles to the page
styleEl.textContent = css;
document.head.appendChild(styleEl);
-
- console.log("Added dynamic modal styles to page");
}
// --- Initialize everything when DOM is loaded ---
@@ -1075,7 +1044,6 @@ document.addEventListener('DOMContentLoaded', function() {
if (!chartModal || !chartModalTitle || !closeChartModalBtn) {
const created = ensureChartModalExists();
if (created) {
- console.log("Chart modal was created during initialization");
}
}
@@ -1175,7 +1143,6 @@ document.addEventListener('dom-fully-ready', function() {
// Ensure the chart modal exists
const created = ensureChartModalExists();
if (created) {
- console.log("Chart modal was created during dom-fully-ready event");
}
// Get fresh references to chart elements
@@ -1198,6 +1165,5 @@ document.addEventListener('dom-fully-ready', function() {
});
if (!allElementsFound) {
- console.error("Some chart modal elements are still missing after DOM is fully ready");
}
}); \ No newline at end of file