From 74cf9739d64af59ba39b45de29cad05fb0b0152a Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:26:52 -0400 Subject: [PATCH 1/7] refactor: replace sidebar user footer with topbar dropdown menu --- public/assets/css/style.css | 54 +++++++++++++++++++++++++------------ public/assets/js/main.js | 28 +++++++++++++++++++ views/layouts/main.php | 49 +++++++++++++++++++-------------- 3 files changed, 94 insertions(+), 37 deletions(-) diff --git a/public/assets/css/style.css b/public/assets/css/style.css index 789c036..f373a86 100755 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -301,10 +301,7 @@ code, pre { .sidebar.collapsed .nav-chevron, .sidebar.collapsed .notification-badge, .sidebar.collapsed .nav-divider, -.sidebar.collapsed .nav-section, -.sidebar.collapsed .user-details, -.sidebar.collapsed .user-menu, -.sidebar.collapsed .sidebar-footer { +.sidebar.collapsed .nav-section { display: none; } @@ -317,10 +314,6 @@ code, pre { padding: 0.65rem; } -.sidebar.collapsed .user-info { - justify-content: center; -} - /* ========================================================================== Main Content ========================================================================== */ @@ -374,6 +367,39 @@ code, pre { font-size: 0.88rem; color: var(--text-secondary); white-space: nowrap; + cursor: pointer; + background: none; + border: none; + font-family: inherit; + padding: 0.4rem 0.6rem; + border-radius: var(--radius-sm); + transition: background var(--transition); +} + +.topbar-user:hover { + background: var(--bg-hover); +} + +.topbar-user-dropdown { + position: relative; +} + +.dropdown-menu-right { + right: 0; + left: auto; +} + +.dropdown-header { + padding: 0.55rem 1rem; + font-size: 0.88rem; + display: flex; + flex-direction: column; + gap: 2px; +} + +.dropdown-header small { + font-size: 0.72rem; + color: var(--text-muted); } .btn-icon { @@ -1056,7 +1082,8 @@ textarea.form-input { box-shadow: var(--shadow-lg); } -.dropdown.active .dropdown-menu { +.dropdown.active .dropdown-menu, +.dropdown-menu.open { display: block; } @@ -2302,10 +2329,7 @@ textarea.form-input { .sidebar.mobile-open.collapsed .nav-chevron, .sidebar.mobile-open.collapsed .notification-badge, .sidebar.mobile-open.collapsed .nav-divider, - .sidebar.mobile-open.collapsed .nav-section, - .sidebar.mobile-open.collapsed .user-details, - .sidebar.mobile-open.collapsed .user-menu, - .sidebar.mobile-open.collapsed .sidebar-footer { + .sidebar.mobile-open.collapsed .nav-section { display: flex; } @@ -2318,10 +2342,6 @@ textarea.form-input { padding: 0.65rem 1.25rem; } - .sidebar.mobile-open.collapsed .user-info { - justify-content: flex-start; - } - .main-area { margin-left: 0 !important; } diff --git a/public/assets/js/main.js b/public/assets/js/main.js index 2fdaecf..d678ca3 100644 --- a/public/assets/js/main.js +++ b/public/assets/js/main.js @@ -200,3 +200,31 @@ function toggleServerList(e) { sub.style.maxHeight = sub.scrollHeight + 'px'; } } + +function toggleUserMenu(e) { + e.stopPropagation(); + const menu = document.getElementById('userMenu'); + if (!menu) return; + const isOpen = menu.classList.contains('open'); + document.querySelectorAll('.dropdown-menu.open').forEach(function(m) { + if (m !== menu) m.classList.remove('open'); + }); + if (!isOpen) { + menu.classList.add('open'); + setTimeout(function() { + document.addEventListener('click', closeUserMenu); + }, 0); + } else { + menu.classList.remove('open'); + } +} + +function closeUserMenu(e) { + const menu = document.getElementById('userMenu'); + if (!menu) return; + const wrapper = menu.closest('.topbar-user-dropdown'); + if (wrapper && !wrapper.contains(e.target)) { + menu.classList.remove('open'); + document.removeEventListener('click', closeUserMenu); + } +} diff --git a/views/layouts/main.php b/views/layouts/main.php index f2ae26a..c3f9f9f 100755 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -120,22 +120,7 @@ if (!isset($user) || $user === null) { - + @@ -171,10 +156,34 @@ if (!isset($user) || $user === null) { - - - - + -- 2.43.0 From 00bad074d3b9bb961f467e7802369a7c06643404 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:31:27 -0400 Subject: [PATCH 2/7] fix: remove notifications link from user menu, add view-all button to notification dropdown, fix admin link --- public/assets/css/style.css | 17 +++++++++++++++++ public/assets/js/main.js | 11 +++++++++-- views/layouts/main.php | 3 +-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/public/assets/css/style.css b/public/assets/css/style.css index f373a86..92cfe35 100755 --- a/public/assets/css/style.css +++ b/public/assets/css/style.css @@ -3300,4 +3300,21 @@ input[type="range"]::-moz-range-track { overflow-y: auto; } +.notif-view-all { + display: flex; + align-items: center; + justify-content: center; + padding: 10px 16px; + font-size: 0.82rem; + color: var(--accent); + text-decoration: none; + border-top: 1px solid var(--border-color); + transition: background var(--transition); +} + +.notif-view-all:hover { + background: var(--bg-hover); + color: var(--accent-hover); +} + diff --git a/public/assets/js/main.js b/public/assets/js/main.js index d678ca3..1f65470 100644 --- a/public/assets/js/main.js +++ b/public/assets/js/main.js @@ -48,14 +48,14 @@ function fetchNotifications() { list.innerHTML = '
Could not load notifications.
'; return; } - renderNotifications(d.data || [], d.unread_count || 0); + renderNotifications(d.data || [], d.unread_count || 0, d.pagination?.total || 0); }) .catch(() => { list.innerHTML = '
Failed to load notifications.
'; }); } -function renderNotifications(items, unreadCount) { +function renderNotifications(items, unreadCount, total) { const list = document.getElementById('notifList'); if (!items.length) { @@ -85,6 +85,13 @@ function renderNotifications(items, unreadCount) { + (n.is_read ? '' : '
') + ''; }); + + if (total > items.length) { + html += '' + + 'View all notifications (' + total + ' total)' + + ''; + } + list.innerHTML = html; document.getElementById('markAllReadBtn').style.display = unreadCount > 0 ? 'inline-flex' : 'none'; diff --git a/views/layouts/main.php b/views/layouts/main.php index c3f9f9f..615de9e 100755 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -169,11 +169,10 @@ if (!isset($user) || $user === null) { My Account - Notifications Audit Log - Administration + Administration
-- 2.43.0 From 379158ac93bddfb227f5b7c40c5bf9c87f2f377b Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:33:05 -0400 Subject: [PATCH 3/7] fix: center profile page content --- views/auth/profile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/auth/profile.php b/views/auth/profile.php index e69e4a5..f17d16f 100755 --- a/views/auth/profile.php +++ b/views/auth/profile.php @@ -5,7 +5,7 @@

Manage your account settings

-
+

Account Information

@@ -23,7 +23,7 @@
-
+

Update Profile

-- 2.43.0 From 8fbc0f164a1546c939f6fcb3529332427754323a Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:34:27 -0400 Subject: [PATCH 4/7] fix: restore profile card layout, simplify user menu to My Account and Log out --- views/auth/profile.php | 4 ++-- views/layouts/main.php | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/views/auth/profile.php b/views/auth/profile.php index f17d16f..e69e4a5 100755 --- a/views/auth/profile.php +++ b/views/auth/profile.php @@ -5,7 +5,7 @@

Manage your account settings

-
+

Account Information

@@ -23,7 +23,7 @@
-
+

Update Profile

diff --git a/views/layouts/main.php b/views/layouts/main.php index 615de9e..c9776cd 100755 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -169,11 +169,6 @@ if (!isset($user) || $user === null) {
My Account - - - Audit Log - Administration - -- 2.43.0 From 36b0d8dfd9fa695d1f058cca27d2c2cbdbb6d65c Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:36:45 -0400 Subject: [PATCH 5/7] fix: close notification dropdown when opening user menu and vice versa --- public/assets/js/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/assets/js/main.js b/public/assets/js/main.js index 1f65470..4699df1 100644 --- a/public/assets/js/main.js +++ b/public/assets/js/main.js @@ -17,6 +17,8 @@ function openNotifications() { const dd = document.getElementById('notifDropdown'); dd.classList.add('open'); fetchNotifications(); + const userMenu = document.getElementById('userMenu'); + if (userMenu) userMenu.classList.remove('open'); document.addEventListener('click', notifOutsideClick); } @@ -31,6 +33,11 @@ function notifOutsideClick(e) { if (!wrapper.contains(e.target)) { closeNotifications(); } + const userWrapper = document.querySelector('.topbar-user-dropdown'); + if (userWrapper && !userWrapper.contains(e.target)) { + const userMenu = document.getElementById('userMenu'); + if (userMenu) userMenu.classList.remove('open'); + } } function fetchNotifications() { @@ -218,6 +225,7 @@ function toggleUserMenu(e) { }); if (!isOpen) { menu.classList.add('open'); + closeNotifications(); setTimeout(function() { document.addEventListener('click', closeUserMenu); }, 0); -- 2.43.0 From e6017b80daa5b4d2756aff48715f00e349211b74 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:39:33 -0400 Subject: [PATCH 6/7] feat: group admin sidebar items into single Administration page with action cards --- routes/web.php | 5 +--- src/Controllers/AdminController.php | 7 ++++++ views/admin/index.php | 35 ++++++++++++++++++++++++++++ views/layouts/main.php | 36 +++-------------------------- 4 files changed, 46 insertions(+), 37 deletions(-) create mode 100644 views/admin/index.php diff --git a/routes/web.php b/routes/web.php index a4b32c9..245b034 100755 --- a/routes/web.php +++ b/routes/web.php @@ -96,10 +96,7 @@ $router->post('/terminal/:id/execute', [TerminalController::class, 'execute'], [ $router->get('/terminal/:id/history', [TerminalController::class, 'history'], [AuthMiddleware::class]); $router->post('/terminal/:id/clear-history', [TerminalController::class, 'clearHistory'], [AuthMiddleware::class, CSRFMiddleware::class]); -$router->get('/admin', function () { - $view = \ServerManager\Core\App::getInstance()->getView(); - $view->redirect('/admin/audit'); -}, [AuthMiddleware::class, RoleMiddleware::class]); +$router->get('/admin', [AdminController::class, 'index'], [AuthMiddleware::class, RoleMiddleware::class]); $router->get('/admin/activity', function () { $view = \ServerManager\Core\App::getInstance()->getView(); diff --git a/src/Controllers/AdminController.php b/src/Controllers/AdminController.php index edf2647..97e7988 100755 --- a/src/Controllers/AdminController.php +++ b/src/Controllers/AdminController.php @@ -37,6 +37,13 @@ class AdminController } } + public function index(): void + { + $this->view->display('admin.index', [ + 'title' => 'Administration - ServerManager', + ]); + } + public function users(): void { $this->requireSuperAdmin(); diff --git a/views/admin/index.php b/views/admin/index.php new file mode 100644 index 0000000..3f61738 --- /dev/null +++ b/views/admin/index.php @@ -0,0 +1,35 @@ + + + diff --git a/views/layouts/main.php b/views/layouts/main.php index c9776cd..a6d60d4 100755 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -67,39 +67,9 @@ if (!isset($user) || $user === null) { - - - Teams - - - - - Users - - - - - Audit Logs - - - - - Security - - - - - App Version - - - - - Notifications - - - - - Policies + + + Administration -- 2.43.0 From f8ce4066fe7c4e463e381db9670da7a51d6aa52e Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 14 Jun 2026 09:41:42 -0400 Subject: [PATCH 7/7] fix: remove Notifications link from sidebar --- views/layouts/main.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/views/layouts/main.php b/views/layouts/main.php index a6d60d4..4c02d6a 100755 --- a/views/layouts/main.php +++ b/views/layouts/main.php @@ -44,12 +44,6 @@ if (!isset($user) || $user === null) { Dashboard - - - - Notifications - -