Skip to content

Commit

Permalink
Add a time endpoint to pull the containers current timezone setting a…
Browse files Browse the repository at this point in the history
…nd time
  • Loading branch information
austinwbest committed Jan 22, 2025
1 parent 611e018 commit db5d941
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions root/app/www/public/ajax/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
}
closedir($dir);

$serverTime = apiRequest('server/time')['result']['result'];
?>
<div class="bg-secondary rounded p-4">
<h4 class="text-primary">Instance</h4>
Expand All @@ -37,6 +38,13 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Server timezone</th>
<td>
<?= $serverTime['timezone'] ?>
</td>
<td>The current timezone being used for this instance. Datetime: <?= $serverTime['time'] ?></td>
</tr>
<tr>
<th scope="row">Server name</th>
<td>
Expand Down
3 changes: 3 additions & 0 deletions root/app/www/public/functions/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ function apiRequestLocal($endpoint, $parameters = [], $payload = [])
}

return gitVersion(true);
case 'server/time':
case 'server-time':
return apiResponse(200, ['timezone' => date_default_timezone_get(), 'time' => date('c')]);
case 'stats/containers':
case 'stats-getContainersList':
return apiResponse(200, getContainerStats());
Expand Down

0 comments on commit db5d941

Please sign in to comment.