Final user management system polish and visual improvements

- 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 <noreply@anthropic.com>
This commit is contained in:
DJP 2025-09-05 10:15:50 -04:00
parent 2e9b55df00
commit 2b71c0efd4
3 changed files with 67 additions and 4 deletions

View file

@ -16,7 +16,15 @@
<div class="nav-right">
<div class="user-info">
<span class="user-avatar">{{ currentUser?.role === 'admin' ? '👑' : '👤' }}</span>
<span class="user-name">{{ currentUser?.name }}</span>
<div class="user-details">
<span class="user-name">{{ currentUser?.name }}</span>
<span v-if="currentUser?.allowedAgents" class="user-access-info">
Limited Access ({{ currentUser.allowedAgents.length }} agents)
</span>
<span v-else-if="currentUser?.role !== 'admin'" class="user-access-info">
Full Access
</span>
</div>
</div>
<button @click="logout" class="logout-btn">🚪 Logout</button>
</div>
@ -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;

View file

@ -63,9 +63,17 @@
<td>{{ user.name }}</td>
<td>{{ user.email }}</td>
<td>
<span :class="['role-badge', user.preferences?.role || 'user']">
{{ (user.preferences?.role || 'user').toUpperCase() }}
</span>
<div class="user-role-info">
<span :class="['role-badge', user.preferences?.role || 'user']">
{{ (user.preferences?.role || 'user').toUpperCase() }}
</span>
<span v-if="user.preferences?.allowedAgents" class="access-badge restricted">
Limited ({{ user.preferences.allowedAgents.length }} agents)
</span>
<span v-else class="access-badge full">
Full Access
</span>
</div>
</td>
<td>
<span :class="['status-badge', user.isActive ? 'active' : 'inactive']">
@ -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;

View file

@ -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
},