mirror of https://github.com/Aidaho12/haproxy-wi
parent
b4dc2a24cf
commit
a9783ee58d
|
@ -966,7 +966,7 @@ def update_db_v_6_2_1():
|
||||||
|
|
||||||
def update_ver():
|
def update_ver():
|
||||||
try:
|
try:
|
||||||
Version.update(version='6.2.2.0').execute()
|
Version.update(version='6.2.3.0').execute()
|
||||||
except Exception:
|
except Exception:
|
||||||
print('Cannot update version')
|
print('Cannot update version')
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class SshConnection:
|
||||||
|
|
||||||
def run_command(self, command):
|
def run_command(self, command):
|
||||||
try:
|
try:
|
||||||
stdin, stdout, stderr = self.ssh.exec_command(command, get_pty=True)
|
stdin, stdout, stderr = self.ssh.exec_command(command, get_pty=True, timeout=2)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise paramiko.SSHException(str(e))
|
raise paramiko.SSHException(str(e))
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@ a.px:link {color: #ffff40; text-decoration: none;}a.px:visited {color: #ffff40;
|
||||||
table.tbl { border-collapse: collapse; border-style: none;}
|
table.tbl { border-collapse: collapse; border-style: none;}
|
||||||
table.tbl td { text-align: right; border-width: 1px 1px 1px 1px; border-style: solid solid solid solid; padding: 2px 3px; border-color: gray; white-space: nowrap;}
|
table.tbl td { text-align: right; border-width: 1px 1px 1px 1px; border-style: solid solid solid solid; padding: 2px 3px; border-color: gray; white-space: nowrap;}
|
||||||
table.tbl td.ac { text-align: center;}
|
table.tbl td.ac { text-align: center;}
|
||||||
table.tbl th { border-width: 1px; border-style: solid solid solid solid; border-color: gray; padding-left: 10px;}
|
table.tbl th { border-width: 1px; border-style: solid solid solid solid; border-color: gray; padding-left: 10px; font-size: 12px;}
|
||||||
table.tbl th.pxname { background: #b00040; color: #ffff40; font-weight: bold; border-style: solid solid none solid; padding: 2px 3px; white-space: nowrap;}
|
table.tbl th.pxname { background: #b00040; color: #ffff40; font-weight: bold; border-style: solid solid none solid; padding: 2px 3px; white-space: nowrap; font-size: 1em;}
|
||||||
table.tbl th.empty { border-style: none; empty-cells: hide; background: white;}
|
table.tbl th.empty { border-style: none; empty-cells: hide; background: white;}
|
||||||
table.tbl th.desc { background: white; border-style: solid solid none solid; text-align: left; padding: 2px 3px;}
|
table.tbl th.desc { background: white; border-style: solid solid none solid; text-align: left; padding: 2px 3px;}
|
||||||
|
|
||||||
|
@ -59,17 +59,14 @@ div.tips {
|
||||||
}
|
}
|
||||||
u:hover div.tips {visibility:visible;}
|
u:hover div.tips {visibility:visible;}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
{% for l in out %}
|
{% for l in out %}
|
||||||
<table class="tbl" width="100%">
|
<table class="tbl" width="100%">
|
||||||
<tr class="titre">
|
<tr class="titre">
|
||||||
<th class="pxname" style="background-color: rgb(93, 156, 235); width: 100%; padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
<th class="pxname" style="background-color: rgb(93, 156, 235); width: 100%; padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
||||||
<a name="status">
|
<a name="status">
|
||||||
<a class="px" href="#stats" style="color: rgb(255, 255, 255);">NGINX status</a>
|
<a class="px" href="#stats" style="color: rgb(255, 255, 255);">NGINX status</a>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<table class="tbl" width="100%">
|
<table class="tbl" width="100%">
|
||||||
<tr class="titre">
|
<tr class="titre">
|
||||||
|
@ -77,13 +74,13 @@ u:hover div.tips {visibility:visible;}
|
||||||
{{l.0.0}} {{l.0.1}}
|
{{l.0.0}} {{l.0.1}}
|
||||||
</th>
|
</th>
|
||||||
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
||||||
{{l.0.4}}
|
{{l.0.4|title}}
|
||||||
</th>
|
</th>
|
||||||
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
||||||
{{l.0.5}}
|
{{l.0.5|title}}
|
||||||
</th>
|
</th>
|
||||||
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
||||||
{{l.0.6}}
|
{{l.0.6|title}}
|
||||||
</th>
|
</th>
|
||||||
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
<th style="background-color: rgb(245, 250, 244); padding-top: 4px; padding-bottom: 4px; border-color: rgb(221, 221, 221);">
|
||||||
{{l.0.10}}
|
{{l.0.10}}
|
||||||
|
@ -117,7 +114,6 @@ u:hover div.tips {visibility:visible;}
|
||||||
<td style="font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; font-size: 11px; border-color: rgb(221, 221, 221); padding: 3px;">
|
<td style="font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; font-size: 11px; border-color: rgb(221, 221, 221); padding: 3px;">
|
||||||
{{l.0.15}}
|
{{l.0.15}}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
|
<div class="add-note addName alert-info" style="width: inherit; margin-right: 15px;">
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for user in users %}
|
{% 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 %}">
|
<tr id="user-{{user.user_id}}" class="{{ loop.cycle('odd', 'even') }} {% if adding %}newuser{% endif %}">
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
{% set login_id = 'login-' + user.user_id|string() %}
|
{% set login_id = 'login-' + user.user_id|string() %}
|
||||||
|
@ -38,9 +41,9 @@
|
||||||
<td class="checkbox">
|
<td class="checkbox">
|
||||||
{% set activeuser_id = 'activeuser-' + user.user_id|string() %}
|
{% set activeuser_id = 'activeuser-' + user.user_id|string() %}
|
||||||
{% if user.activeuser == 1 %}
|
{% if user.activeuser == 1 %}
|
||||||
{{ checkbox(activeuser_id, checked='checked') }}
|
{{ checkbox(activeuser_id, checked='checked', disabled=disable_superAdmin) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ checkbox(activeuser_id) }}
|
{{ checkbox(activeuser_id, disable_superAdmin) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -52,7 +55,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select id="role-{{user.user_id}}" name="role-{{user.user_id}}">
|
<select id="role-{{user.user_id}}" name="role-{{user.user_id}}" {{disable_superAdmin}}>
|
||||||
<option disabled selected>Select a role</option>
|
<option disabled selected>Select a role</option>
|
||||||
{% for r in roles %}
|
{% for r in roles %}
|
||||||
{% if page == "servers.py" %}
|
{% if page == "servers.py" %}
|
||||||
|
|
|
@ -2139,6 +2139,10 @@ function openChangeUserServiceDialog(id) {
|
||||||
changeUserServiceDialog(id);
|
changeUserServiceDialog(id);
|
||||||
}
|
}
|
||||||
function changeUserPasswordDialog(id) {
|
function changeUserPasswordDialog(id) {
|
||||||
|
if ($('#role-'+id + ' option:selected' ).val() == 'Select a role') {
|
||||||
|
toastr.warning('You cannot edit password for superAdmin role.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$( "#user-change-password-table" ).dialog({
|
$( "#user-change-password-table" ).dialog({
|
||||||
autoOpen: true,
|
autoOpen: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
|
@ -2232,6 +2236,10 @@ function changeUserGroupDialog(id) {
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
function changeUserServiceDialog(id) {
|
function changeUserServiceDialog(id) {
|
||||||
|
if ($('#role-'+id + ' option:selected' ).val() == 'Select a role') {
|
||||||
|
toastr.warning('You cannot edit services for superAdmin role.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
url: "options.py",
|
url: "options.py",
|
||||||
data: {
|
data: {
|
||||||
|
|
Loading…
Reference in New Issue