Skip to content

Commit 95d819c

Browse files
authored
Merge pull request #144 from Riyad-Murad/staging
Staging
2 parents c1aec51 + 1150306 commit 95d819c

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

amp-client/src/Pages/ProviderPages/ProviderDashboard/ProviderDashboard.jsx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,42 @@ const ProviderDashboard = () => {
498498
</div>
499499

500500
<div className="chart-widget all-metrics-widget">
501+
<h3>All Metrics</h3>
502+
{allMetrics && Object.keys(allMetrics).length > 0 ? (
503+
<div className="scrollable-table">
504+
<table>
505+
<thead>
506+
<tr>
507+
<th>ID</th>
508+
<th>Voltage</th>
509+
<th>Current</th>
510+
<th>Power</th>
511+
<th>Energy</th>
512+
<th>Timestamp</th>
513+
</tr>
514+
</thead>
515+
<tbody>
516+
{allMetrics.map((metric) => (
517+
<tr key={metric.id}>
518+
<td>{metric.id}</td>
519+
<td>{metric.voltage}</td>
520+
<td>{metric.current}</td>
521+
<td>{metric.power}</td>
522+
<td>{metric.energy}</td>
523+
<td>
524+
{new Date(metric.created_at).toLocaleString()}
525+
</td>
526+
</tr>
527+
))}
528+
</tbody>
529+
</table>
530+
</div>
531+
) : (
532+
<p>No detailed metrics data available.</p>
533+
)}
534+
</div>
535+
536+
{/* <div className="chart-widget all-metrics-widget">
501537
<h3>All Metrics</h3>
502538
{allMetrics && Object.keys(allMetrics).length > 0 ? (
503539
<table>
@@ -527,7 +563,7 @@ const ProviderDashboard = () => {
527563
) : (
528564
<p>No detailed metrics data available.</p>
529565
)}
530-
</div>
566+
</div> */}
531567
</div>
532568
)}
533569
</div>

amp-client/src/Pages/ProviderPages/ProviderDashboard/styles.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,29 @@
7979
max-height: 450px;
8080
}
8181

82+
.chart-widget.all-metrics-widget {
83+
max-height: 450px;
84+
overflow: hidden;
85+
}
86+
87+
.scrollable-table {
88+
max-height: 450px;
89+
overflow-y: auto;
90+
border: 1px solid #ccc;
91+
}
92+
93+
.scrollable-table table {
94+
width: 100%;
95+
border-collapse: collapse;
96+
}
97+
98+
.scrollable-table th,
99+
.scrollable-table td {
100+
padding: 8px;
101+
text-align: left;
102+
border-bottom: 1px solid #eee;
103+
}
104+
82105
.metric-card {
83106
flex: 1;
84107
min-width: 150px;

0 commit comments

Comments
 (0)