CMS 2.0 - Theme engine, logging, admin improvements
Major changes: - New ThemeManager with Twig templating and SCSS compilation - Dynamic themes system (themes/default, themes/demo) - LogManager with SQLite storage and syslog forwarding - RequestLogger with static helper methods - Admin UI overhaul (Bootstrap 5, dark mode) - Admin config page with logging and theme settings - Admin logs page with filters and search - Removed legacy Mustache templates - Removed test plugin and theme - Composer dependencies: Twig, scssphp, CommonMark, MaxMind GeoIP
This commit is contained in:
@@ -95,9 +95,9 @@
|
||||
value="<?= htmlspecialchars($configData['author']['name'] ?? '') ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="author_website" class="form-label">Website</label>
|
||||
<input type="url" class="form-control" id="author_website" name="author_website"
|
||||
value="<?= htmlspecialchars($configData['author']['website'] ?? '') ?>">
|
||||
<label for="author_website" class="form-label">Website URL</label>
|
||||
<input type="text" class="form-control" id="author_website" name="author_website"
|
||||
value="<?= htmlspecialchars($configData['author']['website'] ?? '') ?>" placeholder="bijv. noorlander.info">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -140,6 +140,84 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header">
|
||||
<i class="bi bi-journal-text"></i> Logging
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?php $logging = $configData['logging'] ?? []; ?>
|
||||
<div class="form-check mb-3">
|
||||
<input type="checkbox" class="form-check-input" id="logging_enabled" name="logging_enabled" value="1" <?= !empty($logging['enabled']) ? 'checked' : '' ?>>
|
||||
<label class="form-check-label" for="logging_enabled">Logging inschakelen</label>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="logging_driver" class="form-label">Opslag</label>
|
||||
<select class="form-select" id="logging_driver" name="logging_driver">
|
||||
<option value="sqlite" <?= ($logging['driver'] ?? 'sqlite') === 'sqlite' ? 'selected' : '' ?>>SQLite (standaard)</option>
|
||||
<option value="syslog" <?= ($logging['driver'] ?? '') === 'syslog' ? 'selected' : '' ?>>Syslog</option>
|
||||
</select>
|
||||
<div class="form-text">Kies <strong>Syslog</strong> om logregels naar een externe syslog-server te sturen. Logregels worden altijd ook lokaal opgeslagen.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="syslog_host" class="form-label">Syslog server (host)</label>
|
||||
<input type="text" class="form-control font-monospace" id="syslog_host" name="syslog_host"
|
||||
value="<?= htmlspecialchars($logging['syslog_host'] ?? '') ?>" placeholder="bijv. 192.168.1.10">
|
||||
<div class="form-text">Vul de host van de syslog-server in (bijv. <code>192.168.1.10</code> of <code>logs.example.com</code>).</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="syslog_port" class="form-label">Poort</label>
|
||||
<input type="number" class="form-control" id="syslog_port" name="syslog_port" min="1" max="65535"
|
||||
value="<?= (int)($logging['syslog_port'] ?? 514) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="syslog_facility" class="form-label">Facility</label>
|
||||
<select class="form-select" id="syslog_facility" name="syslog_facility">
|
||||
<?php foreach (['local0', 'local1', 'local2', 'local3', 'local4', 'local5', 'local6', 'local7', 'daemon', 'user', 'auth'] as $fac): ?>
|
||||
<option value="<?= $fac ?>" <?= ($logging['syslog_facility'] ?? 'local0') === $fac ? 'selected' : '' ?>><?= $fac ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="form-text">Categorie van de logbron (bijv. <code>local0</code>–<code>local7</code> voor eigen applicaties).</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="syslog_ident" class="form-label">Syslog ident</label>
|
||||
<input type="text" class="form-control font-monospace" id="syslog_ident" name="syslog_ident"
|
||||
value="<?= htmlspecialchars($logging['syslog_ident'] ?? 'codepress') ?>">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label fw-bold">Te registreren gebeurtenissen</label>
|
||||
<?php $events = $logging['events'] ?? []; ?>
|
||||
<div class="row">
|
||||
<?php
|
||||
$eventLabels = [
|
||||
'admin' => 'Admin activiteiten',
|
||||
'requests' => 'Requests (pagina bezoeken)',
|
||||
'errors' => 'Fouten & waarschuwingen',
|
||||
'security' => 'Beveiliging',
|
||||
'content' => 'Content wijzigingen',
|
||||
'system' => 'Systeem',
|
||||
];
|
||||
foreach ($eventLabels as $key => $label):
|
||||
?>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="logging_event_<?= $key ?>" name="logging_events[]" value="<?= $key ?>" <?= !empty($events[$key]) ? 'checked' : '' ?>>
|
||||
<label class="form-check-label" for="logging_event_<?= $key ?>"><?= $label ?></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-lg">
|
||||
<i class="bi bi-check-lg"></i> Configuratie opslaan
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user