Edge Computing Dashboard

Edge Computing Dashboard

Overview

Total Edge Devices

25

Active Devices

22

Data Processed (GB/hr)

1,500

Edge Device Status

Device ID Location Status Last Heartbeat Data Throughput (Mbps) Latency (ms)

Key Performance Indicators

Average Latency

50 ms

Average Throughput

75 Mbps

${dashboardData.kpis.avgLatency} ms

Average Throughput

${dashboardData.kpis.avgThroughput} Mbps

`; // Append the temporary div to the body to render it for html2canvas document.body.appendChild(pdfContentDiv); // Use html2canvas to capture the content as an image const canvas = await html2canvas(pdfContentDiv, { scale: 2, // Increase scale for better resolution in PDF useCORS: true, // Required if you have external images/resources logging: false // Disable logging for cleaner console }); // Remove the temporary div document.body.removeChild(pdfContentDiv); const imgData = canvas.toDataURL('image/png'); const pdf = new window.jspdf.jsPDF({ orientation: 'portrait', unit: 'px', format: [canvas.width, canvas.height] // Use canvas dimensions for PDF }); pdf.addImage(imgData, 'PNG', 0, 0, canvas.width, canvas.height); pdf.save('Edge_Computing_Dashboard_Report.pdf'); } // --- Event Listeners --- if (dashboardTabBtn) dashboardTabBtn.onclick = function() { switchTab('dashboard'); }; if (dataConfigTabBtn) dataConfigTabBtn.onclick = function() { switchTab('dataConfig'); }; if (saveConfigBtn) saveConfigBtn.onclick = saveConfiguration; if (addDeviceBtn) addDeviceBtn.onclick = addEdgeDevice; if (nextBtn) nextBtn.onclick = navigateNext; if (prevBtn) prevBtn.onclick = navigatePrevious; if (downloadPdfBtn) downloadPdfBtn.onclick = downloadPDF; // --- Initial Render --- renderDashboard(); // Render dashboard on initial load switchTab('dashboard'); // Ensure dashboard tab is active by default });
Scroll to Top