mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
feat: migrate admin system page to HTMX with tab-based navigation and log viewer
This commit is contained in:
@@ -77,7 +77,8 @@ if ($tab === 'nginx_config') {
|
||||
<div class="log-empty">Le fichier de configuration est vide.</div>
|
||||
<?php else: ?>
|
||||
<div class="log-output" id="log-output" role="region" aria-label="Configuration nginx">
|
||||
<button class="log-copy-btn" id="log-copy-btn" type="button" title="Copier la configuration">Copier</button>
|
||||
<button class="log-copy-btn" id="log-copy-btn" type="button" title="Copier la configuration"
|
||||
onclick="copyLogContent(this);return false">Copier</button>
|
||||
<?php foreach ($lines as $i => $line): ?>
|
||||
<span class="log-line <?= SystemController::nginxLineClass($line) ?>"
|
||||
data-n="<?= $i + 1 ?>"><?= htmlspecialchars($line, ENT_QUOTES | ENT_SUBSTITUTE) ?></span>
|
||||
@@ -93,12 +94,19 @@ if ($tab === 'nginx_config') {
|
||||
$logMeta = $data['meta'];
|
||||
?>
|
||||
<div class="log-toolbar">
|
||||
<label for="lines-select">Afficher</label>
|
||||
<select id="lines-select" aria-label="Nombre de lignes">
|
||||
<form id="lines-form" hx-get="/admin/system-fragment.php"
|
||||
hx-target="#sys-tab-panel"
|
||||
hx-swap="innerHTML"
|
||||
hx-indicator="#sys-tab-panel"
|
||||
hx-trigger="change"
|
||||
hx-vals='{"tab":"<?= htmlspecialchars($tab) ?>"}'>
|
||||
<label for="lines-select">Afficher</label>
|
||||
<select id="lines-select" name="n" aria-label="Nombre de lignes">
|
||||
<?php foreach (SystemController::ALLOWED_LINES as $opt): ?>
|
||||
<option value="<?= $opt ?>" <?= $opt === $n ? 'selected' : '' ?>><?= $opt ?> dernières lignes</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</select>
|
||||
</form>
|
||||
<?php if ($logLines !== null && count($logLines) > 0): ?>
|
||||
<span class="log-count-badge"><?= count($logLines) ?> ligne(s)</span>
|
||||
<?php endif; ?>
|
||||
@@ -127,7 +135,8 @@ if ($tab === 'nginx_config') {
|
||||
<div class="log-empty">Le fichier journal est vide.</div>
|
||||
<?php else: ?>
|
||||
<div class="log-output" id="log-output" role="log" aria-live="off" aria-label="Contenu du journal">
|
||||
<button class="log-copy-btn" id="log-copy-btn" type="button" title="Copier le contenu">Copier</button>
|
||||
<button class="log-copy-btn" id="log-copy-btn" type="button" title="Copier le contenu"
|
||||
onclick="copyLogContent(this);return false">Copier</button>
|
||||
<?php foreach ($logLines as $i => $line): ?>
|
||||
<span class="log-line <?= SystemController::logLineClass($line) ?>"
|
||||
data-n="<?= count($logLines) - $i ?>"><?= htmlspecialchars($line, ENT_QUOTES | ENT_SUBSTITUTE) ?></span>
|
||||
|
||||
Reference in New Issue
Block a user