sdfsd
This commit is contained in:
@@ -1628,38 +1628,63 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($currentSection === 'database' && $databaseSectionActions !== []): ?>
|
||||
<?php if ($currentSection === 'database' && ($databaseSectionActions !== [] || is_array($moduleStatusPanel))): ?>
|
||||
<section class="setup-panel">
|
||||
<div class="setup-panel__head">
|
||||
<div>
|
||||
<span class="pill">Aktionen</span>
|
||||
<h2>Datenbankaktionen</h2>
|
||||
<p class="muted">Tabellenbezogene Wartungsaktionen koennen direkt hier ausgefuehrt werden.</p>
|
||||
<span class="pill">Datenbank</span>
|
||||
<h2>Datenbankaktionen und Tabellenstatus</h2>
|
||||
<p class="muted">Tabellenbezogene Wartungsaktionen und der aktuelle Schema-Status werden hier gemeinsam angezeigt.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setup-grid">
|
||||
<?php foreach ($databaseSectionActions as $action): ?>
|
||||
<?php
|
||||
$actionName = trim((string)($action['name'] ?? ''));
|
||||
$actionLabel = trim((string)($action['label'] ?? $actionName));
|
||||
$actionHelp = trim((string)($action['help'] ?? ''));
|
||||
if ($actionName === '' || $actionLabel === '') {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<div class="setup-field muted">
|
||||
<span><?= e($actionLabel) ?></span>
|
||||
<?php if ($actionHelp !== ''): ?>
|
||||
<small class="muted"><?= e($actionHelp) ?></small>
|
||||
<?php endif; ?>
|
||||
<div class="setup-actions" style="justify-content:flex-start; margin-top:12px;">
|
||||
<button class="nav-link" type="submit" name="module_setup_action" value="<?= e($actionName) ?>" formnovalidate>
|
||||
<?= e($actionLabel) ?>
|
||||
</button>
|
||||
<?php if ($databaseSectionActions !== []): ?>
|
||||
<div class="setup-grid">
|
||||
<?php foreach ($databaseSectionActions as $action): ?>
|
||||
<?php
|
||||
$actionName = trim((string)($action['name'] ?? ''));
|
||||
$actionLabel = trim((string)($action['label'] ?? $actionName));
|
||||
$actionHelp = trim((string)($action['help'] ?? ''));
|
||||
if ($actionName === '' || $actionLabel === '') {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<div class="setup-field muted">
|
||||
<span><?= e($actionLabel) ?></span>
|
||||
<?php if ($actionHelp !== ''): ?>
|
||||
<small class="muted"><?= e($actionHelp) ?></small>
|
||||
<?php endif; ?>
|
||||
<div class="setup-actions" style="justify-content:flex-start; margin-top:12px;">
|
||||
<button class="nav-link" type="submit" name="module_setup_action" value="<?= e($actionName) ?>" formnovalidate>
|
||||
<?= e($actionLabel) ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_array($moduleStatusPanel)): ?>
|
||||
<div class="setup-panel__head" style="margin-top:20px;">
|
||||
<div>
|
||||
<span class="pill">Status</span>
|
||||
<h3><?= e((string) $moduleStatusPanel['title']) ?></h3>
|
||||
<p class="muted">Der Status wird beim Aufruf der Setup-Seite automatisch geprueft.</p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setup-db-message setup-db-message--<?= e((string) $moduleStatusPanel['type']) ?>">
|
||||
<?= e((string) $moduleStatusPanel['text']) ?>
|
||||
</div>
|
||||
<?php if (!empty($moduleStatusPanel['stats']) && is_array($moduleStatusPanel['stats'])): ?>
|
||||
<div class="setup-grid" style="margin-top:16px;">
|
||||
<?php foreach ($moduleStatusPanel['stats'] as $stat): ?>
|
||||
<div class="setup-field muted">
|
||||
<span><?= e((string) ($stat['label'] ?? '')) ?></span>
|
||||
<div><?= e((string) ($stat['value'] ?? '')) ?></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -1698,30 +1723,6 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (($currentSection === 'general' || $currentSection === 'custom' || $currentSection === 'database') && is_array($moduleStatusPanel)): ?>
|
||||
<section class="setup-panel setup-panel--flat">
|
||||
<div class="setup-panel__head">
|
||||
<div>
|
||||
<span class="pill">Status</span>
|
||||
<h2><?= e((string) $moduleStatusPanel['title']) ?></h2>
|
||||
<p class="muted">Der Status wird beim Aufruf der Setup-Seite automatisch geprueft.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setup-db-message setup-db-message--<?= e((string) $moduleStatusPanel['type']) ?>">
|
||||
<?= e((string) $moduleStatusPanel['text']) ?>
|
||||
</div>
|
||||
<?php if (!empty($moduleStatusPanel['stats']) && is_array($moduleStatusPanel['stats'])): ?>
|
||||
<div class="setup-grid" style="margin-top:16px;">
|
||||
<?php foreach ($moduleStatusPanel['stats'] as $stat): ?>
|
||||
<label class="setup-field muted">
|
||||
<span><?= e((string) ($stat['label'] ?? '')) ?></span>
|
||||
<input type="text" value="<?= e((string) ($stat['value'] ?? '')) ?>" readonly>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($currentSection === 'database' && $dbGroups !== []): ?>
|
||||
<section class="setup-panel"<?= $databaseSetupFields === [] ? ' id="setup-general"' : '' ?>>
|
||||
@@ -1754,7 +1755,7 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="setup-db-panels" data-setup-db-panels <?= $showCustomDbConfig ? '' : 'hidden' ?>>
|
||||
<div class="setup-db-panels" data-setup-db-panels data-setup-db-custom-block <?= $showCustomDbConfig ? '' : 'hidden' ?>>
|
||||
<?php foreach ($dbGroups as $group => $label): ?>
|
||||
<?php
|
||||
$panelConfig = $getNested($current, $group);
|
||||
@@ -1935,12 +1936,30 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
||||
const modeField = document.querySelector('[name="use_separate_db"]');
|
||||
const tabsRoot = document.querySelector('[data-setup-db-root]');
|
||||
const panelsRoot = document.querySelector('[data-setup-db-panels]');
|
||||
if (!modeField || !tabsRoot || !panelsRoot) return;
|
||||
const customBlock = document.querySelector('[data-setup-db-custom-block]');
|
||||
const dbPanels = Array.from(document.querySelectorAll('.setup-db-panel'));
|
||||
if (!modeField || !tabsRoot || !panelsRoot || !customBlock) return;
|
||||
const sync = () => {
|
||||
const value = String(modeField.value || '').trim().toLowerCase();
|
||||
const isCustom = !['', '0', 'false', 'off', 'standard'].includes(value);
|
||||
tabsRoot.hidden = !isCustom;
|
||||
panelsRoot.hidden = !isCustom;
|
||||
customBlock.hidden = !isCustom;
|
||||
if (!isCustom) {
|
||||
dbPanels.forEach((panel) => {
|
||||
panel.hidden = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
const activeTab = document.querySelector('[data-setup-tab-target].is-active') || document.querySelector('[data-setup-tab-target]');
|
||||
const activeTargetId = activeTab ? activeTab.dataset.setupTabTarget : '';
|
||||
dbPanels.forEach((panel) => {
|
||||
if (tabsRoot.hidden || tabsRoot.childElementCount <= 1) {
|
||||
panel.hidden = false;
|
||||
return;
|
||||
}
|
||||
panel.hidden = panel.id !== activeTargetId;
|
||||
});
|
||||
};
|
||||
modeField.addEventListener('change', sync);
|
||||
sync();
|
||||
|
||||
Reference in New Issue
Block a user