mirror of https://github.com/Aidaho12/haproxy-wi
parent
e89b8b04d4
commit
eabc02e234
|
@ -31,10 +31,11 @@ output_from_parsed_template = template.render(title = "Servers: ",
|
||||||
masters = sql.select_servers(get_master_servers=1, uuid=user_id.value),
|
masters = sql.select_servers(get_master_servers=1, uuid=user_id.value),
|
||||||
group = user_group,
|
group = user_group,
|
||||||
sshs = sql.select_ssh(),
|
sshs = sql.select_ssh(),
|
||||||
telegrams = sql.get_user_telegram_by_uuid(user_id.value),
|
telegrams = sql.get_user_telegram_by_group(user_group),
|
||||||
token = token,
|
token = token,
|
||||||
versions = funct.versions(),
|
versions = funct.versions(),
|
||||||
backups = sql.select_backups(),
|
backups = sql.select_backups(),
|
||||||
grafana = ''.join(grafana),
|
grafana = ''.join(grafana),
|
||||||
|
page = "servers.py",
|
||||||
ldap_enable = ldap_enable)
|
ldap_enable = ldap_enable)
|
||||||
print(output_from_parsed_template)
|
print(output_from_parsed_template)
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<th class="padding10 first-collumn">Login name</th>
|
<th class="padding10 first-collumn">Login name</th>
|
||||||
<th>Password</th>
|
<th style="width: 10%">Password</th>
|
||||||
<th>Active</th>
|
<th style="width: 10%">Active</th>
|
||||||
<th>Email</th>
|
<th style="width: 20%">Email</th>
|
||||||
<th>Role</th>
|
<th style="width: 10%">Role</th>
|
||||||
<th>Group</th>
|
<th style="width: 100%">Group</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<th class="padding10 first-collumn">Name</th>
|
<th class="padding10 first-collumn">Name</th>
|
||||||
<th>Description</th>
|
<th style="width: 100%;">Description</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -107,24 +107,6 @@
|
||||||
</table>
|
</table>
|
||||||
<br /><span class="add-button" title="Add group" id="add-group-button">+ Add</span>
|
<br /><span class="add-button" title="Add group" id="add-group-button">+ Add</span>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table class="overview" id="group-add-table" style="display: none;">
|
|
||||||
<tr class="overviewHead">
|
|
||||||
<td class="padding10 first-collumn">New group name</td>
|
|
||||||
<td>Description</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding10 first-collumn">
|
|
||||||
{{ input('new-group-add', autofocus='autofocus') }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ input('new-desc', size="60") }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="add-admin" id="add-group" title="Add new group" style="cursor: pointer;"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</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;">
|
||||||
How to setup groups you can watch in this video <a href="https://haproxy-wi.org/description.py?description=setup" title="How to setup servers, group and SSH credentials" target="_blank">here</a>
|
How to setup groups you can watch in this video <a href="https://haproxy-wi.org/description.py?description=setup" title="How to setup servers, group and SSH credentials" target="_blank">here</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -134,16 +116,20 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<th class="padding10 first-collumn">Hostname</th>
|
<th class="padding10 first-collumn">Hostname</th>
|
||||||
<th class="ip-field">IP</th>
|
<th class="ip-field" style="width: 5%">IP</th>
|
||||||
<th class="checkbox-head"><span title="SSH port">Port</span></th>
|
<th class="checkbox-head" style="width: 5%"><span title="SSH port">Port</span></th>
|
||||||
<th class="group-field">Group</th>
|
<th class="group-field" style="width: 10%">Group</th>
|
||||||
<th class="checkbox-head">Enabled</th>
|
<th class="checkbox-head" style="width: 5%">Enabled</th>
|
||||||
<th class="checkbox-head"><span title="Vitrual IP, something like VRRP">Virt</span></th>
|
<th class="checkbox-head" style="width: 5%">
|
||||||
<th class="checkbox-head">HAProxy</th>
|
<span title="Virtual IP, something like VRRP">Virt</span>
|
||||||
<th class="checkbox-head">Nginx</th>
|
</th>
|
||||||
<th class="slave-field"><span title="Actions with master config will automatically apply on slave">Slave for</span></th>
|
<th class="checkbox-head" style="width: 5%">HAProxy</th>
|
||||||
<th class="cred-field">Credentials</th>
|
<th class="checkbox-head" style="width: 5%">Nginx</th>
|
||||||
<th>Description</th>
|
<th class="slave-field" style="width: 10%">
|
||||||
|
<span title="Actions with the master config will automatically apply on the slave">Slave for</span>
|
||||||
|
</th>
|
||||||
|
<th class="cred-field" style="width: 15%">Credentials</th>
|
||||||
|
<th style="width: 100%">Description</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -197,8 +183,8 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<span title="If it is enabled, the key will be used, if turned off - the password. Do not forget to download the keys to all servers or install the sudo without a password">SSH key</span>
|
<span title="If it is enabled, the key will be used, if turned off - the password. Do not forget to download the keys to all servers or install the sudo without a password">SSH key</span>
|
||||||
</td>
|
</td>
|
||||||
<td>Group</td>
|
<td style="width: 25%;">Group</td>
|
||||||
<td>
|
<td style="width: 100%;">
|
||||||
<span title="Enter SSH user name. If SSH key disabled, enter password for SSH user">Credentials</span>
|
<span title="Enter SSH user name. If SSH key disabled, enter password for SSH user">Credentials</span>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
@ -230,12 +216,12 @@
|
||||||
<td style="padding-top: 15px;">
|
<td style="padding-top: 15px;">
|
||||||
<p>
|
<p>
|
||||||
{% set id = 'ssh_user-' + ssh.0|string() %}
|
{% set id = 'ssh_user-' + ssh.0|string() %}
|
||||||
{{ input(id, value=ssh.3, size='10') }}
|
{{ input(id, value=ssh.3, title='SSH user name') }}
|
||||||
</p>
|
</p>
|
||||||
{% if ssh.2 == 1 %}
|
{% if ssh.2 == 1 %}
|
||||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="{{ssh.4}}" style="display: none;" autocomplete="new-password">
|
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" placeholder="*****" style="display: none;" autocomplete="new-password">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="{{ssh.4}}" autocomplete="new-password">
|
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" placeholder="*****" autocomplete="new-password">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br>
|
<br>
|
||||||
</td>
|
</td>
|
||||||
|
@ -247,40 +233,6 @@
|
||||||
</table>
|
</table>
|
||||||
<br /><span class="add-button" title="Add ssh" id="add-ssh-button">+ Add</span>
|
<br /><span class="add-button" title="Add ssh" id="add-ssh-button">+ Add</span>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table class="overview" id="ssh-add-table" style="display: none;">
|
|
||||||
<tr class="overviewHead">
|
|
||||||
<td class="padding10 first-collumn" style="width: 15%;">Name</td>
|
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">SSH key</td>
|
|
||||||
<td>Group</td>
|
|
||||||
<td>Credentials</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding10 first-collumn">
|
|
||||||
{{ input('new-ssh-add', size='10', autofocus='autofocus') }}
|
|
||||||
</td>
|
|
||||||
<td class="first-collumn" valign="top" style="padding-top: 15px;">
|
|
||||||
<label for="new-ssh_enable">Enable SSH key</label><input type="checkbox" id="new-ssh_enable" checked>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="new-sshgroup" name="new-sshgroup">
|
|
||||||
{% for group in groups %}
|
|
||||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td style="padding-top: 15px;">
|
|
||||||
<p style="width: 100px;">
|
|
||||||
{{ input('ssh_user', value=ssh_user) }}
|
|
||||||
</p>
|
|
||||||
{{ input('ssh_pass', type='password', value=ssh_pass, style="display: none;") }}
|
|
||||||
<br>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="add-admin" id="add-ssh" title="Add new SSH credentials" style="cursor: pointer;"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<table id="ssh_key">
|
<table id="ssh_key">
|
||||||
<tr class="overviewHead" style="width: 50%;">
|
<tr class="overviewHead" style="width: 50%;">
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">Upload SSH Key</td>
|
<td class="padding10 first-collumn" style="width: 25%;">Upload SSH Key</td>
|
||||||
|
@ -318,8 +270,8 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<span title="Token that gave you @father_bot">Token</span>
|
<span title="Token that gave you @father_bot">Token</span>
|
||||||
</td>
|
</td>
|
||||||
<td>Channel name</td>
|
<td style="width: 25%;">Channel name</td>
|
||||||
<td>Group</td>
|
<td style="width: 100%;">Group</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -327,7 +279,7 @@
|
||||||
<tr id="telegram-table-{{telegram.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
<tr id="telegram-table-{{telegram.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
{% set id = 'telegram-token-' + telegram.0|string() %}
|
{% set id = 'telegram-token-' + telegram.0|string() %}
|
||||||
{{ input(id, value=telegram.1) }}
|
{{ input(id, value=telegram.1, size='30') }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% set id = 'telegram-chanel-' + telegram.0|string() %}
|
{% set id = 'telegram-chanel-' + telegram.0|string() %}
|
||||||
|
@ -356,37 +308,6 @@
|
||||||
</table>
|
</table>
|
||||||
<br /><span class="add-button" title="Add telegram channel" id="add-telegram-button">+ Add</span>
|
<br /><span class="add-button" title="Add telegram channel" id="add-telegram-button">+ Add</span>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table class="overview" id="telegram-add-table" style="display: none;">
|
|
||||||
<tr class="overviewHead">
|
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
|
||||||
<span title="Token that gave you @father_bot">Token</span>
|
|
||||||
</td>
|
|
||||||
<td>Chanel name</td>
|
|
||||||
<td>Group</td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding10 first-collumn">
|
|
||||||
{{ input('telegram-token-add') }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ input('telegram-chanel-add') }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="new-telegram-group-add" name="new-telegram-group-add">
|
|
||||||
<option disabled selected value="0">Choose group</option>
|
|
||||||
{% for group in groups %}
|
|
||||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td></td>
|
|
||||||
<td>
|
|
||||||
<span class="add-admin" id="add-telegram" title="Add new Telegram channel" style="cursor: pointer;"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div id="ajax-telegram"></div>
|
<div id="ajax-telegram"></div>
|
||||||
<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;">
|
||||||
You can read the description of all parameters <a href="https://haproxy-wi.org/description.py?description=checker" title="Servers description" target="_blank">here</a>
|
You can read the description of all parameters <a href="https://haproxy-wi.org/description.py?description=checker" title="Servers description" target="_blank">here</a>
|
||||||
|
@ -419,9 +340,9 @@
|
||||||
<td class="addOption">
|
<td class="addOption">
|
||||||
{% if set.0 == 'ldap_password' %}
|
{% if set.0 == 'ldap_password' %}
|
||||||
{% if set.1 == 'None' %}
|
{% if set.1 == 'None' %}
|
||||||
<input type="password" name="{{set.0}}" id="{{set.0}}" value="" title="" size="25" class="form-control">
|
<input type="password" name="{{set.0}}" id="{{set.0}}" value="" title="" size="25" class="form-control" autocomplete="new-password">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="password" name="{{set.0}}" id="{{set.0}}" value="{{set.1}}" title="" size="25" class="form-control">
|
<input type="password" name="{{set.0}}" id="{{set.0}}" value="" placeholder="*****" title="" size="25" class="form-control" autocomplete="new-password">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if set.1 == 'None' %}
|
{% if set.1 == 'None' %}
|
||||||
|
@ -547,116 +468,19 @@
|
||||||
You can read the description of all parameters <a href="https://haproxy-wi.org/description.py?description=backup" title="Backup description" target="_blank">here</a>
|
You can read the description of all parameters <a href="https://haproxy-wi.org/description.py?description=backup" title="Backup description" target="_blank">here</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
<div id="user-add-table" style="display: none;">
|
|
||||||
<table class="overview">
|
|
||||||
{% include 'include/admin_add_user.html' %}
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Role
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="new-role" name="new-role">
|
|
||||||
<option disabled selected>Choose role</option>
|
|
||||||
{% for role in roles %}
|
|
||||||
<option value="{{ role.1 }}">{{ role.1 }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Group
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="new-group" name="new-group">
|
|
||||||
<option disabled selected>Choose group</option>
|
|
||||||
{% for group in groups %}
|
|
||||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div id="server-add-table" title="Add a new server " style="display: none;">
|
|
||||||
<table class="overview">
|
|
||||||
{% include 'include/admin_add_server.html' %}
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Credentials
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="credentials" required>
|
|
||||||
<option disabled selected>Choose credentials</option>
|
|
||||||
{% for ssh in sshs %}
|
|
||||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Group
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="new-server-group-add" name="new-server-group-add">
|
|
||||||
<option disabled selected value="0">Choose group</option>
|
|
||||||
{% for group in groups %}
|
|
||||||
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div id="backup-add-table" title="Add a new backup job " style="display: none;">
|
|
||||||
<table class="overview">
|
|
||||||
{% include 'include/add_backup.html' %}
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Credentials for remote server
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="backup-credentials" required>
|
|
||||||
<option disabled selected>Choose credentials</option>
|
|
||||||
{% for ssh in sshs %}
|
|
||||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Description
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ input('backup-description', size='30') }}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
{% include 'include/admins_dialogs.html' %}
|
||||||
{% include 'include/change_pass_form.html' %}
|
{% include 'include/change_pass_form.html' %}
|
||||||
<div id="change-user-groups-dialog" style="display: none;">
|
<div id="change-user-groups-dialog" style="display: none;">
|
||||||
<div id="change-user-groups-form"></div>
|
<div id="change-user-groups-form"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="dialog-confirm-services" style="display: none;">
|
|
||||||
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Are you sure?</p>
|
|
||||||
</div>
|
|
||||||
<style>
|
<style>
|
||||||
.ui-selectmenu-button.ui-button {
|
.ui-selectmenu-button.ui-button {
|
||||||
width: 10em;
|
width: 10em;
|
||||||
}
|
}
|
||||||
.first-collumn {
|
.first-collumn {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$( function() {
|
$( function() {
|
||||||
|
|
|
@ -4,10 +4,14 @@
|
||||||
<input type="text" id="name-{{ group.0 }}" value="{{ group.1 }}" class="form-control">
|
<input type="text" id="name-{{ group.0 }}" value="{{ group.1 }}" class="form-control">
|
||||||
</td>
|
</td>
|
||||||
<td style="width: 100%;">
|
<td style="width: 100%;">
|
||||||
|
{% if group.2 != 'None' %}
|
||||||
<input type="text" id="descript-{{ group.0 }}" value="{{ group.2 }}" class="form-control" size="60">
|
<input type="text" id="descript-{{ group.0 }}" value="{{ group.2 }}" class="form-control" size="60">
|
||||||
|
{% else %}
|
||||||
|
<input type="text" id="descript-{{ group.0 }}" class="form-control" size="60">
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="delete" onclick="removeGroup({{ group.0 }})" style="cursor: pointer;"></a>
|
<a class="delete" onclick="confirmDeleteGroup({{ group.0 }})" style="cursor: pointer;"></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
|
@ -1,5 +1,5 @@
|
||||||
{% for ssh in sshs %}
|
{% for ssh in sshs %}
|
||||||
<tr style="width: 50%;" id="ssh-table-{{ssh.0}}">
|
<tr style="width: 50%;" id="ssh-table-{{ssh.0}}" class="ssh-table-{{ssh.0}}">
|
||||||
<td class="first-collumn">
|
<td class="first-collumn">
|
||||||
<input type="text" id="ssh_name-{{ssh.0}}" class="form-control" value="{{ssh.1}}" style="margin-bottom: 23px;">
|
<input type="text" id="ssh_name-{{ssh.0}}" class="form-control" value="{{ssh.1}}" style="margin-bottom: 23px;">
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% for telegram in telegrams %}
|
{% for telegram in telegrams %}
|
||||||
<tr style="width: 50%;" id="telegram-table-{{telegram.0}}" class="newgroup">
|
<tr style="width: 50%;" id="telegram-table-{{telegram.0}}" class="newgroup">
|
||||||
<td class="first-collumn" style="padding-top: 15px;">
|
<td class="padding10 first-collumn">
|
||||||
<input type="text" id="telegram-token-{{telegram.0}}" class="form-control" value="{{telegram.1}}" style="margin-bottom: 23px;">
|
<input type="text" id="telegram-token-{{telegram.0}}" class="form-control" value="{{telegram.1}}">
|
||||||
<input type="hidden" id="telegramgroup-{{telegram.0}}" name="telegramgroup-{{telegram.0}}">
|
<input type="hidden" id="telegramgroup-{{telegram.0}}" name="telegramgroup-{{telegram.0}}">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -20,6 +20,9 @@
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<td>
|
||||||
|
<a class="add" onclick="cloneTelegram({{telegram.0}})" id="clone-{{telegram.0}}" title="Clone {{telegram.2}}" style="cursor: pointer;"></a>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="delete" onclick="confirmDeleteTelegram({{telegram.0}})" style="cursor: pointer;"></a>
|
<a class="delete" onclick="confirmDeleteTelegram({{telegram.0}})" style="cursor: pointer;"></a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
{% from 'include/input_macros.html' import input, checkbox %}
|
{% from 'include/input_macros.html' import input, checkbox %}
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<p class="validateTips alert alert-success">
|
|
||||||
Form fields tag "<span class="need-field">*</span>" are required.
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding20">
|
<td class="padding20">
|
||||||
New hostname
|
New hostname
|
||||||
|
|
|
@ -1,11 +1,4 @@
|
||||||
{% from 'include/input_macros.html' import input, checkbox %}
|
{% from 'include/input_macros.html' import input, checkbox %}
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<p class="validateTips alert alert-success">
|
|
||||||
Form fields tag "<span class="need-field">*</span>" are required.
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="padding20">
|
<td class="padding20">
|
||||||
New user
|
New user
|
||||||
|
|
|
@ -0,0 +1,222 @@
|
||||||
|
{% if page != "servers.py" %}
|
||||||
|
<div id="user-add-table" style="display: none;">
|
||||||
|
<table class="overview">
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
{% include 'include/admin_add_user.html' %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Role
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="new-role" name="new-role">
|
||||||
|
<option disabled selected>Choose role</option>
|
||||||
|
{% for role in roles %}
|
||||||
|
<option value="{{ role.1 }}">{{ role.1 }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Group
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="new-group" name="new-group">
|
||||||
|
<option disabled selected>Choose group</option>
|
||||||
|
{% for group in groups %}
|
||||||
|
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="group-add-table" style="display: none;">
|
||||||
|
<table class="overview">
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
New group name
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ input('new-group-add', autofocus='autofocus') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<td class="padding20">Description</td>
|
||||||
|
<td>{{ input('new-desc', size="40") }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div id="user-add-table" style="display: none;">
|
||||||
|
<table class="overview">
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
{% include 'include/admin_add_user.html' %}
|
||||||
|
<td class="padding20">
|
||||||
|
Role
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="new-role" name="new-role">
|
||||||
|
<option disabled selected>Choose role</option>
|
||||||
|
{% for role in roles %}
|
||||||
|
{% if role.1 != "admin" %}
|
||||||
|
<option value="{{ role.1 }}">{{ role.1 }}</option>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div id="server-add-table" title="Add a new server " style="display: none;">
|
||||||
|
<table class="overview">
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
{% include 'include/admin_add_server.html' %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Credentials
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="credentials" required>
|
||||||
|
<option disabled selected>Choose credentials</option>
|
||||||
|
{% for ssh in sshs %}
|
||||||
|
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% if page != "servers.py" %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Group
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="new-server-group-add" name="new-server-group-add">
|
||||||
|
<option disabled selected value="0">Choose group</option>
|
||||||
|
{% for group in groups %}
|
||||||
|
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="ssh-add-table" style="display: none;">
|
||||||
|
<table>
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Name
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ input('new-ssh-add', autofocus='autofocus') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">SSH key</td>
|
||||||
|
<td>
|
||||||
|
<label for="new-ssh_enable">Enabled SSH key</label><input type="checkbox" id="new-ssh_enable" checked>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% if page != "servers.py" %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">Group</td>
|
||||||
|
<td>
|
||||||
|
<select id="new-sshgroup" name="new-sshgroup">
|
||||||
|
{% for group in groups %}
|
||||||
|
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Credentials
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p style="width: 100px;">
|
||||||
|
{{ input('ssh_user', value=ssh_user, title='SSH user name') }}
|
||||||
|
</p>
|
||||||
|
{{ input('ssh_pass', type='password', style="display: none;", title='SSH password') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="telegram-add-table" style="display: none;">
|
||||||
|
<table>
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
<span title="Token that gave you @father_bot">Token</span>
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ input('telegram-token-add', size='30') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Channel name
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ input('telegram-chanel-add') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% if page != "servers.py" %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">Group</td>
|
||||||
|
<td>
|
||||||
|
<select id="new-telegram-group-add" name="new-telegram-group-add">
|
||||||
|
<option disabled selected value="0">Choose group</option>
|
||||||
|
{% for group in groups %}
|
||||||
|
<option value="{{ group.0 }}">{{ group.1 }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="backup-add-table" title="Add a new backup job " style="display: none;">
|
||||||
|
<table class="overview">
|
||||||
|
{% include 'include/tr_validate_tips.html' %}
|
||||||
|
{% include 'include/add_backup.html' %}
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Credentials for remote server
|
||||||
|
<span class="need-field">*</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select id="backup-credentials" required>
|
||||||
|
<option disabled selected>Choose credentials</option>
|
||||||
|
{% for ssh in sshs %}
|
||||||
|
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="padding20">
|
||||||
|
Description
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ input('backup-description', size='30') }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="dialog-confirm-services" style="display: none;">
|
||||||
|
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Are you sure?</p>
|
||||||
|
</div>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">
|
||||||
|
<p class="validateTips alert alert-success">
|
||||||
|
Form fields tag "<span class="need-field">*</span>" are required.
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
|
@ -11,6 +11,7 @@
|
||||||
<input type="hidden" id="new-group" name="new-group" value="{{ group }}">
|
<input type="hidden" id="new-group" name="new-group" value="{{ group }}">
|
||||||
<input type="hidden" id="new-server-group-add" name="new-server-group-add" value="{{ group }}" >
|
<input type="hidden" id="new-server-group-add" name="new-server-group-add" value="{{ group }}" >
|
||||||
<input type="hidden" id="new-sshgroup" name="new-sshgroup" value="{{ group }}" >
|
<input type="hidden" id="new-sshgroup" name="new-sshgroup" value="{{ group }}" >
|
||||||
|
{{ input('new-telegram-group-add', type='hidden', value=group) }}
|
||||||
<div id="tabs">
|
<div id="tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#users" title="Servers: Manage users - HAProxy-WI">Users</a></li>
|
<li><a href="#users" title="Servers: Manage users - HAProxy-WI">Users</a></li>
|
||||||
|
@ -27,10 +28,10 @@
|
||||||
<table class="overview" id="ajax-users">
|
<table class="overview" id="ajax-users">
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<td class="padding10 first-collumn">Login name</td>
|
<td class="padding10 first-collumn">Login name</td>
|
||||||
<td>Password</td>
|
<td style="width: 10%">Password</td>
|
||||||
<td>Active</td>
|
<td style="width: 10%">Active</td>
|
||||||
<td>Email</td>
|
<td style="width: 20%">Email</td>
|
||||||
<td>Role</td>
|
<td style="width: 100%">Role</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -68,24 +69,30 @@
|
||||||
<div id="servers">
|
<div id="servers">
|
||||||
<table class="overview" id="ajax-servers">
|
<table class="overview" id="ajax-servers">
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<td class="padding10 first-collumn">Hostname</td>
|
<th class="padding10 first-collumn" style="width: 15%">Hostname</th>
|
||||||
<td class="ip-field">IP</td>
|
<th class="ip-field" style="width: 10%">IP</th>
|
||||||
<td class="checkbox-head"><span title="SSH port">Port</span></td></td>
|
<th class="checkbox-head" style="width: 5%">
|
||||||
<td class="checkbox-head">Enable</td>
|
<span title="SSH port">Port</span>
|
||||||
<td class="checkbox-head"><span title="Vitrual IP, something like VRRP">Virt</span></td>
|
</th>
|
||||||
<th class="checkbox-head">HAProxy</th>
|
<th class="checkbox-head" style="width: 5%">Enable</th>
|
||||||
<th class="checkbox-head">Nginx</th>
|
<th class="checkbox-head" style="width: 5%">
|
||||||
<td class="slave-field"><span title="Actions with master config will automatically apply on slave">Slave for</span></td>
|
<span title="Virtual IP, something like VRRP">Virt</span>
|
||||||
<td class="cred-field">Credentials</td>
|
</th>
|
||||||
<td>Description</td>
|
<th class="checkbox-head" style="width: 5%">HAProxy</th>
|
||||||
<td></td>
|
<th class="checkbox-head" style="width: 5%">Nginx</th>
|
||||||
<td></td>
|
<th class="slave-field" style="width: 10%">
|
||||||
|
<span title="Actions with master config will automatically apply on slave">Slave for</span>
|
||||||
|
</th>
|
||||||
|
<th class="cred-field" style="width: 15%">Credentials</th>
|
||||||
|
<th style="width: 100%">Description</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
{% set ssh_group = [] %}
|
{% set ssh_group = [] %}
|
||||||
{% for server in servers %}
|
{% for server in servers %}
|
||||||
{% do ssh_group.append(server.3) %}
|
{% do ssh_group.append(server.3) %}
|
||||||
<tr id="server-{{server.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
<tr id="server-{{server.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn" style="width: 15%">
|
||||||
{% set id = 'hostname-' + server.0|string() %}
|
{% set id = 'hostname-' + server.0|string() %}
|
||||||
{{ input(id, value=server.1, size='10') }}
|
{{ input(id, value=server.1, size='10') }}
|
||||||
</td>
|
</td>
|
||||||
|
@ -119,7 +126,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<span title="If enabled, the key will be used, if turned off - the password. Do not forget to download the keys to all servers or install the sudo without a password">SSH key</span>
|
<span title="If enabled, the key will be used, if turned off - the password. Do not forget to download the keys to all servers or install the sudo without a password">SSH key</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td style="width: 100%;">
|
||||||
<span title="Enter SSH user name. If SSH key disabled, enter password for ssh user">Credentials</span>
|
<span title="Enter SSH user name. If SSH key disabled, enter password for ssh user">Credentials</span>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
@ -141,12 +148,12 @@
|
||||||
<td style="padding-top: 15px;">
|
<td style="padding-top: 15px;">
|
||||||
<p>
|
<p>
|
||||||
{% set id = 'ssh_user-' + ssh.0|string() %}
|
{% set id = 'ssh_user-' + ssh.0|string() %}
|
||||||
{{ input(id, value=ssh.3) }}
|
{{ input(id, value=ssh.3, title='SSH user name') }}
|
||||||
</p>
|
</p>
|
||||||
{% if ssh.2 == 1 %}
|
{% if ssh.2 == 1 %}
|
||||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="{{ssh.4}}" style="display: none;" autocomplete="off" />
|
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="" placeholder="*****" style="display: none;" autocomplete="off" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="{{ssh.4}}" autocomplete="off" />
|
<input type="password" id="ssh_pass-{{ssh.0}}" class="form-control" value="" placeholder="*****" autocomplete="off" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<br>
|
<br>
|
||||||
</td>
|
</td>
|
||||||
|
@ -159,32 +166,6 @@
|
||||||
</table>
|
</table>
|
||||||
<br /><span class="add-button" title="Add ssh" id="add-ssh-button">+ Add</span>
|
<br /><span class="add-button" title="Add ssh" id="add-ssh-button">+ Add</span>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table class="overview" id="ssh-add-table" style="display: none;">
|
|
||||||
<tr class="overviewHead">
|
|
||||||
<td class="padding10 first-collumn" style="width: 15%;">Name</td>
|
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">SSH key</td>
|
|
||||||
<td>Credentials</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding10 first-collumn">
|
|
||||||
{{ input('new-ssh-add') }}
|
|
||||||
</td>
|
|
||||||
<td class="first-collumn">
|
|
||||||
<label for="new-ssh_enable">Enable SSH key</label><input type="checkbox" id="new-ssh_enable" checked>
|
|
||||||
</td>
|
|
||||||
<td style="padding-top: 15px;">
|
|
||||||
<p>
|
|
||||||
{{ input('ssh_user', value=ssh_user) }}
|
|
||||||
</p>
|
|
||||||
{{ input('ssh_pass', type='password', value=ssh_pass, style="display: none;") }}
|
|
||||||
<br>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span class="add-admin" id="add-ssh" title="Add a new SSH credentials" style="cursor: pointer;"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<table id="ssh_key">
|
<table id="ssh_key">
|
||||||
<tr class="overviewHead" style="width: 50%;">
|
<tr class="overviewHead" style="width: 50%;">
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">Upload SSH Key</td>
|
<td class="padding10 first-collumn" style="width: 25%;">Upload SSH Key</td>
|
||||||
|
@ -224,7 +205,7 @@
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
<td class="padding10 first-collumn" style="width: 25%;">
|
||||||
<span title="Token that gave you @father_bot">Token</span>
|
<span title="Token that gave you @father_bot">Token</span>
|
||||||
</td>
|
</td>
|
||||||
<td>Chanel name</td>
|
<td style="width: 100%;">Chanel name</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -233,7 +214,7 @@
|
||||||
<tr style="width: 50%;" id="telegram-table-{{telegram.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
<tr style="width: 50%;" id="telegram-table-{{telegram.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
{% set id = 'telegram-token-' + telegram.0|string() %}
|
{% set id = 'telegram-token-' + telegram.0|string() %}
|
||||||
{{ input(id, value=telegram.1) }}
|
{{ input(id, value=telegram.1, size='30') }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% set id = 'telegram-chanel-' + telegram.0|string() %}
|
{% set id = 'telegram-chanel-' + telegram.0|string() %}
|
||||||
|
@ -251,33 +232,6 @@
|
||||||
</table>
|
</table>
|
||||||
<br /><span class="add-button" title="Telegram channel" id="add-telegram-button">+ Add</span>
|
<br /><span class="add-button" title="Telegram channel" id="add-telegram-button">+ Add</span>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<table class="overview" id="telegram-add-table" style="display: none;">
|
|
||||||
<tr class="overviewHead">
|
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">
|
|
||||||
<span title="Token that gave you @father_bot">Token</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
Channel name
|
|
||||||
</td>
|
|
||||||
<td></td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding10 first-collumn">
|
|
||||||
{{ input('telegram-token-add') }}
|
|
||||||
{% for group in ssh_group %}
|
|
||||||
{{ input('new-telegram-group-add', value=group.0) }}
|
|
||||||
{% endfor %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ input('telegram-chanel-add') }}
|
|
||||||
</td>
|
|
||||||
<td></td>
|
|
||||||
<td>
|
|
||||||
<span class="add-admin" id="add-telegram" title="Add new Telegram channel" style="cursor: pointer;"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div id="ajax-telegram"></div>
|
<div id="ajax-telegram"></div>
|
||||||
<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;">
|
||||||
You can read the description of all parameters <a href="https://haproxy-wi.org/description.py?description=checker" title="Servers description" target="_blank">here</a>
|
You can read the description of all parameters <a href="https://haproxy-wi.org/description.py?description=checker" title="Servers description" target="_blank">here</a>
|
||||||
|
@ -375,9 +329,7 @@
|
||||||
<td class="padding10 first-collumn">
|
<td class="padding10 first-collumn">
|
||||||
Before Install any Exporters install Grafana and Prometheus servers first
|
Before Install any Exporters install Grafana and Prometheus servers first
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td></td>
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
{% if grafana != "Active:" %}
|
{% if grafana != "Active:" %}
|
||||||
<span class="ui-button ui-widget ui-corner-all" id="grafna_install" title="Install Grafana and Prometheus server">Install</span>
|
<span class="ui-button ui-widget ui-corner-all" id="grafna_install" title="Install Grafana and Prometheus server">Install</span>
|
||||||
|
@ -483,79 +435,7 @@
|
||||||
<b>Do not edit this section if your group is "ALL"!</b> Add first<a href="users.py#groups" title="Admin Area: Groups">group</a> or edit your own group at<a href="users.py#users" title="Admin Area: Users">users</a> page
|
<b>Do not edit this section if your group is "ALL"!</b> Add first<a href="users.py#groups" title="Admin Area: Groups">group</a> or edit your own group at<a href="users.py#users" title="Admin Area: Users">users</a> page
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="user-add-table" style="display: none;">
|
{% include 'include/admins_dialogs.html' %}
|
||||||
<table class="overview">
|
|
||||||
{% include 'include/admin_add_user.html' %}
|
|
||||||
<td class="padding20">
|
|
||||||
Role
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="new-role" name="new-role">
|
|
||||||
<option disabled selected>Choose role</option>
|
|
||||||
{% for role in roles %}
|
|
||||||
{% if role.1 != "admin" %}
|
|
||||||
<option value="{{ role.1 }}">{{ role.1 }}</option>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div id="server-add-table" style="display: none;">
|
|
||||||
<form id="server-add-form" method="post">
|
|
||||||
<table class="overview">
|
|
||||||
{% include 'include/admin_add_server.html' %}
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Credentials
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="credentials" required>
|
|
||||||
<option disabled selected value="0">Choose credentials</option>
|
|
||||||
{% for ssh in sshs %}
|
|
||||||
{% if ssh.5|string() == group %}
|
|
||||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<input type="submit" tabindex="-1" style="position:absolute; top:-1000px">
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div id="backup-add-table" title="Add a new backup job " style="display: none;">
|
|
||||||
<table class="overview">
|
|
||||||
{% include 'include/add_backup.html' %}
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Credentials for remote server
|
|
||||||
<span class="need-field">*</span>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select id="backup-credentials" required>
|
|
||||||
<option disabled selected>Choose credentials</option>
|
|
||||||
{% for ssh in sshs %}
|
|
||||||
{% if ssh.2 == 1 and ssh.5|string() == group %}
|
|
||||||
<option value="{{ssh.0}}">{{ssh.1}}</option>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="padding20">
|
|
||||||
Description
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{ input('backup-description', size='30') }}
|
|
||||||
</td>
|
|
||||||
<tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
{% include 'include/change_pass_form.html' %}
|
{% include 'include/change_pass_form.html' %}
|
||||||
<script>
|
<script>
|
||||||
if($('#new-server-group-add').val() == 1) {
|
if($('#new-server-group-add').val() == 1) {
|
||||||
|
|
|
@ -47,5 +47,6 @@ template = template.render(title = "Admin area: Manage users",
|
||||||
settings = settings,
|
settings = settings,
|
||||||
backups = sql.select_backups(),
|
backups = sql.select_backups(),
|
||||||
services = services,
|
services = services,
|
||||||
|
page = "users.py",
|
||||||
ldap_enable = ldap_enable)
|
ldap_enable = ldap_enable)
|
||||||
print(template)
|
print(template)
|
||||||
|
|
|
@ -440,6 +440,13 @@ pre {
|
||||||
margin-right: 1px;
|
margin-right: 1px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.add-button:hover, .add-button-wi:hover {
|
||||||
|
background-color: #5bbf5b;
|
||||||
|
}
|
||||||
|
.add-button:active, .add-button-wi:active {
|
||||||
|
background-color: #3e863e;
|
||||||
|
box-shadow: 0 1px #666;
|
||||||
|
}
|
||||||
.add-button-wi {
|
.add-button-wi {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
|
|
552
inc/users.js
552
inc/users.js
|
@ -452,235 +452,203 @@ $( function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
});
|
});
|
||||||
$('#add-group').click(function() {
|
$('#add-group-button').click(function() {
|
||||||
toastr.clear();
|
addGroupDialog.dialog('open');
|
||||||
$.ajax( {
|
});
|
||||||
url: "options.py",
|
var addGroupDialog = $( "#group-add-table" ).dialog({
|
||||||
data: {
|
autoOpen: false,
|
||||||
newgroup: "1",
|
resizable: false,
|
||||||
groupname: $('#new-group-add').val(),
|
height: "auto",
|
||||||
newdesc: $('#new-desc').val(),
|
width: 600,
|
||||||
token: $('#token').val()
|
modal: true,
|
||||||
|
title: "Add a new group",
|
||||||
|
show: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
"Add": function() {
|
||||||
|
addGroup(this);
|
||||||
},
|
},
|
||||||
type: "POST",
|
Cancel: function() {
|
||||||
success: function( data ) {
|
$( this ).dialog( "close" );
|
||||||
if (data.indexOf('error:') != '-1') {
|
clearTips();
|
||||||
toastr.error(data);
|
}
|
||||||
} else {
|
|
||||||
toastr.clear();
|
|
||||||
var getId = new RegExp('[0-9]+');
|
|
||||||
var id = data.match(getId);
|
|
||||||
$("#ajax-group").append(data);
|
|
||||||
$( ".newgroup" ).addClass( "update", 1000, callbackGroup );
|
|
||||||
$('select:regex(id, group)').append('<option value='+id+'>'+$('#new-group-add').val()+'</option>').selectmenu("refresh");
|
|
||||||
$.getScript(awesome);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
});
|
|
||||||
$('#add-ssh').click(function() {
|
|
||||||
toastr.clear();
|
|
||||||
var ssh_enable = 0;
|
|
||||||
if ($('#new-ssh_enable').is(':checked')) {
|
|
||||||
ssh_enable = '1';
|
|
||||||
}
|
}
|
||||||
$.ajax( {
|
|
||||||
url: "options.py",
|
|
||||||
data: {
|
|
||||||
new_ssh: $('#new-ssh-add').val(),
|
|
||||||
new_group: $('#new-sshgroup').val(),
|
|
||||||
ssh_user: $('#ssh_user').val(),
|
|
||||||
ssh_pass: $('#ssh_pass').val(),
|
|
||||||
ssh_enable: ssh_enable,
|
|
||||||
page: cur_url[0],
|
|
||||||
token: $('#token').val()
|
|
||||||
},
|
|
||||||
type: "POST",
|
|
||||||
success: function( data ) {
|
|
||||||
if (data.indexOf('error:') != '-1') {
|
|
||||||
toastr.error(data);
|
|
||||||
} else {
|
|
||||||
toastr.clear();
|
|
||||||
var getId = new RegExp('ssh-table-[0-9]+');
|
|
||||||
var id = data.match(getId) + '';
|
|
||||||
id = id.split('-').pop();;
|
|
||||||
$("#ssh_enable_table").append(data);
|
|
||||||
$( ".new_ssh" ).addClass( "update", 1000 );
|
|
||||||
setTimeout(function() {
|
|
||||||
$( ".new_ssh" ).removeClass( "update" );
|
|
||||||
}, 2500 );
|
|
||||||
$('select:regex(id, credentials)').append('<option value='+id+'>'+$('#new-ssh-add').val()+'</option>').selectmenu("refresh");
|
|
||||||
$('select:regex(id, ssh-key-name)').append('<option value='+$('#new-ssh-add').val()+'>'+$('#new-ssh-add').val()+'</option>').selectmenu("refresh");
|
|
||||||
$.getScript(awesome);
|
|
||||||
$( "input[type=submit], button" ).button();
|
|
||||||
$( "input[type=checkbox]" ).checkboxradio();
|
|
||||||
$( "select" ).selectmenu();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
});
|
});
|
||||||
$('#add-telegram').click(function() {
|
|
||||||
toastr.clear();
|
|
||||||
$.ajax( {
|
|
||||||
url: "options.py",
|
|
||||||
data: {
|
|
||||||
newtelegram: $('#telegram-token-add').val(),
|
|
||||||
chanel: $('#telegram-chanel-add').val(),
|
|
||||||
telegramgroup: $('#new-telegram-group-add').val(),
|
|
||||||
page: cur_url[0],
|
|
||||||
token: $('#token').val()
|
|
||||||
},
|
|
||||||
type: "POST",
|
|
||||||
success: function( data ) {
|
|
||||||
if (data.indexOf('error:') != '-1') {
|
|
||||||
toastr.error(data);
|
|
||||||
} else {
|
|
||||||
$("#checker_table").append(data);
|
|
||||||
$( ".newgroup" ).addClass( "update", 1000, callbackGroup );
|
|
||||||
$.getScript(awesome);
|
|
||||||
$( "input[type=submit], button" ).button();
|
|
||||||
$( "input[type=checkbox]" ).checkboxradio();
|
|
||||||
$( "select" ).selectmenu();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
});
|
|
||||||
function callbackGroup() {
|
|
||||||
setTimeout(function() {
|
|
||||||
$( ".newgroup" ).removeClass( "update" );
|
|
||||||
}, 2500 );
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#add-user-button').click(function() {
|
$('#add-user-button').click(function() {
|
||||||
addUserDialog.dialog('open');
|
addUserDialog.dialog('open');
|
||||||
});
|
});
|
||||||
$('#add-group-button').click(function() {
|
var addUserDialog = $( "#user-add-table" ).dialog({
|
||||||
if ($('#group-add-table').css('display', 'none')) {
|
autoOpen: false,
|
||||||
$('#group-add-table').show("blind", "fast");
|
resizable: false,
|
||||||
} else {
|
height: "auto",
|
||||||
$('#group-add-table').hide("blind", "fast");
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
title: "Add a new user",
|
||||||
|
show: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
"Add": function () {
|
||||||
|
addUser(this);
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
clearTips();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var addUserDialog = $( "#user-add-table" ).dialog({
|
|
||||||
autoOpen: false,
|
|
||||||
resizable: false,
|
|
||||||
height: "auto",
|
|
||||||
width: 600,
|
|
||||||
modal: true,
|
|
||||||
title: "Add a new user",
|
|
||||||
show: {
|
|
||||||
effect: "fade",
|
|
||||||
duration: 200
|
|
||||||
},
|
|
||||||
hide: {
|
|
||||||
effect: "fade",
|
|
||||||
duration: 200
|
|
||||||
},
|
|
||||||
buttons: {
|
|
||||||
"Add": function() {
|
|
||||||
addUser();
|
|
||||||
},
|
|
||||||
Cancel: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
clearTips();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var addServerDialog = $( "#server-add-table" ).dialog({
|
|
||||||
autoOpen: false,
|
|
||||||
resizable: false,
|
|
||||||
height: "auto",
|
|
||||||
width: 600,
|
|
||||||
modal: true,
|
|
||||||
title: "Add a new server",
|
|
||||||
show: {
|
|
||||||
effect: "fade",
|
|
||||||
duration: 200
|
|
||||||
},
|
|
||||||
hide: {
|
|
||||||
effect: "fade",
|
|
||||||
duration: 200
|
|
||||||
},
|
|
||||||
buttons: {
|
|
||||||
"Add": function() {
|
|
||||||
addServer();
|
|
||||||
},
|
|
||||||
Cancel: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
clearTips();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#add-server-button').click(function() {
|
$('#add-server-button').click(function() {
|
||||||
addServerDialog.dialog('open');
|
addServerDialog.dialog('open');
|
||||||
|
});
|
||||||
|
var addServerDialog = $( "#server-add-table" ).dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
resizable: false,
|
||||||
|
height: "auto",
|
||||||
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
title: "Add a new server",
|
||||||
|
show: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
"Add": function () {
|
||||||
|
addServer(this);
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
clearTips();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#add-ssh-button').click(function() {
|
$('#add-ssh-button').click(function() {
|
||||||
if ($('#ssh-add-table').css('display', 'none')) {
|
addCredsDialog.dialog('open');
|
||||||
$('#ssh-add-table').show("blind", "fast");
|
});
|
||||||
}
|
var addCredsDialog = $( "#ssh-add-table" ).dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
resizable: false,
|
||||||
|
height: "auto",
|
||||||
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
title: "Add a new SSH credentials",
|
||||||
|
show: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
"Add": function () {
|
||||||
|
addCreds(this);
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
clearTips();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#add-telegram-button').click(function() {
|
$('#add-telegram-button').click(function() {
|
||||||
if ($('#telegram-add-table').css('display', 'none')) {
|
addTelegramDialog.dialog('open');
|
||||||
$('#telegram-add-table').show("blind", "fast");
|
});
|
||||||
}
|
var addTelegramDialog = $( "#telegram-add-table" ).dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
resizable: false,
|
||||||
|
height: "auto",
|
||||||
|
width: 600,
|
||||||
|
modal: true,
|
||||||
|
title: "Create a new Telegram channel",
|
||||||
|
show: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
"Add": function () {
|
||||||
|
addTelegram(this);
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
clearTips();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#add-backup-button').click(function() {
|
||||||
|
addBackupDialog.dialog('open');
|
||||||
});
|
});
|
||||||
var addBackupDialog = $( "#backup-add-table" ).dialog({
|
var addBackupDialog = $( "#backup-add-table" ).dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
height: "auto",
|
height: "auto",
|
||||||
width: 600,
|
width: 600,
|
||||||
modal: true,
|
modal: true,
|
||||||
title: "Create a new backup job",
|
title: "Create a new backup job",
|
||||||
show: {
|
show: {
|
||||||
effect: "fade",
|
effect: "fade",
|
||||||
duration: 200
|
duration: 200
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
effect: "fade",
|
||||||
|
duration: 200
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
"Add": function () {
|
||||||
|
addBackup(this);
|
||||||
},
|
},
|
||||||
hide: {
|
Cancel: function () {
|
||||||
effect: "fade",
|
$(this).dialog("close");
|
||||||
duration: 200
|
clearTips();
|
||||||
},
|
|
||||||
buttons: {
|
|
||||||
"Add": function() {
|
|
||||||
addBackup();
|
|
||||||
},
|
|
||||||
Cancel: function() {
|
|
||||||
$( this ).dialog( "close" );
|
|
||||||
clearTips();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
$('#add-backup-button').click(function() {
|
});
|
||||||
addBackupDialog.dialog('open');
|
$('#add-smon-button').click(function() {
|
||||||
|
addSmonServer.dialog('open');
|
||||||
});
|
});
|
||||||
var addSmonServer = $( "#smon-add-table" ).dialog({
|
var addSmonServer = $( "#smon-add-table" ).dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
height: "auto",
|
height: "auto",
|
||||||
width: 600,
|
width: 600,
|
||||||
modal: true,
|
modal: true,
|
||||||
title: "Create a new server for monitoring",
|
title: "Create a new server for monitoring",
|
||||||
show: {
|
show: {
|
||||||
effect: "fade",
|
effect: "fade",
|
||||||
duration: 200
|
duration: 200
|
||||||
},
|
},
|
||||||
hide: {
|
hide: {
|
||||||
effect: "fade",
|
effect: "fade",
|
||||||
duration: 200
|
duration: 200
|
||||||
},
|
},
|
||||||
buttons: {
|
buttons: {
|
||||||
"Add": function() {
|
"Add": function () {
|
||||||
addNewSmonServer();
|
addNewSmonServer(this);
|
||||||
},
|
},
|
||||||
Cancel: function() {
|
Cancel: function () {
|
||||||
$( this ).dialog( "close" );
|
$(this).dialog("close");
|
||||||
clearTips();
|
clearTips();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#add-smon-button').click(function() {
|
|
||||||
addSmonServer.dialog('open');
|
|
||||||
});
|
|
||||||
$( "#ajax-users input" ).change(function() {
|
$( "#ajax-users input" ).change(function() {
|
||||||
var id = $(this).attr('id').split('-');
|
var id = $(this).attr('id').split('-');
|
||||||
updateUser(id[1])
|
updateUser(id[1])
|
||||||
|
@ -787,9 +755,20 @@ $( function() {
|
||||||
clearTips();
|
clearTips();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} );
|
} );
|
||||||
function addNewSmonServer() {
|
function common_ajax_action_after_success(dialog_id, new_group, ajax_append_id, data) {
|
||||||
|
toastr.clear();
|
||||||
|
$("#"+ajax_append_id).append(data);
|
||||||
|
console.log(new_group);
|
||||||
|
$( "."+new_group ).addClass( "update", 1000);
|
||||||
|
$.getScript(awesome);
|
||||||
|
clearTips();
|
||||||
|
$( dialog_id ).dialog("close" );
|
||||||
|
setTimeout(function() {
|
||||||
|
$( "."+new_group ).removeClass( "update" );
|
||||||
|
}, 2500 );
|
||||||
|
}
|
||||||
|
function addNewSmonServer(dialog_id) {
|
||||||
var valid = true;
|
var valid = true;
|
||||||
allFields = $( [] ).add( $('#new-smon-ip') ).add( $('#new-smon-port') )
|
allFields = $( [] ).add( $('#new-smon-ip') ).add( $('#new-smon-port') )
|
||||||
allFields.removeClass( "ui-state-error" );
|
allFields.removeClass( "ui-state-error" );
|
||||||
|
@ -839,25 +818,17 @@ function addNewSmonServer() {
|
||||||
if (data.indexOf('error:') != '-1' || data.indexOf('unique') != '-1') {
|
if (data.indexOf('error:') != '-1' || data.indexOf('unique') != '-1') {
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else {
|
} else {
|
||||||
toastr.clear();
|
|
||||||
$("#ajax-smon").append(data);
|
|
||||||
$(".newserver").addClass( "update", 1000 );
|
|
||||||
$( "input[type=submit], button" ).button();
|
$( "input[type=submit], button" ).button();
|
||||||
$( "input[type=checkbox]" ).checkboxradio();
|
$( "input[type=checkbox]" ).checkboxradio();
|
||||||
$( "select" ).selectmenu();
|
$( "select" ).selectmenu();
|
||||||
$.getScript(awesome);
|
|
||||||
$.getScript('/inc/unsers.js');
|
$.getScript('/inc/unsers.js');
|
||||||
setTimeout(function() {
|
common_ajax_action_after_success(dialog_id, 'newserver', 'ajax-smon', data);
|
||||||
$( ".newserver" ).removeClass( "update" );
|
|
||||||
}, 2500 );
|
|
||||||
clearTips();
|
|
||||||
$( "#smon-add-table" ).dialog("close" );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function addUser() {
|
function addUser(dialog_id) {
|
||||||
var valid = true;
|
var valid = true;
|
||||||
toastr.clear();
|
toastr.clear();
|
||||||
allFields = $( [] ).add( $('#new-username') ).add( $('#new-password') )
|
allFields = $( [] ).add( $('#new-username') ).add( $('#new-password') )
|
||||||
|
@ -888,19 +859,45 @@ function addUser() {
|
||||||
if (data.indexOf('error:') != '-1') {
|
if (data.indexOf('error:') != '-1') {
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else {
|
} else {
|
||||||
toastr.clear();
|
|
||||||
$("#ajax-users").append(data);
|
|
||||||
var getId = new RegExp('[0-9]+');
|
var getId = new RegExp('[0-9]+');
|
||||||
var id = data.match(getId);
|
var id = data.match(getId);
|
||||||
addUserGroup(id[0]);
|
addUserGroup(id[0]);
|
||||||
|
common_ajax_action_after_success(dialog_id, 'user-'+id, 'ajax-users', data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
clearTips();
|
|
||||||
$( "#user-add-table" ).dialog("close" );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function addServer() {
|
function addGroup(dialog_id) {
|
||||||
|
toastr.clear();
|
||||||
|
var valid = true;
|
||||||
|
allFields = $( [] ).add( $('#new-group-add') );
|
||||||
|
allFields.removeClass( "ui-state-error" );
|
||||||
|
valid = valid && checkLength( $('#new-group-add'), "new group name", 1 );
|
||||||
|
if(valid) {
|
||||||
|
$.ajax( {
|
||||||
|
url: "options.py",
|
||||||
|
data: {
|
||||||
|
newgroup: "1",
|
||||||
|
groupname: $('#new-group-add').val(),
|
||||||
|
newdesc: $('#new-desc').val(),
|
||||||
|
token: $('#token').val()
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
success: function( data ) {
|
||||||
|
if (data.indexOf('error:') != '-1') {
|
||||||
|
toastr.error(data);
|
||||||
|
} else {
|
||||||
|
var getId = new RegExp('[0-9]+');
|
||||||
|
var id = data.match(getId);
|
||||||
|
$('select:regex(id, group)').append('<option value='+id+'>'+$('#new-group-add').val()+'</option>').selectmenu("refresh");
|
||||||
|
common_ajax_action_after_success(dialog_id, 'newgroup', 'ajax-group', data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function addServer(dialog_id) {
|
||||||
toastr.clear()
|
toastr.clear()
|
||||||
var valid = true;
|
var valid = true;
|
||||||
var servername = $('#new-server-add').val();
|
var servername = $('#new-server-add').val();
|
||||||
|
@ -953,25 +950,91 @@ function addServer() {
|
||||||
if (data.indexOf('error:') != '-1') {
|
if (data.indexOf('error:') != '-1') {
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else {
|
} else {
|
||||||
toastr.clear()
|
common_ajax_action_after_success(dialog_id, 'newserver', 'ajax-servers', data);
|
||||||
$("#ajax-servers").append(data);
|
|
||||||
$(".newserver").addClass( "update", 1000 );
|
|
||||||
$( "input[type=submit], button" ).button();
|
$( "input[type=submit], button" ).button();
|
||||||
$( "input[type=checkbox]" ).checkboxradio();
|
$( "input[type=checkbox]" ).checkboxradio();
|
||||||
$( ".controlgroup" ).controlgroup();
|
$( ".controlgroup" ).controlgroup();
|
||||||
$( "select" ).selectmenu();
|
$( "select" ).selectmenu();
|
||||||
$.getScript(awesome);
|
|
||||||
setTimeout(function() {
|
|
||||||
$( ".newserver" ).removeClass( "update" );
|
|
||||||
}, 2500 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
clearTips();
|
|
||||||
$( "#server-add-table" ).dialog("close" );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function addBackup() {
|
function addCreds(dialog_id) {
|
||||||
|
toastr.clear();
|
||||||
|
var ssh_enable = 0;
|
||||||
|
if ($('#new-ssh_enable').is(':checked')) {
|
||||||
|
ssh_enable = '1';
|
||||||
|
}
|
||||||
|
var valid = true;
|
||||||
|
allFields = $( [] ).add( $('#new-ssh-add') ).add( $('#ssh_user') )
|
||||||
|
allFields.removeClass( "ui-state-error" );
|
||||||
|
valid = valid && checkLength( $('#new-ssh-add'), "Name", 1 );
|
||||||
|
valid = valid && checkLength( $('#ssh_user'), "Credentials", 1 );
|
||||||
|
if(valid) {
|
||||||
|
$.ajax({
|
||||||
|
url: "options.py",
|
||||||
|
data: {
|
||||||
|
new_ssh: $('#new-ssh-add').val(),
|
||||||
|
new_group: $('#new-sshgroup').val(),
|
||||||
|
ssh_user: $('#ssh_user').val(),
|
||||||
|
ssh_pass: $('#ssh_pass').val(),
|
||||||
|
ssh_enable: ssh_enable,
|
||||||
|
page: cur_url[0],
|
||||||
|
token: $('#token').val()
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.indexOf('error:') != '-1') {
|
||||||
|
toastr.error(data);
|
||||||
|
} else {
|
||||||
|
var getId = new RegExp('ssh-table-[0-9]+');
|
||||||
|
var id = data.match(getId) + '';
|
||||||
|
id = id.split('-').pop();
|
||||||
|
common_ajax_action_after_success(dialog_id, 'ssh-table-'+id, 'ssh_enable_table', data);
|
||||||
|
$('select:regex(id, credentials)').append('<option value=' + id + '>' + $('#new-ssh-add').val() + '</option>').selectmenu("refresh");
|
||||||
|
$('select:regex(id, ssh-key-name)').append('<option value=' + $('#new-ssh-add').val() + '>' + $('#new-ssh-add').val() + '</option>').selectmenu("refresh");
|
||||||
|
$("input[type=submit], button").button();
|
||||||
|
$("input[type=checkbox]").checkboxradio();
|
||||||
|
$("select").selectmenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function addTelegram(dialog_id) {
|
||||||
|
var valid = true;
|
||||||
|
toastr.clear();
|
||||||
|
allFields = $( [] ).add( $('#telegram-token-add') ).add( $('#telegram-chanel-add') )
|
||||||
|
allFields.removeClass( "ui-state-error" );
|
||||||
|
valid = valid && checkLength( $('#telegram-token-add'), "token", 1 );
|
||||||
|
valid = valid && checkLength( $('#telegram-chanel-add'), "channel name", 1 );
|
||||||
|
if(valid) {
|
||||||
|
toastr.clear();
|
||||||
|
$.ajax( {
|
||||||
|
url: "options.py",
|
||||||
|
data: {
|
||||||
|
newtelegram: $('#telegram-token-add').val(),
|
||||||
|
chanel: $('#telegram-chanel-add').val(),
|
||||||
|
telegramgroup: $('#new-telegram-group-add').val(),
|
||||||
|
page: cur_url[0],
|
||||||
|
token: $('#token').val()
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
success: function( data ) {
|
||||||
|
if (data.indexOf('error:') != '-1') {
|
||||||
|
toastr.error(data);
|
||||||
|
} else {
|
||||||
|
common_ajax_action_after_success(dialog_id, 'newgroup', 'checker_table', data);
|
||||||
|
$( "input[type=submit], button" ).button();
|
||||||
|
$( "input[type=checkbox]" ).checkboxradio();
|
||||||
|
$( "select" ).selectmenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function addBackup(dialog_id) {
|
||||||
var valid = true;
|
var valid = true;
|
||||||
toastr.clear();
|
toastr.clear();
|
||||||
allFields = $( [] ).add( $('#backup-server') ).add( $('#rserver') ).add( $('#rpath') ).add( $('#backup-time') ).add( $('#backup-credentials') )
|
allFields = $( [] ).add( $('#backup-server') ).add( $('#rserver') ).add( $('#rpath') ).add( $('#backup-time') ).add( $('#backup-credentials') )
|
||||||
|
@ -1001,22 +1064,14 @@ function addBackup() {
|
||||||
if (data.indexOf('error:') != '-1') {
|
if (data.indexOf('error:') != '-1') {
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else if (data.indexOf('success') != '-1') {
|
} else if (data.indexOf('success') != '-1') {
|
||||||
toastr.remove();
|
|
||||||
$("#ajax-backup-table").append(data);
|
|
||||||
$(".newbackup").addClass( "update", 1000 );
|
|
||||||
setTimeout(function() {
|
|
||||||
$( ".newbackup" ).removeClass( "update" );
|
|
||||||
}, 2500 );
|
|
||||||
$( "select" ).selectmenu();
|
$( "select" ).selectmenu();
|
||||||
$.getScript(awesome);
|
common_ajax_action_after_success(dialog_id, 'newbackup', 'ajax-backup-table', data);
|
||||||
} else if (data.indexOf('info') != '-1') {
|
} else if (data.indexOf('info') != '-1') {
|
||||||
toastr.remove();
|
toastr.remove();
|
||||||
toastr.info(data);
|
toastr.info(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
clearTips();
|
|
||||||
$( "#backup-add-table" ).dialog("close" );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function updateSettings(param, val) {
|
function updateSettings(param, val) {
|
||||||
|
@ -1848,11 +1903,6 @@ function addUserGroup(id) {
|
||||||
success: function( data ) {
|
success: function( data ) {
|
||||||
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
|
if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') {
|
||||||
toastr.error(data);
|
toastr.error(data);
|
||||||
} else {
|
|
||||||
$("#user-" + id).addClass("update", 1000);
|
|
||||||
setTimeout(function () {
|
|
||||||
$("#user-" + id).removeClass("update");
|
|
||||||
}, 2500);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in New Issue