adasd
This commit is contained in:
@@ -13,6 +13,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
modules()->setEnabled($name, $enabled);
|
||||
$notice = $enabled ? 'Modul aktiviert.' : 'Modul deaktiviert.';
|
||||
$modules = modules()->all();
|
||||
} elseif ($name !== '' && $action === 'migrate') {
|
||||
$applied = modules()->applyPendingMigrations($name);
|
||||
$notice = count($applied) . ' Migration(en) angewendet.';
|
||||
$modules = modules()->all();
|
||||
} else {
|
||||
$error = 'Ungültige Aktion.';
|
||||
}
|
||||
@@ -49,6 +53,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$accessLabel = $hasSpecificAccess
|
||||
? 'Spezielle Zugriffsrechte'
|
||||
: ($authRequired ? 'Login erforderlich' : 'Kein Modulschutz');
|
||||
$migrationStatus = modules()->migrationStatus($module['name']);
|
||||
$pendingMigrations = $migrationStatus['pending'] ?? [];
|
||||
$changedMigrations = $migrationStatus['changed'] ?? [];
|
||||
?>
|
||||
<div class="card" style="background:var(--panel-2);">
|
||||
<div style="display:flex; align-items:center; justify-content:space-between; gap:12px;">
|
||||
@@ -61,8 +68,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<span class="pill" title="<?= e($accessLabel) ?>" style="<?= $hasSpecificAccess ? 'border-color:#f59e0b; color:#fbbf24;' : '' ?>">
|
||||
<?= e($accessLabel) ?>
|
||||
</span>
|
||||
<?php if ($pendingMigrations !== []): ?>
|
||||
<span class="pill" style="border-color:var(--accent-orange); color:var(--accent-orange);">
|
||||
<?= e((string)count($pendingMigrations)) ?> Migration(en)
|
||||
</span>
|
||||
<?php elseif (($migrationStatus['available'] ?? 0) > 0): ?>
|
||||
<span class="pill" style="border-color:var(--accent-green); color:var(--accent-green);">Schema aktuell</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($changedMigrations !== []): ?>
|
||||
<div class="muted" style="margin-top:.65rem; font-size:.85rem; color:var(--accent-orange);">
|
||||
Achtung: <?= e((string)count($changedMigrations)) ?> bereits angewendete Migration(en) wurden veraendert.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($hasSpecificAccess): ?>
|
||||
<div class="muted" style="margin-top:.65rem; font-size:.85rem;">
|
||||
<?php if ($authGroups !== []): ?>
|
||||
@@ -80,6 +99,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
<a class="nav-link" href="/module/<?= e($module['name']) ?>">Öffnen</a>
|
||||
<a class="nav-link" href="/modules/setup/<?= e($module['name']) ?>">Setup</a>
|
||||
<a class="nav-link" href="/modules/access/<?= e($module['name']) ?>">Zugriff</a>
|
||||
<?php if ($pendingMigrations !== []): ?>
|
||||
<form method="post" style="margin:0;">
|
||||
<input type="hidden" name="module" value="<?= e($module['name']) ?>">
|
||||
<button class="cta-button" name="action" value="migrate">Migrationen anwenden</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<form method="post" style="margin:0;">
|
||||
<input type="hidden" name="module" value="<?= e($module['name']) ?>">
|
||||
<button class="cta-button" name="action" value="disable" style="background:var(--panel); color:var(--text);">Deaktivieren</button>
|
||||
|
||||
Reference in New Issue
Block a user