| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 <div class="row"> | 
					
						
							| 
									
										
										
										
											2025-01-13 15:54:42 +00:00
										 |  |  |                     <div class="card w-auto bg-light border-light card-body" style="flex-direction: row;"><?= $widget['title'] ?></div>
 | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  |                 </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 <div class="collapse show" id="collapse<?= htmlspecialchars($widget['name']) ?>"> | 
					
						
							|  |  |  |                     <div class="mb-5"> | 
					
						
							|  |  |  | <?php if ($widget['full'] === true) { ?>
 | 
					
						
							|  |  |  |                         <table class="table table-results table-striped table-hover table-bordered"> | 
					
						
							|  |  |  |                             <thead class="thead-dark"> | 
					
						
							|  |  |  |                                 <tr> | 
					
						
							| 
									
										
										
										
											2025-01-13 15:54:42 +00:00
										 |  |  |                                     <th scope="col">Metric</th> | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  | <?php     foreach ($widget['records'] as $record) { ?>
 | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  |                                     <th scope="col"> | 
					
						
							|  |  |  |                                         <?= htmlspecialchars($record['table_headers']) ?>
 | 
					
						
							|  |  |  |                                         <?php if ($record['timestamp']) { ?>
 | 
					
						
							|  |  |  |                                             <br> | 
					
						
							|  |  |  |                                             <small class="text-muted">as of <?= date('Y-m-d H:i:s', strtotime($record['timestamp'])) ?></small>
 | 
					
						
							|  |  |  |                                         <?php } ?>
 | 
					
						
							|  |  |  |                                     </th> | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  | <?php     } ?>
 | 
					
						
							|  |  |  |                                 </tr> | 
					
						
							|  |  |  |                             </thead> | 
					
						
							|  |  |  |                             <tbody> | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  | <?php     foreach ($widget['metrics'] as $section => $section_metrics) { ?>
 | 
					
						
							|  |  |  |                                 <tr class="table-secondary"> | 
					
						
							|  |  |  |                                     <th colspan="<?= count($widget['records']) + 1 ?>"><?= htmlspecialchars($section) ?></th>
 | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  |                                 </tr> | 
					
						
							| 
									
										
										
										
											2025-01-15 16:22:09 +00:00
										 |  |  | <?php         foreach ($section_metrics as $metric => $metricConfig) { ?>
 | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  |                                 <tr> | 
					
						
							| 
									
										
										
										
											2025-01-15 16:22:09 +00:00
										 |  |  |                                     <td><?= htmlspecialchars($metricConfig['label']) ?></td>
 | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  | <?php             foreach ($widget['records'] as $record) { ?>
 | 
					
						
							| 
									
										
										
										
											2025-01-13 15:54:42 +00:00
										 |  |  |                                     <td> | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  |                                         <?php if (isset($record['metrics'][$section][$metric])) {  | 
					
						
							|  |  |  |                                             $metric_data = $record['metrics'][$section][$metric]; | 
					
						
							|  |  |  |                                             if ($metric_data['link']) { ?>
 | 
					
						
							|  |  |  |                                                 <a href="<?= htmlspecialchars($app_root) ?>?platform=<?= htmlspecialchars($platform_id) ?>&page=<?= htmlspecialchars($metric_data['link']) ?>&from_time=<?= htmlspecialchars($record['timestamp']) ?>&until_time=<?= htmlspecialchars($record['timestamp']) ?>"><?= htmlspecialchars($metric_data['value']) ?></a>
 | 
					
						
							| 
									
										
										
										
											2025-01-13 15:54:42 +00:00
										 |  |  |                                             <?php } else { ?>
 | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  |                                                 <?= htmlspecialchars($metric_data['value']) ?>
 | 
					
						
							|  |  |  |                                             <?php } | 
					
						
							|  |  |  |                                         } else { ?>
 | 
					
						
							| 
									
										
										
										
											2025-01-13 15:54:42 +00:00
										 |  |  |                                             <span class="text-muted">No data</span> | 
					
						
							|  |  |  |                                         <?php } ?>
 | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  |                                     </td> | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  | <?php             } ?>
 | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  |                                 </tr> | 
					
						
							| 
									
										
										
										
											2025-01-14 12:09:28 +00:00
										 |  |  | <?php         } ?>
 | 
					
						
							|  |  |  | <?php     } ?>
 | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  |                             </tbody> | 
					
						
							|  |  |  |                         </table> | 
					
						
							|  |  |  | <?php } else { ?>
 | 
					
						
							| 
									
										
										
										
											2025-01-13 15:54:42 +00:00
										 |  |  |                         <div class="alert alert-info m-3" role="alert"> | 
					
						
							|  |  |  |                             No data available from any agents. Please check agent configuration and connectivity. | 
					
						
							|  |  |  |                         </div> | 
					
						
							| 
									
										
										
										
											2024-10-11 07:58:08 +00:00
										 |  |  | <?php } ?>
 | 
					
						
							|  |  |  |                     </div> | 
					
						
							|  |  |  |                 </div> | 
					
						
							|  |  |  |                 <!-- /widget "<?= htmlspecialchars($widget['name']) ?>" --> |