Files
server-manager/views/servers/team.php
Agent 5f5de248c6 Add server ownership, team access, role-based UI, and default admin role
- New migration 002_server_access.sql: created_by column + server_user table
- Server model: ownership, permission checks, team management methods
- Routes: /team routes, RoleMiddleware on /servers/create and /admin
- ServerController: permission checks via server_user, team CRUD methods
- TerminalController: server access checks
- DashboardController: filter servers by accessible ones
- ApiController: server access checks
- Views: team.php, team_server.php, sidebar Team link, hide actions by role
- Default user role changed from operator to admin on registration
- Admin user form defaults to admin role
2026-06-07 06:49:12 -04:00

61 lines
2.6 KiB
PHP

<?php $servers = $servers ?? []; ?>
<div class="page-header">
<div class="page-header-left">
<h1 class="page-title">Team Management</h1>
<p class="page-subtitle">Manage who has access to your servers</p>
</div>
</div>
<div class="card">
<div class="card-body">
<?php if (empty($servers)): ?>
<div class="empty-state">
<i class="fas fa-users-cog"></i>
<p>You don't own any servers yet.</p>
<p class="text-muted">Servers you create will appear here so you can manage their team access.</p>
<a href="/servers/create" class="btn btn-primary">Add Server</a>
</div>
<?php else: ?>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Server</th>
<th>IP Address</th>
<th>Status</th>
<th>Team Members</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($servers as $server): ?>
<tr>
<td>
<a href="/servers/<?= $server['id'] ?>">
<?= htmlspecialchars($server['name']) ?>
</a>
</td>
<td><code><?= htmlspecialchars($server['ip_address']) ?></code></td>
<td>
<span class="status-badge status-<?= $server['status'] ?? 'unknown' ?>">
<?= ucfirst($server['status'] ?? 'unknown') ?>
</span>
</td>
<td>
<span class="badge badge-info"><?= $server['member_count'] ?> members</span>
</td>
<td>
<a href="/team/<?= $server['id'] ?>" class="btn btn-sm">
<i class="fas fa-users"></i> Manage Team
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>