add shortcut for localization (#4583)

This commit is contained in:
gabryon99 2020-10-15 19:02:14 +02:00
parent 5db4ec7c5d
commit 766e6dfd1e
5 changed files with 67 additions and 22 deletions

View file

@ -6,6 +6,7 @@ local title = users_type["ntopng"]
page_utils.print_page_title(title)
print [[
<div id="table-users"></div>
<script>
@ -18,6 +19,23 @@ print [[",
buttons: [
"<a href='#add_user_dialog' role='button' class='add-on btn' data-toggle='modal'><i class='fas fa-plus fa-sm'></i></a>"
],
tableCallback: function() {
// if there is `user` get param then open the user's modal
let user = "]] print(_GET["user"]) print [[";
if (user !== "nil" && isAdministrator) {
reset_pwd_dialog(user);
// set the preference tab
$(`#change-password-dialog`).removeClass('active');
$(`a[href='#change-password-dialog']`).removeClass('active');
$(`#li_change_prefs > a`).addClass('active');
$(`#change-prefs-dialog`).tab('show');
// show the modal
$(`#password_dialog`).modal('show');
}
},
columns: [
{
title: "]] print(i18n("login.username")) print[[",
@ -56,3 +74,10 @@ print [[",
</script>
]]
print([[
<script type='text/javascript'>
$(document).ready(function() {
});
</script>
]])