Added support for users
This commit is contained in:
parent
646f0bb721
commit
88e2428a71
4 changed files with 220 additions and 2 deletions
|
|
@ -1,4 +1,8 @@
|
|||
<%inherit file="dashboard.phtml"/>
|
||||
<%block name="extra_css">
|
||||
<link href="${make_media_url('js/jsutils/css/popup.css', 'pastafari2')}" rel="stylesheet" />
|
||||
<link href="${make_media_url('css/popup.css', 'pastafari2')}" rel="stylesheet" />
|
||||
</%block>
|
||||
<%block name="content">
|
||||
<p><a href="${url_for('admin_app.pastafari2_dashboard')}">${_('Servers')}</a> >> ${server_data['hostname']} - ${_('Users')}</p>
|
||||
<p><a href="${url_for('admin_app.pastafari2_add_user', server_id=server_id)}">${_('Add new user to server')}</a></p>
|
||||
|
|
@ -6,13 +10,63 @@
|
|||
</div>
|
||||
<p><strong>*${_('Only can edit users system created from this control panel')}</strong></p>
|
||||
<p><a href="${url_for('admin_app.pastafari2_dashboard')}">${_('Servers')}</a> >> ${server_data['hostname']} - ${_('Users')}</p>
|
||||
<div id="popup_change" style="display:none;">
|
||||
<div class="title title_popup" style="">
|
||||
${lang('webservers', 'change_user_ssh_key', 'Change user ssh key for access')} <a href="#" class="close_icon close_popup"><i class="fa fa-window-close" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
<div class="cont cont_popup" style="">
|
||||
${_('If you want SSH access with this user, you can add a ssh pub key here.')}
|
||||
<form method="post" action="" id="form_change_password">
|
||||
<div class="form">
|
||||
<p><label for="username">${_('Username')}:</label> <span id="username_label"></span><input type="hidden" name="user" id="user_form" value=""/></p>
|
||||
<!--<p><label>User password
|
||||
<i class="fa fa-question-circle tooltip" data-tooltip-content="#tooltip_password_content" style="cursor:pointer;"></i>
|
||||
|
||||
</label><input type="password" class="" name="password" id="password_form" value="" /> <span class="error" id="password_error"></span></p>
|
||||
|
||||
<div class="tooltip_templates" style="display:none;"><div id="tooltip_password_content">User password used for the user if you want access to this server using this user. <strong>Remember, the password is not saved in pastafari</strong></div></div>
|
||||
|
||||
<p><label>Repeat User password</label><input type="password" class="" name="repeat_password" id="repeat_password_form" value="" /> <span class="error" id="repeat_password_error"></span></p>-->
|
||||
<p><label>SSH Pub Key</label><textarea name="ssh_pub_key" id="ssh_pub_key"></textarea></span><span class="error" id="ssh_pub_key_error"></span></p>
|
||||
</div>
|
||||
<input type="submit" value="${_('Change SSH key')}" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</%block>
|
||||
<%block name="jscript_block">
|
||||
<script src="${make_media_url('js/jsutils/posting2.js', 'pastafari2')}"></script>
|
||||
<script src="${make_media_url('js/jsutils/ajax_list.js', 'pastafari2')}"></script>
|
||||
<script language="Javascript" src="${make_media_url('js/jsutils/popup.js', 'pastafari2')}"></script>
|
||||
<script>
|
||||
options={'url': "${url_for('.pastafari2_get_server_users', server_id=server_id)}"};
|
||||
options={'url': "${url_for('.pastafari2_get_server_users', server_id=server_id)}", extra_data: {}, after_list: function () {
|
||||
|
||||
$('.change_password').popUp('#popup_change', 800, function (popup, container) {
|
||||
|
||||
$('#username_label').html($(container).html());
|
||||
$('#user_form').val($(container).html());
|
||||
|
||||
}, undefined, {});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
alist=$('#table_users').ajaxList('table_list', options);
|
||||
|
||||
options_post={'url': '${url_for("admin_app.pastafari2_change_user_password", server_id=server_id)}', 'loading': '#layer_loading', 'success': function (data) {
|
||||
|
||||
if(!data.error) {
|
||||
|
||||
$('.close_popup').click();
|
||||
|
||||
//location.reload();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$('#form_change_password').sendPost(options_post);
|
||||
|
||||
</script>
|
||||
</%block>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue