1
0
mirror of synced 2025-10-28 18:19:17 +00:00
This commit is contained in:
Valentin
2023-09-14 18:50:39 +02:00
parent 4d04f849dd
commit 05b4752183
10 changed files with 81 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
<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 shadow">
<div class="card-header py-3">
<p class="text-primary m-0 fw-bold">Server editing</p>
</div>
@@ -15,12 +15,32 @@
<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 class="mb-3">
<label class="form-label"><strong>User configuration</strong></label>
<div class="form-check">
<input class="form-check-input" type="radio" value="true" name="server_multi" id="server_user_false" checked>
<label class="form-check-label" for="server_user_false">
Per user key
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" value="false" name="server_multi" id="server_user_true">
<label class="form-check-label" for="server_user_true">
Only one user key
</label>
</div>
<div id="inputOther" style="display: none">
<div class="mb-3"><label class="form-label"><strong>User</strong></label><input class="form-control" value="root" type="text" name="server_username"></div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<%- include('../footer'); %>

View File

@@ -30,6 +30,7 @@
<th>username</th>
<th>id</th>
<th>admin</th>
<th>server user</th>
<th>updated</th>
<th></th>
</tr>
@@ -40,7 +41,8 @@
<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><%= user.serverUsername %></td>
<td><%= new Date(user.updatedAt).toLocaleString() %></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>

View File

@@ -29,19 +29,16 @@
}
function resizeTextArea(textarea) {
const { style, value } = textarea;
style.height = style.minHeight = 'auto';
style.minHeight = `${ Math.min(textarea.scrollHeight + 4, parseInt(textarea.style.maxHeight)) }px`;
style.height = `${ textarea.scrollHeight + 4 }px`;
$( "#server_user_false" ).on( "click", function() {
document.getElementById("inputOther").style.display = "none";
} );
$( "#server_user_true" ).on( "click", function() {
document.getElementById("inputOther").style.display = "";
} );
function fieldShow(value) {
console.log(value)
}
const textarea = document.getElementById('textarea');
textarea.addEventListener('input', () => {
resizeTextArea(textarea);
});
</script>
</body>
</html>