Files
enterprise_digital-platform/digiserver-v2/app/templates/admin/user_management.html
T
ske087 0aefadbfd8 NetworkView: API routing fix, logout button, audit trail, port/notes editor tracking
- Fix frontend API base path (VITE_API_BASE env var, GraphPage hardcoded /api)
- Add logout button to NetworkView sidebar (clears portal SSO)
- Add AuditTrail component: inline change history on all entity pages
- DB migration: add updated_at, last_edited_by to ports table
- DB migration: add notes_last_edited_by, notes_updated_at to all entity tables
- Backend: track actor on port create/update; notes editor on entity PUT
- Frontend: extend types, MarkdownEditor shows last editor, port modal/list show last editor
- Fix port CREATE TABLE definition to include new columns upfront
- Add try/catch in handleSavePort to surface API errors in modal
2026-05-10 23:10:02 +03:00

250 lines
5.3 KiB
HTML

{% extends "base.html" %}
{% block title %}User Management - DigiServer v2{% endblock %}
{% block content %}
<div class="page-header">
<h1>👥 User Management</h1>
</div>
<div class="portal-notice">
<span class="portal-notice-icon">🔒</span>
<div>
<strong>User accounts are managed by the Enterprise Digital Platform portal.</strong><br>
To create users or change roles, visit <a href="/settings" target="_blank">Portal Settings → Users</a>.
This page shows only the users who currently have access to DigiServer.
</div>
</div>
<!-- Users Table -->
<div class="card">
<h2>All Users</h2>
<div class="table-responsive">
<table class="user-table">
<thead>
<tr>
<th>Username</th>
<th>Role</th>
<th>Created At</th>
<th>Last Login</th>
</tr>
</thead>
<tbody>
{% if users %}
{% for user in users %}
<tr>
<td>
<strong>{{ user.username }}</strong>
{% if user.id == current_user.id %}
<span class="badge badge-info">You</span>
{% endif %}
</td>
<td>
<span class="badge badge-{{ 'success' if user.role == 'admin' else 'secondary' }}">
{{ user.role|capitalize }}
</span>
</td>
<td>{{ user.created_at | localtime if user.created_at else 'N/A' }}</td>
<td>{{ user.last_login | localtime if user.last_login else 'Never' }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="4" class="text-center">No users found</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</div>
<!-- Role Descriptions -->
<div class="card">
<h2>📖 Role Descriptions</h2>
<div class="role-descriptions">
<div class="role-item">
<h3>👤 Normal User</h3>
<ul>
<li>Upload media content</li>
<li>Add/remove media from playlists</li>
<li>Edit media in playlists</li>
<li>Set display time for media items</li>
<li>View players and groups</li>
</ul>
</div>
<div class="role-item">
<h3>👑 Admin User</h3>
<ul>
<li>All normal user permissions</li>
<li>Create and manage users</li>
<li>Manage players and groups</li>
<li>Delete content</li>
<li>Access system settings</li>
<li>View system logs</li>
</ul>
</div>
</div>
</div>
<style>
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.portal-notice {
display: flex;
align-items: flex-start;
gap: 12px;
background: #eff6ff;
border: 1px solid #93c5fd;
border-radius: 8px;
padding: 14px 18px;
margin-bottom: 20px;
font-size: 14px;
color: #1e40af;
}
.portal-notice a {
color: #1d4ed8;
font-weight: 600;
}
.portal-notice-icon {
font-size: 20px;
flex-shrink: 0;
}
body.dark-mode .portal-notice {
background: #1e293b;
border-color: #3b82f6;
color: #93c5fd;
}
body.dark-mode .portal-notice a {
color: #60a5fa;
}
.table-responsive {
overflow-x: auto;
}
.user-table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}
.user-table th,
.user-table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #e0e0e0;
}
.user-table th {
background: #f8f9fa;
font-weight: 600;
color: #495057;
}
.user-table tbody tr:hover {
background: #f8f9fa;
}
body.dark-mode .user-table th,
body.dark-mode .user-table td {
border-bottom: 1px solid #4a5568;
}
body.dark-mode .user-table th {
background: #1a202c;
color: #e2e8f0;
}
body.dark-mode .user-table tbody tr:hover {
background: #1a202c;
}
.badge {
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: 600;
display: inline-block;
}
.badge-success {
background: #28a745;
color: white;
}
.badge-secondary {
background: #6c757d;
color: white;
}
.badge-info {
background: #17a2b8;
color: white;
margin-left: 8px;
}
.role-descriptions {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-top: 15px;
}
.role-item {
padding: 15px;
background: #f8f9fa;
border-radius: 8px;
border: 1px solid #e2e8f0;
}
.role-item h3 {
margin-bottom: 10px;
color: #495057;
}
.role-item ul {
list-style-position: inside;
padding-left: 0;
}
.role-item li {
padding: 5px 0;
color: #666;
}
body.dark-mode .role-item {
background: #1a202c;
border: 1px solid #4a5568;
}
body.dark-mode .role-item h3 {
color: #e2e8f0;
}
body.dark-mode .role-item li {
color: #a0aec0;
}
.text-muted {
color: #6c757d;
}
.text-center {
text-align: center;
}
</style>
{% endblock %}