added server management
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<%- include('../navbar', {active: "admin-groups"}); %>
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4"><%= group.name %></h3>
|
||||
<h3 class="text-dark mb-4"><a style="text-decoration: none" href="/admin/groups">Groups</a> / <%= group.name %></h3>
|
||||
<div class="card shadow mb-5">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">Group editing</p>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%- include('../navbar', {active: "admin-groups"}); %>
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4">New group: </h3>
|
||||
<h3 class="text-dark mb-4"><a style="text-decoration: none" href="/admin/groups">Groups</a> / new </h3>
|
||||
<div class="card shadow mb-5">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">Group editing</p>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<%- include('../navbar', {active: "admin-groups"}); %>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4">Admin: Groups</h3>
|
||||
<h3 class="text-dark mb-4">Groups</h3>
|
||||
<div class="card shadow">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">User list</p>
|
||||
<p class="text-primary m-0 fw-bold">Group list</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@@ -22,13 +22,13 @@
|
||||
<th>Name</th>
|
||||
<th>Member count</th>
|
||||
<th>Server count</th>
|
||||
<th style="text-align: right;">Actions</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% groups.forEach(function (group) { %>
|
||||
<tr>
|
||||
<td><%= group.name %></td>
|
||||
<td><a style="text-decoration: none" href="/admin/groups/<%= group.name %>"><%= group.name %></a></td>
|
||||
<td><%= group.members.length %></td>
|
||||
<td>undefined</td>
|
||||
<td style="text-align: right;"><a class="btn btn-sm btn-primary" href="/admin/groups/<%= group.name %>"><i class="far fa-edit"></i></a> <a class="btn btn-sm btn-danger" href="/admin/groups/delete/<%= group.name %>"><i class="far fa-trash-alt"></i></a></td>
|
||||
|
||||
25
views/admin/server_new.ejs
Normal file
25
views/admin/server_new.ejs
Normal file
@@ -0,0 +1,25 @@
|
||||
<%- include('../navbar', {active: "admin-servers"}); %>
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4"><a style="text-decoration: none" href="/admin/groups">Servers</a> / new </h3>
|
||||
<div class="card shadow mb-5">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">Server editing</p>
|
||||
</div>
|
||||
<form method="POST" action="/admin/servers/add/">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3"><label class="form-label"><strong>Hostname</strong></label><input class="form-control" placeholder="exemple.accessgate" type="text" name="server_hostname"></div>
|
||||
<div class="mb-3"><label class="form-label"><strong>IP Address</strong></label><input class="form-control" placeholder="127.0.0.1" type="text" name="server_ip"></div>
|
||||
<div class="mb-3"><button class="btn btn-primary btn-sm" type="submit">Create server</button></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-3"><label class="form-label"><strong>User</strong></label><input class="form-control" placeholder="root" type="text" name="server_username"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%- include('../footer'); %>
|
||||
53
views/admin/servers.ejs
Normal file
53
views/admin/servers.ejs
Normal file
@@ -0,0 +1,53 @@
|
||||
<%- include('../navbar', {active: "admin-servers"}); %>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4">Servers</h3>
|
||||
<div class="card shadow">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">Server list</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6 text-nowrap">
|
||||
<div id="dataTable_length" class="dataTables_length" aria-controls="dataTable"><a class="btn btn-primary" href="/admin/servers/new" data-toggle="modal" >New server</a></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="text-md-end dataTables_filter" id="dataTable_filter"><label class="form-label"><input type="search" class="form-control form-control-sm" aria-controls="dataTable" placeholder="Search"></label></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive table mt-2" id="dataTable" role="grid" aria-describedby="dataTable_info">
|
||||
<table class="table my-0" id="dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hostname</th>
|
||||
<th>IP</th>
|
||||
<th>User</th>
|
||||
<th>Last pull</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% servers.forEach(function (server) { %>
|
||||
<tr>
|
||||
<td><%= server.hostname %></td>
|
||||
<td><%= server.ip %></td>
|
||||
<td><%= server.username %></td>
|
||||
<td><%= server.lastPull %></td>
|
||||
<td style="text-align: right;"> <a class="btn btn-sm btn-danger" href="/admin/servers/delete/<%= server.hostname %>"><i class="far fa-trash-alt"></i></a></td>
|
||||
</tr>
|
||||
<% }) %>
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%- include('../footer'); %>
|
||||
48
views/admin/user_edit.ejs
Normal file
48
views/admin/user_edit.ejs
Normal file
@@ -0,0 +1,48 @@
|
||||
<%- include('../navbar', {active: "admin-users"}); %>
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4"><a style="text-decoration: none" href="/admin/users/">Users</a> / <%= user.login %></h3></h3>
|
||||
<div class="card shadow mb-5">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">SSH Keys</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Key</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% keys.forEach(function (key) { %>
|
||||
<tr>
|
||||
<td><%= key.name %></td>
|
||||
|
||||
<td><%= key.content %></td>
|
||||
|
||||
<td style="text-align: right;"><a class="btn btn-sm btn-danger" href="/admin/users/<%= user.id %>/deleteKey/<%= key.name %>"><i class="far fa-trash-alt"></i></button></td>
|
||||
</tr>
|
||||
<% }) %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<form method="POST" action="/admin/users/<%= user.id %>/addKey/">
|
||||
<div class="mb-3"><label class="form-label"><strong>Name</strong></label><input class="form-control" type="text" name="key_name"></div>
|
||||
<div class="mb-3"><label class="form-label"><strong>Key</strong></label><textarea class="form-control" name="key_content" rows="2"></textarea></div>
|
||||
<div class="mb-3"></div>
|
||||
<div class="mb-3"><button class="btn btn-primary btn-sm" type="submit">Add key</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%- include('../footer'); %>
|
||||
@@ -1,6 +1,6 @@
|
||||
<%- include('../navbar', {active: "admin-users"}); %>
|
||||
<div class="container-fluid">
|
||||
<h3 class="text-dark mb-4">Admin: Users</h3>
|
||||
<h3 class="text-dark mb-4">Users</h3>
|
||||
<div class="card shadow">
|
||||
<div class="card-header py-3">
|
||||
<p class="text-primary m-0 fw-bold">User list</p>
|
||||
@@ -22,10 +22,11 @@
|
||||
<table class="table my-0" id="tableEnabled">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Username</th>
|
||||
<th>username</th>
|
||||
<th>id</th>
|
||||
<th>Admin</th>
|
||||
<th>Last login</th>
|
||||
<th>admin</th>
|
||||
<th>updated</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -34,8 +35,9 @@
|
||||
<td><img class="rounded-circle me-2" width="30" height="30" src="<%= user.avatar %>"><%= user.login %></td>
|
||||
<td><%= user.id %></td>
|
||||
<td><%= user.admin %></td>
|
||||
|
||||
<td><%= user.updatedAt %></td>
|
||||
<td style="text-align: right;"><a class="btn btn-sm btn-primary" href="/admin/users/<%= user.id %>"><i class="fas fa-key"></i></a> <a class="btn btn-sm btn-danger" href="/admin/users/delete/<%= user.id %>"><i class="far fa-trash-alt"></i></a></td>
|
||||
|
||||
</tr>
|
||||
<% }) %>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user