Page MenuHomeSealhub

status.html
No OneTemporary

status.html

<html>
<head>
<script src="/js/jquery.js"></script>
<meta charset="utf-8">
<title>Status użytkownika</title>
<style>
html{
background-color:gray;
}
body{
padding:20px;
background-color:white;
font-family:sans-serif;
max-width:50rem;
margin:0 auto;
}
.email{
color:gray;
font-size:0.8em;
}
li {
margin-bottom: 3px;
}
</style>
</head>
<body>
<center><h1>Zmień status użytkownika na:</h1></center>
<ul id="lista-uzytkownikow">
</ul>
<hr>
<input type="text" placeholder="Zmień status" id="username">
</body>
<script>
function readUserList(){
$("#lista-uzytkownikow").html("");
$.get("/api/v1/user", function(data) {
console.log(data);
for(var i in data) {
var entry = data[i];
var getVar = entry.username;
var node = $("<li>"+entry.username+" </br>Hasło:"+ entry.password + "</br> <a href='/user.html#"+getVar+"'> <button onclick='editUser("+getVar+")'>Edytuj</button></a> <button onclick='deleteUser(\""+getVar+"\")'>Usuń</button></li>");
$("#lista-uzytkownikow").append(node);
}
});
}
function addUser(){
var username = $("#username").val();
var password = $("#password").val();
$.post("/api/v1/user", {username: username, password: password}, function() {
readUserList();
});
}
function deleteUser(user){
//console.log(user);
$.ajax({
url: '/api/v1/user',
data: {username: user},
method: 'DELETE',
success: function(result) {
readUserList();
}
});
}
readUserList();
</script>
</html>

File Metadata

Mime Type
text/html
Expires
Mon, Dec 23, 02:03 (4 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556799
Default Alt Text
status.html (1 KB)

Event Timeline