nexus base
All checks were successful
Deploy / deploy-staging (push) Successful in 6s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-05-15 01:19:31 +02:00
parent 52158ef041
commit 3ed4fba58c
12 changed files with 1975 additions and 29 deletions

219
partials/landingpages/index.php Executable file → Normal file
View File

@@ -3,39 +3,202 @@ declare(strict_types=1);
$auth = app()->auth();
$authUser = $auth->user();
$ownerKey = auth_user_key();
$groups = auth_groups();
$service = dashboards();
$modules = array_values(array_filter(
$auth->filterModules(modules()->all()),
static fn (array $module): bool => !empty($module['enabled'])
));
?>
<section class="module-list-section" data-reveal>
<?php if ($authUser !== null): ?>
<div class="section-head">
<div style="display:flex; gap:10px; flex-wrap:wrap;">
<a class="nav-link" href="/modules">Module verwalten</a>
<?php if (auth_is_admin()): ?>
<a class="nav-link" href="/settings">Nexus Einstellungen</a>
<a class="nav-link" href="/exports/database.sql">SQL-Export</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if ($modules === []): ?>
<div class="empty-state" data-reveal>
Keine Module für den aktuellen Zugriff sichtbar.
$dashboardsList = [];
$pageModules = [];
$defaultDashboard = null;
$dashboardItems = [];
if ($authUser !== null && $service->available() && $ownerKey !== '') {
$defaultDashboard = $service->ensureDefaultDashboard($ownerKey, 'Mein Dashboard');
$dashboardsList = $service->listAccessibleDashboards($ownerKey, $groups);
$pageModules = $service->listPageModulesForOwner($ownerKey);
if ($defaultDashboard !== []) {
$dashboardItems = $service->listItems((int) ($defaultDashboard['id'] ?? 0));
}
}
$GLOBALS['layout_header_base_title'] = 'Nexus';
$GLOBALS['layout_header_title'] = 'Nexus';
$GLOBALS['layout_header_context'] = 'Übersicht';
$GLOBALS['layout_header_text'] = $authUser === null
? 'Zentraler Einstieg in Nexus und die verfügbaren Bereiche.'
: 'Persönliche Übersicht aus Dashboards, Seitenmodulen und klassischen Modulen.';
?>
<div class="module-shell"><div class="module-page-bg"><div class="module-page-stack">
<?php if ($authUser !== null): ?>
<header class="module-hero submenu-box">
<div class="module-hero-top module-hero-top--compact">
<nav class="module-tabs" aria-label="Nexus Navigation">
<a class="module-button module-button--tab-active" href="/">Nexus Übersicht</a>
<a class="module-button module-button--tab" href="/dashboard">Dashboard</a>
<a class="module-button module-button--tab" href="/dashboards">Dashboards</a>
<a class="module-button module-button--tab" href="/integrations">Integrationen</a>
<a class="module-button module-button--tab" href="/page-modules">Seitenmodule</a>
<?php if (auth_is_admin()): ?>
<a class="module-button module-button--tab" href="/modules">Aktive Module</a>
<?php endif; ?>
</nav>
<div class="module-hero-actions module-submenu-actions">
<a class="module-button module-button--secondary module-button--small" href="/settings">Nexus Einstellungen</a>
</div>
</div>
</header>
<section class="section-box">
<h2>Mein Standard-Dashboard</h2>
<p class="muted">Der schnellste Einstieg in deine wichtigsten Nexus-Inhalte.</p>
<?php if ($defaultDashboard === null || $defaultDashboard === []): ?>
<div class="dashboard-empty">Kein Dashboard verfügbar.</div>
<?php else: ?>
<div class="nexus-quick-grid">
<article class="card-box nexus-stat-card">
<span class="module-admin-meta__label">Dashboard</span>
<strong><?= e((string) ($defaultDashboard['title'] ?? 'Mein Dashboard')) ?></strong>
<p class="muted"><?= e((string) ($defaultDashboard['description'] ?? 'Persönliches Standard-Dashboard')) ?></p>
<a class="module-button module-button--secondary module-button--small" href="/dashboard?id=<?= (int) ($defaultDashboard['id'] ?? 0) ?>">Öffnen</a>
</article>
<article class="card-box nexus-stat-card">
<span class="module-admin-meta__label">Elemente</span>
<strong><?= count($dashboardItems) ?></strong>
<p class="muted">Aktive Dashboard-Elemente im Standard-Dashboard.</p>
</article>
<article class="card-box nexus-stat-card">
<span class="module-admin-meta__label">Seitenmodule</span>
<strong><?= count($pageModules) ?></strong>
<p class="muted">Eigene, on-the-fly angelegte Seitenmodule.</p>
</article>
<article class="card-box nexus-stat-card">
<span class="module-admin-meta__label">Klassische Module</span>
<strong><?= count($modules) ?></strong>
<p class="muted">Aktuell sichtbare, klassische Nexus-Module.</p>
</article>
</div>
<?php endif; ?>
</section>
<section class="section-box">
<h2>Dashboards</h2>
<p class="muted">Eigene und freigegebene Dashboards im globalen Nexus-System.</p>
<div class="module-admin-grid module-admin-grid--compact">
<?php foreach (array_slice($dashboardsList, 0, 6) as $dashboard): ?>
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2><?= e((string) ($dashboard['title'] ?? 'Dashboard')) ?></h2>
<p><?= e((string) ($dashboard['description'] ?? 'Flexible Dashboard-Fläche für Widgets und Seitenmodule.')) ?></p>
</div>
</div>
<div class="module-admin-meta">
<div class="module-admin-meta__item">
<span class="module-admin-meta__label">Sichtbarkeit</span>
<strong class="module-admin-badge"><?= e(ucfirst((string) ($dashboard['visibility'] ?? 'private'))) ?></strong>
</div>
</div>
<div class="module-admin-actions">
<a class="module-button module-button--secondary module-button--small" href="/dashboard?id=<?= (int) ($dashboard['id'] ?? 0) ?>">Öffnen</a>
</div>
</article>
<?php endforeach; ?>
</div>
</section>
<div class="module-admin-grid">
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2>Seitenmodule</h2>
<p>On-the-fly angelegte Zielseiten und eingebettete Tools.</p>
</div>
</div>
<div class="module-admin-meta">
<div class="module-admin-meta__item">
<span class="module-admin-meta__label">Anzahl</span>
<strong class="module-admin-badge module-admin-badge--success"><?= count($pageModules) ?></strong>
</div>
</div>
<div class="module-admin-actions">
<a class="module-button module-button--secondary module-button--small" href="/page-modules">Verwalten</a>
</div>
</article>
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2>Integrationen</h2>
<p>Zentrale Anbindungen an Home Assistant, Pi-hole, Proxmox und andere Systeme.</p>
</div>
</div>
<div class="module-admin-actions">
<a class="module-button module-button--secondary module-button--small" href="/integrations">Verwalten</a>
</div>
</article>
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2>Dashboards konfigurieren</h2>
<p>Eigene Dashboard-Flächen, Reihenfolge und Standard-Dashboard verwalten.</p>
</div>
</div>
<div class="module-admin-actions">
<a class="module-button module-button--secondary module-button--small" href="/dashboards">Öffnen</a>
</div>
</article>
</div>
<section class="section-box">
<h2>Klassische Module</h2>
<p class="muted">Die bisherigen Nexus-Module bleiben parallel zum neuen Grundgerüst bestehen.</p>
<div class="module-list">
<?php foreach ($modules as $module): ?>
<a class="module-row" href="<?= e((string) ($module['entry'] ?? ('/module/' . $module['name']))) ?>">
<span class="module-row__icon"><?= e(strtoupper(substr((string) ($module['title'] ?? $module['name']), 0, 1))) ?></span>
<span class="module-row__content">
<strong class="module-title"><?= e((string) ($module['title'] ?? $module['name'] ?? 'Modul')) ?></strong>
<span class="module-desc"><?= e((string) ($module['description'] ?? '')) ?></span>
</span>
</a>
<?php endforeach; ?>
</div>
</section>
<?php else: ?>
<div class="module-list">
<?php foreach ($modules as $module): ?>
<a class="module-row" href="<?= e((string)($module['entry'] ?? ('/module/' . $module['name']))) ?>">
<span class="module-row__icon"><?= e(strtoupper(substr((string)($module['title'] ?? $module['name']), 0, 1))) ?></span>
<span class="module-row__content">
<strong class="module-title"><?= e((string)($module['title'] ?? $module['name'] ?? 'Modul')) ?></strong>
<span class="module-desc"><?= e((string)($module['description'] ?? '')) ?></span>
</span>
</a>
<?php endforeach; ?>
</div>
<section class="section-box">
<h2>Nexus Einstieg</h2>
<p class="muted">Nach der Anmeldung stehen persönliche Dashboards, Integrationen und Seitenmodule bereit.</p>
<div class="module-admin-grid">
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2>Persönliche Dashboards</h2>
<p>Mehrere frei konfigurierbare Übersichten pro Benutzer.</p>
</div>
</div>
</article>
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2>Integrationen</h2>
<p>Zentrale Anbindungen für Fremdsysteme und externe Datenquellen.</p>
</div>
</div>
</article>
<article class="card-box module-admin-card">
<div class="module-admin-card__head">
<div class="module-admin-card__title">
<h2>Seitenmodule</h2>
<p>On-the-fly angelegte Links und eingebettete Weboberflächen.</p>
</div>
</div>
</article>
</div>
</section>
<?php endif; ?>
</section>
</div></div></div>