From 2b71c0efd4f7c776eca9ecd9e35a35f11d32b283 Mon Sep 17 00:00:00 2001 From: DJP Date: Fri, 5 Sep 2025 10:15:50 -0400 Subject: [PATCH] Final user management system polish and visual improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add visual access level indicators in navigation bar - Include user access info display (Limited vs Full Access) - Add comprehensive admin dashboard permission badges - Style user role information with proper color coding - Complete frontend integration for permission system - Finalize all visual indicators and status displays 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- admin/src/App.vue | 22 +++++++++++++++++++++- admin/src/pages/Admin.vue | 39 ++++++++++++++++++++++++++++++++++++--- admin/src/services/api.js | 10 ++++++++++ 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/admin/src/App.vue b/admin/src/App.vue index c511ffa..e2acd35 100644 --- a/admin/src/App.vue +++ b/admin/src/App.vue @@ -16,7 +16,15 @@ @@ -148,6 +156,18 @@ export default { border-radius: 6px; } +.user-details { + display: flex; + flex-direction: column; + gap: 0.1rem; +} + +.user-access-info { + font-size: 0.6rem; + opacity: 0.8; + font-weight: 400; +} + .user-avatar { font-size: 0.8rem; width: 1.5rem; diff --git a/admin/src/pages/Admin.vue b/admin/src/pages/Admin.vue index 171b013..6044a70 100644 --- a/admin/src/pages/Admin.vue +++ b/admin/src/pages/Admin.vue @@ -63,9 +63,17 @@ {{ user.name }} {{ user.email }} - - {{ (user.preferences?.role || 'user').toUpperCase() }} - +
+ + {{ (user.preferences?.role || 'user').toUpperCase() }} + + + Limited ({{ user.preferences.allowedAgents.length }} agents) + + + Full Access + +
@@ -1660,6 +1668,31 @@ export default { color: #991b1b; } +/* User Role and Access Indicators */ +.user-role-info { + display: flex; + flex-direction: column; + gap: 0.25rem; +} + +.access-badge { + padding: 0.15rem 0.4rem; + border-radius: 10px; + font-size: 0.6rem; + font-weight: 500; + text-align: center; +} + +.access-badge.full { + background: #d1fae5; + color: #065f46; +} + +.access-badge.restricted { + background: #fef3c7; + color: #92400e; +} + .agents-table { background: white; border-radius: 8px; diff --git a/admin/src/services/api.js b/admin/src/services/api.js index 60ea27f..fb8b89e 100644 --- a/admin/src/services/api.js +++ b/admin/src/services/api.js @@ -18,6 +18,16 @@ api.interceptors.response.use( export const agentsAPI = { async getAll(admin = false) { const params = admin ? { admin: 'true' } : {}; + + // Add userId for permission filtering (unless admin request) + if (!admin) { + const currentUser = localStorage.getItem('currentUser'); + if (currentUser) { + const user = JSON.parse(currentUser); + params.userId = user.id; + } + } + const response = await api.get('/assistants', { params }) return response.data },