mirror of https://github.com/Aidaho12/haproxy-wi
103 lines
3.6 KiB
HTML
103 lines
3.6 KiB
HTML
{% from 'include/input_macros.html' import input, checkbox %}
|
|
{% if not adding %}
|
|
<table class="overview" id="ajax-users">
|
|
<thead>
|
|
<tr class="overviewHead">
|
|
<th class="padding10 first-collumn" id="user-login-th">Login</th>
|
|
<th style="width: 10%">Password</th>
|
|
<th style="width: 10%" id="user-active-th">Active</th>
|
|
<th style="width: 20%">Email</th>
|
|
<th style="width: 10%" id="user-role-th">Role</th>
|
|
{% if page != "servers.py" %}
|
|
<th style="width: 10%">Group</th>
|
|
{% endif %}
|
|
<th style="width: 100%" id="user-services-th">Services</th>
|
|
<th></th>
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% endif %}
|
|
{% for user in users %}
|
|
{% if user.role == 'superAdmin' and page == "servers.py" %}
|
|
{% set disable_superAdmin = "disabled" %}
|
|
{% endif %}
|
|
<tr id="user-{{user.user_id}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newuser{% endif %}">
|
|
<td class="padding10 first-collumn">
|
|
{% set login_id = 'login-' + user.user_id|string() %}
|
|
{% if user.6 == 1%}
|
|
{{ input(login_id, value=user.username, readonly='readonly') }}
|
|
{% else %}
|
|
{{ input(login_id, value=user.username) }}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if user.6 != 1%}
|
|
<span title="Change password" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserPasswordDialog('{{user.user_id}}')">
|
|
</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="checkbox">
|
|
{% set activeuser_id = 'activeuser-' + user.user_id|string() %}
|
|
{% if user.activeuser == 1 %}
|
|
{{ checkbox(activeuser_id, checked='checked', disabled=disable_superAdmin) }}
|
|
{% else %}
|
|
{{ checkbox(activeuser_id, disable_superAdmin) }}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% set email_id = 'email-' + user.user_id|string() %}
|
|
{% if user.ldap_user == 1%}
|
|
{{ input(email_id, value=user.email, readonly='readonly') }}
|
|
{% else %}
|
|
{{ input(email_id, value=user.email, type='email') }}
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<select id="role-{{user.user_id}}" name="role-{{user.user_id}}" {{disable_superAdmin}}>
|
|
<option disabled selected>Select a role</option>
|
|
{% for r in roles %}
|
|
{% if page == "servers.py" %}
|
|
{% if r.name != "superAdmin" %}
|
|
{% if user.role == r.name %}
|
|
<option value="{{ r.name }}" selected>{{ r.name }}</option>
|
|
{% else %}
|
|
<option value="{{ r.name }}">{{ r.name }}</option>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% if user.role == r.name %}
|
|
<option value="{{ r.name }}" selected>{{ r.name }}</option>
|
|
{% else %}
|
|
<option value="{{ r.name }}">{{ r.name }}</option>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</select>
|
|
</td>
|
|
{% if page != "servers.py" %}
|
|
<td>
|
|
<span title="Change user groups" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserGroupDialog('{{user.user_id}}')">
|
|
</td>
|
|
{% endif %}
|
|
<td>
|
|
<span title="Change user's services" style="cursor: pointer; margin-left: 15px;" class="div-pic" onclick="openChangeUserServiceDialog('{{user.user_id}}')">
|
|
</td>
|
|
<td>
|
|
<a href="history.py?service=user&user_id={{user.user_id}}" title="View history for this user" class="history"></a>
|
|
</td>
|
|
<td>
|
|
<a class="add" onclick="cloneUser({{user.user_id}})" id="clone-{{user.user_id}}" title="Copy the settings from {{user.1}}" style="cursor: pointer;"></a>
|
|
</td>
|
|
<td>
|
|
<a class="delete" onclick="confirmDeleteUser({{user.user_id}})" title="Delete user {{user.1}}" style="cursor: pointer;"></a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% if not adding %}
|
|
<tbody>
|
|
</table>
|
|
<br /><span class="add-button" title="Add user" id="add-user-button">+ Add</span>
|
|
<br /><br />
|
|
{% endif %} |