Remove redundant comments, streamline query logic, and clean up variable handling for improved code readability and efficiency in StdOut.php and StdOut-detail.php.

This commit is contained in:
2025-08-21 09:11:17 +02:00
parent a17bb63889
commit e0d2dc00c1
2 changed files with 5 additions and 37 deletions

View File

@@ -63,29 +63,22 @@
</div>
<!-- TABLE -->
<div>
<?php // DATA OPTIMIZED
// The one and only query to get everything we need
<?php
$sql = "SELECT cmd, MIN(ts) AS debut, MAX(ts) AS fin FROM x_stdout GROUP BY cmd ORDER BY fin DESC";
$results = Invoke_infra($sql);
echo "<div class='row'>";
// Loop through the results (now very fast, no more queries inside)
if (is_array($results)) {
foreach ($results as $script) {
$scriptName = $script['cmd'];
$startTime = $script['debut'];
$endTime = $script['fin'];
echo "<div class='col-3 mb-3'>";
echo "<a href='StdOut-detail.php?s={$scriptName}&AIX=1&linux=1&DUN=1' class='btn btn-primary btn-lg' role='button'>";
echo "<b>{$scriptName}</b><br><small>{$startTime} --> {$endTime}</small>";
echo "<a href='StdOut-detail.php?s=$scriptName&AIX=1&linux=1&DUN=1' class='btn btn-primary btn-lg' role='button'>";
echo "<b>$scriptName</b><br><small>$startTime --> $endTime</small>";
echo "</a>";
echo "</div>";
}
}
echo "</div>";
?>
</div>