529 lines
17 KiB
PHP
529 lines
17 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Admin Panel - SingleLogin Portal</title>
|
|
<!-- Google Fonts: Outfit & Inter -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap" rel="stylesheet">
|
|
|
|
<style>
|
|
:root {
|
|
--bg-color: #0b0f19;
|
|
--card-bg: rgba(17, 24, 39, 0.7);
|
|
--card-border: rgba(255, 255, 255, 0.08);
|
|
--accent-primary: #6366f1;
|
|
--accent-secondary: #0078d4;
|
|
--text-main: #f3f4f6;
|
|
--text-muted: #9ca3af;
|
|
--success-color: #10b981;
|
|
--error-color: #ef4444;
|
|
--info-color: #06b6d4;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Inter', sans-serif;
|
|
background-color: var(--bg-color);
|
|
color: var(--text-main);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow-x: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
/* Glowing background circles */
|
|
body::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 500px;
|
|
height: 500px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
|
|
top: -200px;
|
|
left: -100px;
|
|
z-index: -1;
|
|
}
|
|
|
|
body::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 400px;
|
|
height: 400px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle, rgba(0, 120, 212, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
|
|
bottom: -100px;
|
|
right: -100px;
|
|
z-index: -1;
|
|
}
|
|
|
|
/* Navigation Bar */
|
|
.navbar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 20px 5%;
|
|
background: rgba(17, 24, 39, 0.4);
|
|
border-bottom: 1px solid var(--card-border);
|
|
backdrop-filter: blur(12px);
|
|
-webkit-backdrop-filter: blur(12px);
|
|
z-index: 100;
|
|
}
|
|
|
|
.nav-logo {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.5rem;
|
|
font-weight: 800;
|
|
background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 100%);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.nav-logo svg {
|
|
width: 24px;
|
|
height: 24px;
|
|
fill: #a5b4fc;
|
|
}
|
|
|
|
.nav-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.btn-nav {
|
|
color: var(--text-muted);
|
|
text-decoration: none;
|
|
font-size: 0.85rem;
|
|
font-weight: 500;
|
|
padding: 8px 16px;
|
|
border-radius: 8px;
|
|
border: 1px solid var(--card-border);
|
|
transition: all 0.25s ease;
|
|
}
|
|
|
|
.btn-nav:hover {
|
|
color: var(--text-main);
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|
background-color: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.btn-logout {
|
|
color: #ef4444;
|
|
border-color: rgba(239, 68, 68, 0.2);
|
|
}
|
|
|
|
.btn-logout:hover {
|
|
color: white;
|
|
background-color: var(--error-color);
|
|
border-color: transparent;
|
|
}
|
|
|
|
/* Dashboard Wrapper */
|
|
.dashboard-container {
|
|
flex: 1;
|
|
padding: 40px 5%;
|
|
max-width: 1200px;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
z-index: 10;
|
|
}
|
|
|
|
/* Welcome Section */
|
|
.admin-header {
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.admin-header h1 {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.admin-header p {
|
|
color: var(--text-muted);
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
/* Statistics Cards Grid */
|
|
.stats-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
gap: 20px;
|
|
margin-bottom: 40px;
|
|
}
|
|
|
|
.stat-card {
|
|
background-color: var(--card-bg);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 16px;
|
|
padding: 24px;
|
|
backdrop-filter: blur(8px);
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 0.8rem;
|
|
color: var(--text-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
margin-bottom: 6px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.stat-value {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.8rem;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.stat-icon {
|
|
font-size: 2rem;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
/* Users Management Card */
|
|
.users-card {
|
|
background-color: var(--card-bg);
|
|
border: 1px solid var(--card-border);
|
|
border-radius: 20px;
|
|
padding: 30px;
|
|
backdrop-filter: blur(16px);
|
|
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.card-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 24px;
|
|
flex-wrap: wrap;
|
|
gap: 12px;
|
|
}
|
|
|
|
.card-title {
|
|
font-family: 'Outfit', sans-serif;
|
|
font-size: 1.3rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Users Table styling */
|
|
.table-responsive {
|
|
overflow-x: auto;
|
|
width: 100%;
|
|
}
|
|
|
|
.users-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
text-align: left;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.users-table th {
|
|
padding: 12px 16px;
|
|
border-bottom: 1px solid var(--card-border);
|
|
color: var(--text-muted);
|
|
font-weight: 600;
|
|
font-size: 0.8rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.users-table td {
|
|
padding: 16px;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.users-table tr:last-child td {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.user-cell {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.user-avatar {
|
|
width: 38px;
|
|
height: 38px;
|
|
border-radius: 50%;
|
|
object-fit: cover;
|
|
border: 1px solid var(--card-border);
|
|
}
|
|
|
|
.user-avatar-fallback {
|
|
width: 38px;
|
|
height: 38px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-weight: 600;
|
|
color: white;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.user-name {
|
|
font-weight: 500;
|
|
color: var(--text-main);
|
|
}
|
|
|
|
.user-email {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
/* Badges */
|
|
.badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 4px 8px;
|
|
border-radius: 9999px;
|
|
font-size: 0.7rem;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.badge-admin {
|
|
background-color: rgba(99, 102, 241, 0.15);
|
|
color: #818cf8;
|
|
border: 1px solid rgba(99, 102, 241, 0.3);
|
|
}
|
|
|
|
.badge-user {
|
|
background-color: rgba(6, 182, 212, 0.15);
|
|
color: var(--info-color);
|
|
border: 1px solid rgba(6, 182, 212, 0.3);
|
|
}
|
|
|
|
.badge-microsoft {
|
|
background-color: rgba(16, 185, 129, 0.12);
|
|
color: var(--success-color);
|
|
border: 1px solid rgba(16, 185, 129, 0.25);
|
|
gap: 4px;
|
|
}
|
|
|
|
.badge-password {
|
|
background-color: rgba(245, 158, 11, 0.12);
|
|
color: #fbbf24;
|
|
border: 1px solid rgba(245, 158, 11, 0.25);
|
|
}
|
|
|
|
.action-btn {
|
|
background-color: transparent;
|
|
border: 1px solid var(--card-border);
|
|
color: var(--text-muted);
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.8rem;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.action-btn:hover {
|
|
color: var(--text-main);
|
|
border-color: rgba(255, 255, 255, 0.2);
|
|
background-color: rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.microsoft-icon-tiny {
|
|
display: inline-grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 1px;
|
|
width: 10px;
|
|
height: 10px;
|
|
}
|
|
|
|
.tiny-rect {
|
|
width: 4px;
|
|
height: 4px;
|
|
}
|
|
.tr1 { background-color: #f25022; }
|
|
.tr2 { background-color: #7fba00; }
|
|
.tr3 { background-color: #00a4ef; }
|
|
.tr4 { background-color: #ffb900; }
|
|
|
|
@media (max-width: 768px) {
|
|
.users-card {
|
|
padding: 20px 15px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- Nav -->
|
|
<header class="navbar">
|
|
<div class="nav-logo">
|
|
<svg viewBox="0 0 24 24">
|
|
<path d="M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,13C14.67,13 20,14.33 20,17V18H4V17C4,14.33 9.33,13 12,13Z" />
|
|
</svg>
|
|
SingleLogin Control Panel
|
|
</div>
|
|
<div class="nav-actions">
|
|
<!-- Allow Admin to view the User portal dashboard -->
|
|
<a href="{{ route('dashboard') }}" class="btn-nav">
|
|
User Dashboard
|
|
</a>
|
|
<form action="{{ route('logout') }}" method="POST" id="logout-form" style="display: none;">
|
|
@csrf
|
|
</form>
|
|
<a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="btn-nav btn-logout">
|
|
Sign Out
|
|
</a>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Main Container -->
|
|
<main class="dashboard-container">
|
|
|
|
<!-- Header -->
|
|
<section class="admin-header">
|
|
<h1>System Overview</h1>
|
|
<p>Welcome, <strong>{{ $admin->name }}</strong>. Monitoring active directories, credentials, and SSO logins.</p>
|
|
</section>
|
|
|
|
<!-- Stats Grid -->
|
|
<section class="stats-grid">
|
|
<div class="stat-card">
|
|
<div>
|
|
<div class="stat-label">Total Registrations</div>
|
|
<div class="stat-value">{{ $stats['total_users'] }}</div>
|
|
</div>
|
|
<div class="stat-icon" style="color: var(--accent-primary);">👥</div>
|
|
</div>
|
|
|
|
<div class="stat-card">
|
|
<div>
|
|
<div class="stat-label">Administrators</div>
|
|
<div class="stat-value">{{ $stats['admins_count'] }}</div>
|
|
</div>
|
|
<div class="stat-icon" style="color: #818cf8;">🛡️</div>
|
|
</div>
|
|
|
|
<div class="stat-card">
|
|
<div>
|
|
<div class="stat-label">Microsoft Connected</div>
|
|
<div class="stat-value">{{ $stats['microsoft_users'] }}</div>
|
|
</div>
|
|
<div class="stat-icon" style="color: var(--success-color);">☁️</div>
|
|
</div>
|
|
|
|
<div class="stat-card">
|
|
<div>
|
|
<div class="stat-label">Local Auth Only</div>
|
|
<div class="stat-value">{{ $stats['credentials_users'] }}</div>
|
|
</div>
|
|
<div class="stat-icon" style="color: #fbbf24;">🔑</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Users Table Card -->
|
|
<section class="users-card">
|
|
<div class="card-header">
|
|
<div class="card-title">User Accounts Directory</div>
|
|
<div style="font-size: 0.8rem; color: var(--text-muted);">
|
|
Showing registered system entities
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
<table class="users-table">
|
|
<thead>
|
|
<tr>
|
|
<th>User Account</th>
|
|
<th>Assigned Role</th>
|
|
<th>Authentication Type</th>
|
|
<th>Linked On</th>
|
|
<th style="text-align: right;">Operations</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($users as $usr)
|
|
<tr>
|
|
<td>
|
|
<div class="user-cell">
|
|
@if($usr->avatar)
|
|
<img src="{{ $usr->avatar }}" alt="{{ $usr->name }}" class="user-avatar">
|
|
@else
|
|
<div class="user-avatar-fallback">
|
|
{{ strtoupper(substr($usr->name, 0, 1)) }}
|
|
</div>
|
|
@endif
|
|
<div>
|
|
<div class="user-name">{{ $usr->name }}</div>
|
|
<div class="user-email">{{ $usr->email }}</div>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
@if($usr->role === 'admin')
|
|
<span class="badge badge-admin">Admin</span>
|
|
@else
|
|
<span class="badge badge-user">User</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
@if($usr->microsoft_id)
|
|
<span class="badge badge-microsoft">
|
|
<div class="microsoft-icon-tiny">
|
|
<div class="tiny-rect tr1"></div>
|
|
<div class="tiny-rect tr2"></div>
|
|
<div class="tiny-rect tr3"></div>
|
|
<div class="tiny-rect tr4"></div>
|
|
</div>
|
|
Microsoft OAuth
|
|
</span>
|
|
@else
|
|
<span class="badge badge-password">Local Password</span>
|
|
@endif
|
|
</td>
|
|
<td>
|
|
<span style="font-size: 0.85rem; color: var(--text-muted);">
|
|
{{ $usr->created_at ? $usr->created_at->format('Y-m-d H:i') : 'N/A' }}
|
|
</span>
|
|
</td>
|
|
<td style="text-align: right;">
|
|
<button class="action-btn" onclick="alert('Management feature toggled for {{ $usr->name }}')">Configure</button>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="5" style="text-align: center; color: var(--text-muted); padding: 30px;">
|
|
No registered accounts found in the database.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
</main>
|
|
|
|
<footer style="text-align: center; padding: 40px 0; font-size: 0.75rem; color: var(--text-muted); z-index: 10;">
|
|
© 2026 SingleLogin Systems. Authorized Access Only.
|
|
</footer>
|
|
</body>
|
|
</html>
|