mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
#268: Initial stubbed service calls.
This commit is contained in:
@@ -85,21 +85,47 @@
|
|||||||
var user_manager = new GuacAdmin.UserManager();
|
var user_manager = new GuacAdmin.UserManager();
|
||||||
users.appendChild(user_manager.getElement());
|
users.appendChild(user_manager.getElement());
|
||||||
|
|
||||||
|
function updateUsers() {
|
||||||
|
var user_list = GuacamoleService.Users.list();
|
||||||
|
user_manager.setUsers(user_list);
|
||||||
|
}
|
||||||
|
|
||||||
user_manager.onsave = function(id, password, connections) {
|
user_manager.onsave = function(id, password, connections) {
|
||||||
|
updateUsers();
|
||||||
console.log(id, password, connections);
|
console.log(id, password, connections);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
user_manager.onadd = function(username) {
|
user_manager.onadd = function(username) {
|
||||||
user_manager.add(username);
|
|
||||||
return true;
|
try {
|
||||||
|
GuacamoleService.Users.create(username);
|
||||||
|
updateUsers();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
alert("User \"" + username + "\" cannot be created: " + e.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
user_manager.onremove = function(username) {
|
user_manager.onremove = function(username) {
|
||||||
user_manager.remove(username);
|
|
||||||
return true;
|
try {
|
||||||
|
GuacamoleService.Users.remove(username);
|
||||||
|
updateUsers();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
alert("User \"" + username + "\" cannot be deleted: " + e.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateUsers();
|
||||||
|
|
||||||
]]></script>
|
]]></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
Reference in New Issue
Block a user