| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- /** @var int $schemaVersion */
- /** @var string $dbPath */
- /** @var string $appEnv */
- /** @var \App\Domain\User|null $currentUser */
- /** @var bool $oidcConfigured */
- /** @var bool $localAdminEnabled */
- /** @var bool $authError */
- use function App\Http\e;
- ?>
- <section class="space-y-6">
- <?php if ($authError ?? false): ?>
- <div class="rounded-md border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">
- Sign-in failed. Check the server logs or the audit log for details.
- </div>
- <?php endif; ?>
- <?php if ($currentUser === null): ?>
- <div class="rounded-lg border bg-white p-6">
- <h1 class="text-2xl font-semibold tracking-tight">Sprint Planner</h1>
- <p class="text-slate-600 mt-2 max-w-prose">
- Sign in with your Microsoft account to get started. The first person
- to sign in becomes the admin automatically.
- </p>
- <div class="mt-4 flex flex-wrap items-center gap-3">
- <?php if ($oidcConfigured): ?>
- <a href="/auth/login"
- class="inline-flex items-center gap-2 rounded-md bg-slate-900 text-white px-4 py-2 text-sm font-medium hover:bg-slate-800">
- Sign in with Microsoft
- </a>
- <?php endif; ?>
- <?php if ($localAdminEnabled): ?>
- <a href="/auth/local"
- class="inline-flex items-center gap-2 rounded-md border border-slate-300 bg-white text-slate-700 px-4 py-2 text-sm font-medium hover:bg-slate-100">
- Sign in as local admin
- </a>
- <?php endif; ?>
- <?php if (!$oidcConfigured && !$localAdminEnabled): ?>
- <span class="inline-block rounded-md bg-slate-100 text-slate-600 px-3 py-2 text-sm">
- No sign-in method configured. Set <code>ENTRA_*</code> or
- <code>LOCAL_ADMIN_*</code> in <code>.env</code>.
- </span>
- <?php endif; ?>
- </div>
- </div>
- <?php else: ?>
- <div>
- <h1 class="text-2xl font-semibold tracking-tight">
- Welcome, <?= e($currentUser->displayName) ?>.
- </h1>
- <p class="text-slate-600 mt-1">
- <?= $currentUser->isAdmin
- ? 'You have admin rights.'
- : 'You are signed in.' ?>
- Sprints and tasks land in the next phases.
- </p>
- </div>
- <?php endif; ?>
- <div class="rounded-lg border bg-white p-4">
- <h2 class="text-sm font-semibold text-slate-700 uppercase tracking-wider">Runtime</h2>
- <dl class="mt-3 grid grid-cols-[max-content_1fr] gap-x-6 gap-y-1 text-sm">
- <dt class="text-slate-500">PHP</dt>
- <dd class="font-mono"><?= e(PHP_VERSION) ?></dd>
- <dt class="text-slate-500">APP_ENV</dt>
- <dd class="font-mono"><?= e($appEnv) ?></dd>
- <dt class="text-slate-500">SQLite file</dt>
- <dd class="font-mono break-all"><?= e($dbPath) ?></dd>
- <dt class="text-slate-500">Schema version</dt>
- <dd class="font-mono"><?= e($schemaVersion) ?></dd>
- <dt class="text-slate-500">OIDC</dt>
- <dd class="font-mono"><?= $oidcConfigured ? 'configured' : 'not configured' ?></dd>
- <dt class="text-slate-500">Local admin</dt>
- <dd class="font-mono"><?= $localAdminEnabled ? 'enabled' : 'disabled' ?></dd>
- </dl>
- </div>
- <div class="rounded-lg border bg-white p-4">
- <h2 class="text-sm font-semibold text-slate-700 uppercase tracking-wider">Health checks</h2>
- <ul class="mt-3 text-sm space-y-1">
- <li><a class="text-blue-700 hover:underline" href="/healthz"><code>/healthz</code></a> — liveness probe</li>
- </ul>
- </div>
- </section>
|