mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Separate admin views from controllers — move HTML to templates/admin/
All admin pages refactored to thin controllers + pure view templates, mirroring the public-page pattern: Controllers (public/admin/*.php): auth, data loading, include template Views (templates/admin/*.php): pure HTML/PHP output Fragment partials (templates/admin/partials/): toast, system-log-panel, system-nginx-config-panel Pages migrated: login, tags, contenus, contenus-edit, account, acces-etudiante, thanks, add, edit, parametres, system, index Fragment endpoints refactored: system-fragment.php, toast-fragment.php Skipped (pure redirects): logout, logs, status, import
This commit is contained in:
40
app/templates/admin/partials/system-nginx-config-panel.php
Normal file
40
app/templates/admin/partials/system-nginx-config-panel.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php if ($nginxConfigMeta): ?>
|
||||
<div class="log-meta">
|
||||
<span data-label="Fichier"><?= htmlspecialchars($nginxConfigMeta['path']) ?></span>
|
||||
<span data-label="Taille"><?= $nginxConfigMeta['size'] ?></span>
|
||||
<span data-label="Modifié"><?= $nginxConfigMeta['mtime'] ?></span>
|
||||
<?php if ($nginxConfigSource === 'live'): ?>
|
||||
<span class="nginx-source-badge nginx-source-badge--live">● Config déployée</span>
|
||||
<?php else: ?>
|
||||
<span class="nginx-source-badge nginx-source-badge--local">⚠ Référence locale (config live inaccessible)</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($nginxConfigError !== null): ?>
|
||||
<div class="log-unavailable">
|
||||
<strong>Configuration nginx non disponible</strong>
|
||||
<div class="log-unavail-path"><?= htmlspecialchars($nginxConfigError) ?></div>
|
||||
<?php if (php_sapi_name() === 'cli-server'): ?>
|
||||
<div class="log-unavail-dev">
|
||||
En développement, <code>/etc/nginx/sites-available/posterg</code> n'existe pas.
|
||||
La config de référence se trouve dans <code>nginx/posterg.conf</code>.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php elseif (empty($nginxConfigLines)): ?>
|
||||
<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"
|
||||
onclick="copyLogContent(this);return false">
|
||||
Copier
|
||||
</button>
|
||||
<?php foreach ($nginxConfigLines as $i => $line): ?>
|
||||
<span class="log-line <?= SystemController::nginxLineClass($line) ?>"
|
||||
data-n="<?= $i + 1 ?>"><?= htmlspecialchars($line, ENT_QUOTES | ENT_SUBSTITUTE) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user