sdfsd
This commit is contained in:
@@ -1628,38 +1628,63 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
|||||||
</section>
|
</section>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($currentSection === 'database' && $databaseSectionActions !== []): ?>
|
<?php if ($currentSection === 'database' && ($databaseSectionActions !== [] || is_array($moduleStatusPanel))): ?>
|
||||||
<section class="setup-panel">
|
<section class="setup-panel">
|
||||||
<div class="setup-panel__head">
|
<div class="setup-panel__head">
|
||||||
<div>
|
<div>
|
||||||
<span class="pill">Aktionen</span>
|
<span class="pill">Datenbank</span>
|
||||||
<h2>Datenbankaktionen</h2>
|
<h2>Datenbankaktionen und Tabellenstatus</h2>
|
||||||
<p class="muted">Tabellenbezogene Wartungsaktionen koennen direkt hier ausgefuehrt werden.</p>
|
<p class="muted">Tabellenbezogene Wartungsaktionen und der aktuelle Schema-Status werden hier gemeinsam angezeigt.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setup-grid">
|
<?php if ($databaseSectionActions !== []): ?>
|
||||||
<?php foreach ($databaseSectionActions as $action): ?>
|
<div class="setup-grid">
|
||||||
<?php
|
<?php foreach ($databaseSectionActions as $action): ?>
|
||||||
$actionName = trim((string)($action['name'] ?? ''));
|
<?php
|
||||||
$actionLabel = trim((string)($action['label'] ?? $actionName));
|
$actionName = trim((string)($action['name'] ?? ''));
|
||||||
$actionHelp = trim((string)($action['help'] ?? ''));
|
$actionLabel = trim((string)($action['label'] ?? $actionName));
|
||||||
if ($actionName === '' || $actionLabel === '') {
|
$actionHelp = trim((string)($action['help'] ?? ''));
|
||||||
continue;
|
if ($actionName === '' || $actionLabel === '') {
|
||||||
}
|
continue;
|
||||||
?>
|
}
|
||||||
<div class="setup-field muted">
|
?>
|
||||||
<span><?= e($actionLabel) ?></span>
|
<div class="setup-field muted">
|
||||||
<?php if ($actionHelp !== ''): ?>
|
<span><?= e($actionLabel) ?></span>
|
||||||
<small class="muted"><?= e($actionHelp) ?></small>
|
<?php if ($actionHelp !== ''): ?>
|
||||||
<?php endif; ?>
|
<small class="muted"><?= e($actionHelp) ?></small>
|
||||||
<div class="setup-actions" style="justify-content:flex-start; margin-top:12px;">
|
<?php endif; ?>
|
||||||
<button class="nav-link" type="submit" name="module_setup_action" value="<?= e($actionName) ?>" formnovalidate>
|
<div class="setup-actions" style="justify-content:flex-start; margin-top:12px;">
|
||||||
<?= e($actionLabel) ?>
|
<button class="nav-link" type="submit" name="module_setup_action" value="<?= e($actionName) ?>" formnovalidate>
|
||||||
</button>
|
<?= e($actionLabel) ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</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>
|
</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>
|
</section>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
@@ -1698,30 +1723,6 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
|||||||
</section>
|
</section>
|
||||||
<?php endif; ?>
|
<?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 !== []): ?>
|
<?php if ($currentSection === 'database' && $dbGroups !== []): ?>
|
||||||
<section class="setup-panel"<?= $databaseSetupFields === [] ? ' id="setup-general"' : '' ?>>
|
<section class="setup-panel"<?= $databaseSetupFields === [] ? ' id="setup-general"' : '' ?>>
|
||||||
@@ -1754,7 +1755,7 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?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 foreach ($dbGroups as $group => $label): ?>
|
||||||
<?php
|
<?php
|
||||||
$panelConfig = $getNested($current, $group);
|
$panelConfig = $getNested($current, $group);
|
||||||
@@ -1935,12 +1936,30 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
|
|||||||
const modeField = document.querySelector('[name="use_separate_db"]');
|
const modeField = document.querySelector('[name="use_separate_db"]');
|
||||||
const tabsRoot = document.querySelector('[data-setup-db-root]');
|
const tabsRoot = document.querySelector('[data-setup-db-root]');
|
||||||
const panelsRoot = document.querySelector('[data-setup-db-panels]');
|
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 sync = () => {
|
||||||
const value = String(modeField.value || '').trim().toLowerCase();
|
const value = String(modeField.value || '').trim().toLowerCase();
|
||||||
const isCustom = !['', '0', 'false', 'off', 'standard'].includes(value);
|
const isCustom = !['', '0', 'false', 'off', 'standard'].includes(value);
|
||||||
tabsRoot.hidden = !isCustom;
|
tabsRoot.hidden = !isCustom;
|
||||||
panelsRoot.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);
|
modeField.addEventListener('change', sync);
|
||||||
sync();
|
sync();
|
||||||
|
|||||||
@@ -95,13 +95,15 @@ if (setupTabs.length > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const activateSetupTab = (targetId) => {
|
const activateSetupTab = (targetId) => {
|
||||||
|
const dbPanelsRoot = document.querySelector('[data-setup-db-panels]');
|
||||||
|
const dbPanelsHidden = dbPanelsRoot ? dbPanelsRoot.hidden : false;
|
||||||
for (const tab of setupTabs) {
|
for (const tab of setupTabs) {
|
||||||
const isActive = tab.dataset.setupTabTarget === targetId;
|
const isActive = tab.dataset.setupTabTarget === targetId;
|
||||||
tab.classList.toggle('is-active', isActive);
|
tab.classList.toggle('is-active', isActive);
|
||||||
tab.setAttribute('aria-selected', isActive ? 'true' : 'false');
|
tab.setAttribute('aria-selected', isActive ? 'true' : 'false');
|
||||||
}
|
}
|
||||||
for (const panel of setupPanels) {
|
for (const panel of setupPanels) {
|
||||||
const isActive = panel.id === targetId;
|
const isActive = !dbPanelsHidden && panel.id === targetId;
|
||||||
panel.hidden = !isActive;
|
panel.hidden = !isActive;
|
||||||
for (const control of panel.querySelectorAll('input, select, textarea')) {
|
for (const control of panel.querySelectorAll('input, select, textarea')) {
|
||||||
if (control.dataset.setupRequired === 'true') {
|
if (control.dataset.setupRequired === 'true') {
|
||||||
|
|||||||
Reference in New Issue
Block a user