mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
Replace the separate /admin/status.php and /admin/logs.php pages with a single /admin/system.php page organised around a tab bar. - system.php — top-level tab bar: 'Statut' + one tab per log file (nginx accès, nginx erreurs, PHP-FPM). Switching tabs is a plain href (?tab=…) so no JS required for navigation; the lines-selector SELECT triggers a location change on 'change' for instant reload without a submit button. - Status tab preserves all existing service cards, PHP runtime grid, and disk-usage bar from the old status.php. - Log tabs preserve line-count selector, file metadata bar, and per-line colour coding from the old logs.php. - New: copy-to-clipboard button on each log output block (Clipboard API with textarea execCommand fallback). - status.php / logs.php replaced with 301 redirect stubs so existing bookmarks and links keep working. - templates/admin/head.php: 'Statut' + 'Journaux' nav items replaced with a single 'Système' item; active state covers all three page names for redirect compatibility.
41 lines
2.4 KiB
PHP
41 lines
2.4 KiB
PHP
<!DOCTYPE html>
|
||
<html lang="fr">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title><?= htmlspecialchars($pageTitle ?? 'Admin') ?> – Posterg</title>
|
||
<link rel="icon" type="image/svg+xml" href="/assets/admin_favicon.svg">
|
||
<link rel="stylesheet" href="/assets/modern-normalize.min.css">
|
||
<link rel="stylesheet" href="/assets/admin.css">
|
||
<?php if (php_sapi_name() === 'cli-server'): ?>
|
||
<script>
|
||
(function poll(){
|
||
fetch('/live-reload.php').then(r=>r.json()).then(d=>{
|
||
if(d.changed) location.reload(); else setTimeout(poll,1000);
|
||
}).catch(()=>setTimeout(poll,2000));
|
||
})();
|
||
</script>
|
||
<?php endif; ?>
|
||
</head>
|
||
<body class="admin-body">
|
||
<nav class="admin-nav">
|
||
<a href="/admin/" class="admin-nav__logo">Posterg</a>
|
||
<?php
|
||
$currentPage = basename($_SERVER['PHP_SELF']);
|
||
$thesisId = $_GET['id'] ?? null;
|
||
?>
|
||
<a href="/admin/" class="admin-nav__link <?= $currentPage === 'index.php' ? 'active' : '' ?>">Liste des TFE</a>
|
||
<a href="/admin/add.php" class="admin-nav__link <?= $currentPage === 'add.php' ? 'active' : '' ?>">Ajouter un TFE</a>
|
||
<a href="/admin/import.php" class="admin-nav__link <?= $currentPage === 'import.php' ? 'active' : '' ?>">Importer une liste de TFE</a>
|
||
<a href="/admin/pages.php" class="admin-nav__link <?= in_array($currentPage, ['pages.php','pages-edit.php']) ? 'active' : '' ?>">Pages statiques</a>
|
||
<a href="/admin/tags.php" class="admin-nav__link <?= $currentPage === 'tags.php' ? 'active' : '' ?>">Mots-clés</a>
|
||
<a href="/admin/system.php" class="admin-nav__link <?= in_array($currentPage, ['system.php','status.php','logs.php']) ? 'active' : '' ?>">Système</a>
|
||
<a href="/admin/account.php" class="admin-nav__link <?= $currentPage === 'account.php' ? 'active' : '' ?>">Compte</a>
|
||
<?php if ($thesisId && in_array($currentPage, ['edit.php', 'thanks.php'])): ?>
|
||
<a href="/admin/edit.php?id=<?= intval($thesisId) ?>" class="admin-nav__link <?= $currentPage === 'edit.php' ? 'active' : '' ?>">Modifier</a>
|
||
<?php endif; ?>
|
||
<?php if (defined('ADMIN_PASSWORD_HASH')): ?>
|
||
<a href="/admin/logout.php" class="admin-nav__link" style="margin-left:auto;opacity:.6;">Déconnexion</a>
|
||
<?php endif; ?>
|
||
</nav>
|