Revert change to text on "Add user" page, add an informative popup if a user is modified

This commit is contained in:
Luke Bakken 2019-08-26 10:22:23 -07:00
parent 50ecb3de21
commit 5b20c9a168
3 changed files with 12 additions and 4 deletions

View File

@ -187,8 +187,14 @@ dispatcher_add(function(sammy) {
'#/users');
});
sammy.put('#/users-add', function() {
if (sync_put(this, '/users/:username'))
res = sync_put(this, '/users/:username');
if (res) {
if (res.http_status === 204) {
username = res.req_params.username;
show_popup('warn', "Updated an existing user: '" + username + "'");
}
update();
}
return false;
});
sammy.put('#/users-modify', function() {

View File

@ -1300,7 +1300,9 @@ function sync_req(type, params0, path_template, options) {
if (type == 'GET')
return req.responseText;
else
return true;
// rabbitmq/rabbitmq-management#732
// https://developer.mozilla.org/en-US/docs/Glossary/Truthy
return {result: true, http_status: req.status, req_params: params};
}
else {
return false;

View File

@ -38,7 +38,7 @@
</div>
<div class="section-hidden">
<h2>Add / update a user</h2>
<h2>Add a user</h2>
<div class="hider">
<form action="#/users-add" method="put">
<table class="form">
@ -92,7 +92,7 @@
</td>
</tr>
</table>
<input type="submit" value="Add / update user"/>
<input type="submit" value="Add user"/>
</form>
</div>
</div>