Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
iKAN2025 committed Jul 4, 2024
1 parent 2dcfa51 commit 01c03d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 60 deletions.
61 changes: 3 additions & 58 deletions _includes/create_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,6 @@
<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 @@ -68,27 +18,24 @@
<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') === 'on',
kasm_server_needed: formData.get('kasm_server_needed') ? true : false
};

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


4 changes: 2 additions & 2 deletions navigation/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ permalink: /profile
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Profile Setup</title>
<script type="module" src="{{site.baseurl}}/assets/js/api/config.js"></script>



<style>
/* Global styles */
body {
Expand Down Expand Up @@ -107,7 +108,6 @@ permalink: /profile
}
</style>

</style>
</head>
<body>

Expand Down

0 comments on commit 01c03d1

Please sign in to comment.