Skip to content

Commit

Permalink
profile
Browse files Browse the repository at this point in the history
  • Loading branch information
iKAN2025 committed Jul 3, 2024
1 parent 13c2b45 commit 2dcfa51
Show file tree
Hide file tree
Showing 3 changed files with 626 additions and 312 deletions.
61 changes: 58 additions & 3 deletions _includes/create_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,56 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create User</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: black;
padding: 20px;
}

form {
max-width: 400px;
margin: 0 auto;
background-color: darkblue;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}

input[type="text"],
input[type="password"] {
width: calc(100% - 10px);
padding: 8px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}

input[type="checkbox"] {
margin-top: 5px;
}

button {
background-color: #3498db;
color: #ffffff;
border: none;
border-radius: 4px;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
}

button:hover {
background-color: #2980b9;
}
</style>
</head>
<body>
<form id="userForm">
Expand All @@ -18,24 +68,27 @@
<label for="kasm_server_needed">Kasm Server Needed:</label>
<input type="checkbox" id="kasm_server_needed" name="kasm_server_needed"><br>


<button type="button" onclick="submitForm()">Create User</button>
</form>

<script>
async function submitForm() {
const form = document.getElementById('userForm');
const formData = new FormData(form);


// Collect selected sections

// Create the payload
const payload = {
name: formData.get('name'),
uid: formData.get('uid'),
password: formData.get('password'),
kasm_server_needed: formData.get('kasm_server_needed') ? true : false
kasm_server_needed: formData.get('kasm_server_needed') === 'on',
};

try {
const response = await fetch('http://127.0.0.1:8086/api/user', {
const response = await fetch('http://127.0.0.1:8086/api/users/', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand All @@ -57,3 +110,5 @@
</script>
</body>
</html>


Loading

0 comments on commit 2dcfa51

Please sign in to comment.