fix : masquer bouton Vérifier si FOLIO_REPO_URL non configuré, message explicatif
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,7 @@ function adminStatusBadge(array $a, int $now): string
|
|||||||
$_notices = isset($_updateChecker) ? $_updateChecker->adminNotices() : [];
|
$_notices = isset($_updateChecker) ? $_updateChecker->adminNotices() : [];
|
||||||
$_branch = isset($_updateChecker) ? $_updateChecker->getBranch() : 'main';
|
$_branch = isset($_updateChecker) ? $_updateChecker->getBranch() : 'main';
|
||||||
$_lastChecked = isset($_updateChecker) ? $_updateChecker->getLastChecked() : null;
|
$_lastChecked = isset($_updateChecker) ? $_updateChecker->getLastChecked() : null;
|
||||||
|
$_repoConfigured = (($_ENV['FOLIO_REPO_URL'] ?? getenv('FOLIO_REPO_URL') ?: '') !== '');
|
||||||
$_remoteLabel = '—';
|
$_remoteLabel = '—';
|
||||||
foreach ($_notices as $_n) {
|
foreach ($_notices as $_n) {
|
||||||
if ($_n['type'] === 'info' && preg_match('/v([\d]+\.[\d]+\.[\d]+)/', $_n['message'], $_m)) {
|
if ($_n['type'] === 'info' && preg_match('/v([\d]+\.[\d]+\.[\d]+)/', $_n['message'], $_m)) {
|
||||||
@@ -126,9 +127,13 @@ function adminStatusBadge(array $a, int $now): string
|
|||||||
<th class="text-muted fw-normal ps-0 pe-2 text-nowrap">Dernière version disponible</th>
|
<th class="text-muted fw-normal ps-0 pe-2 text-nowrap">Dernière version disponible</th>
|
||||||
<td class="d-flex align-items-center gap-2 flex-wrap">
|
<td class="d-flex align-items-center gap-2 flex-wrap">
|
||||||
<span><?= htmlspecialchars($_remoteLabel) ?><?= $_remoteLabel !== '—' && $_remoteLabel !== $_deployedLabel ? ' <span class="badge bg-warning text-dark ms-1">Mise à jour disponible</span>' : '' ?></span>
|
<span><?= htmlspecialchars($_remoteLabel) ?><?= $_remoteLabel !== '—' && $_remoteLabel !== $_deployedLabel ? ' <span class="badge bg-warning text-dark ms-1">Mise à jour disponible</span>' : '' ?></span>
|
||||||
|
<?php if ($_repoConfigured): ?>
|
||||||
<form method="POST" action="/?action=force_update_check" class="d-inline">
|
<form method="POST" action="/?action=force_update_check" class="d-inline">
|
||||||
<button type="submit" class="btn btn-outline-secondary btn-sm py-0">Vérifier</button>
|
<button type="submit" class="btn btn-outline-secondary btn-sm py-0">Vérifier</button>
|
||||||
</form>
|
</form>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="text-muted small">(<code>FOLIO_REPO_URL</code> non configuré)</span>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user