Add user profile & dashboard insights
Introduce a user profile page and expand dashboard insights/UI. Added UserController::show and a new users/show view with user stats, domains, tags and groups; updated users index to include a "view profile" link and changed edit form action to /users/{id}/update. Enhanced DashboardController to compute registrar distribution, notification coverage, channel totals and dashboard tag usage; updated dashboard/index.php to show system status, expiring list, registrar/tag widgets and notification coverage panels. Minor controller hardening: DomainController now returns a permission message when a domain is inaccessible, and TagController enforces isolation-mode access checks. UI/JS improvements: add a Quick Actions dropdown in top-nav, refactor dropdown toggle/close logic in layout/base.php, and small notification markup tweak. Routes were adjusted to expose the new user profile endpoints.
This commit is contained in:
@@ -57,6 +57,37 @@ class DashboardController extends Controller
|
||||
$formattedRecentDomains = \App\Helpers\DomainHelper::formatMultiple($recentDomains);
|
||||
$formattedExpiringDomains = \App\Helpers\DomainHelper::formatMultiple($expiringThisMonth);
|
||||
|
||||
// Get all domains for registrar distribution & notification coverage
|
||||
if ($isolationMode === 'isolated') {
|
||||
$allDomains = $this->domainModel->getAllWithGroups($userId);
|
||||
} else {
|
||||
$allDomains = $this->domainModel->getAllWithGroups();
|
||||
}
|
||||
|
||||
// Registrar distribution
|
||||
$registrarCounts = [];
|
||||
foreach ($allDomains as $d) {
|
||||
$reg = !empty($d['registrar']) ? $d['registrar'] : 'Unknown';
|
||||
$registrarCounts[$reg] = ($registrarCounts[$reg] ?? 0) + 1;
|
||||
}
|
||||
arsort($registrarCounts);
|
||||
|
||||
// Notification coverage
|
||||
$domainsWithGroup = count(array_filter($allDomains, fn($d) => !empty($d['group_name'])));
|
||||
$totalDomainCount = count($allDomains);
|
||||
|
||||
// Total channels
|
||||
$totalChannels = 0;
|
||||
foreach ($groups as $g) { $totalChannels += ($g['channel_count'] ?? 0); }
|
||||
|
||||
// Get user's tags with usage
|
||||
$tagModel = new \App\Models\Tag();
|
||||
if ($isolationMode === 'isolated') {
|
||||
$dashTags = $tagModel->getAllWithUsage($userId);
|
||||
} else {
|
||||
$dashTags = $tagModel->getAllWithUsage();
|
||||
}
|
||||
|
||||
$this->view('dashboard/index', [
|
||||
'recentDomains' => $formattedRecentDomains,
|
||||
'expiringThisMonth' => $formattedExpiringDomains,
|
||||
@@ -64,6 +95,11 @@ class DashboardController extends Controller
|
||||
'recentLogs' => $recentLogs,
|
||||
'groups' => $groups,
|
||||
'systemStatus' => $systemStatus,
|
||||
'registrarCounts' => $registrarCounts,
|
||||
'domainsWithGroup' => $domainsWithGroup,
|
||||
'totalDomainCount' => $totalDomainCount,
|
||||
'totalChannels' => $totalChannels,
|
||||
'dashTags' => $dashTags,
|
||||
'title' => 'Dashboard'
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user