mirror of https://github.com/Aidaho12/haproxy-wi
parent
2772cd24f4
commit
48e7c556c2
|
@ -163,15 +163,15 @@
|
|||
<table class="overview" id="ajax-servers">
|
||||
<tr class="overviewHead">
|
||||
<td class="padding10 first-collumn">Hostname</td>
|
||||
<td>IP</td>
|
||||
<td><span title="SSH port">Port(?)</span></td></td>
|
||||
<td>Group</td>
|
||||
<td>Enable</td>
|
||||
<td><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td><span title="Alert if backend change status. Before enable add Telgram chanel at Checker tab">Alert(?)</span></td>
|
||||
<td><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td><span title="Actions with master config will automatically apply on slave">Slave for (?)</span></td>
|
||||
<td>Credentials</td>
|
||||
<td class="ip-field">IP</td>
|
||||
<td class="checkbox-head"><span title="SSH port">Port(?)</span></td></td>
|
||||
<td class="group-field">Group</td>
|
||||
<td class="checkbox-head">Enable</td>
|
||||
<td class="checkbox-head"><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td class="checkbox-head"><span title="Alert if backend change status. Before enable add Telgram chanel at Checker tab">Alert(?)</span></td>
|
||||
<td class="checkbox-head"><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td class="slave-field"><span title="Actions with master config will automatically apply on slave">Slave for (?)</span></td>
|
||||
<td class="cred-field">Credentials</td>
|
||||
<td>Desciption</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<td>
|
||||
<input type="text" id="ip-{{server.0}}" value="{{server.2}}" size="14" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
<input type="text" id="port-{{server.0}}" value="{{server.10}}" size="1" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
|
@ -199,28 +199,28 @@
|
|||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.5 == 1 %}
|
||||
<label for="enable-{{server.0}}"></label><input type="checkbox" id="enable-{{server.0}}" checked>
|
||||
{% else %}
|
||||
<label for="enable-{{server.0}}"></label><input type="checkbox" id="enable-{{server.0}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.4 == 1 %}
|
||||
<label for="typeip-{{server.0}}"></label><input type="checkbox" id="typeip-{{server.0}}" checked>
|
||||
{% else %}
|
||||
<label for="typeip-{{server.0}}"></label><input type="checkbox" id="typeip-{{server.0}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.8 == 1 %}
|
||||
<label for="alert-{{server.0}}"></label><input type="checkbox" id="alert-{{server.0}}" checked>
|
||||
{% else %}
|
||||
<label for="alert-{{server.0}}"></label><input type="checkbox" id="alert-{{server.0}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.9 == 1 %}
|
||||
<label for="metrics-{{server.0}}"></label><input type="checkbox" id="metrics-{{server.0}}" checked>
|
||||
{% else %}
|
||||
|
@ -269,76 +269,6 @@
|
|||
</table>
|
||||
<br /><span class="add-button" title="Add server" id="add-server-button">+ Add</span>
|
||||
<br /><br />
|
||||
<table class="overview" id="server-add-table" style="display: none;">
|
||||
<tr class="overviewHead">
|
||||
<td class="padding10 first-collumn">New hostname</td>
|
||||
<td>IP</td>
|
||||
<td><span title="SSH port">Port(?)</span></td></td>
|
||||
<td>Group</td>
|
||||
<td>Enable</td>
|
||||
<td><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td><span title="Alert if backend change status">Alert(?)</span></td>
|
||||
<td><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td title="Actions with master config will automatically apply on slave">Slave for</td>
|
||||
<td>Credentials</td>
|
||||
<td>Desciption</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" name="new-server-add" id="new-server-add" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="new-ip" id="new-ip" size="14" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="new-port" id="new-port" size=1 class="form-control" value="22">
|
||||
</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>
|
||||
<td>
|
||||
<label for="enable"></label><input type="checkbox" id="enable" checked>
|
||||
</td>
|
||||
<td>
|
||||
<label for="typeip"></label><input type="checkbox" id="typeip">
|
||||
</td>
|
||||
<td>
|
||||
<label for="alert"></label><input type="checkbox" id="alert">
|
||||
</td>
|
||||
<td>
|
||||
<label for="metrics"></label><input type="checkbox" id="metrics">
|
||||
</td>
|
||||
<td>
|
||||
<select id="slavefor">
|
||||
<option value="0" selected>Not slave</option>
|
||||
{% for master in masters %}
|
||||
<option value="{{master.0}}">{{master.1}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</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>
|
||||
<td>
|
||||
<input type="text" id="desc" size="30" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<a class="add-admin" id="add-server" title="Add new server" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div id="roles">
|
||||
<table class="overview" id="ajax-group">
|
||||
|
@ -544,9 +474,95 @@
|
|||
<div id="ajax-telegram"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="server-add-table" title="View certificate " style="display: none;">
|
||||
<table class="overview">
|
||||
<tr>
|
||||
<td class="padding20">New hostname</td>
|
||||
<td>
|
||||
<input type="text" name="new-server-add" id="new-server-add" class="form-control">
|
||||
</td>
|
||||
<tr>
|
||||
<td class="padding20">IP</td>
|
||||
<td>
|
||||
<input type="text" name="new-ip" id="new-ip" size="14" class="form-control">
|
||||
</td>
|
||||
<tr>
|
||||
<td class="padding20"><span title="SSH port">Port(?)</span></td>
|
||||
<td>
|
||||
<input type="text" name="new-port" id="new-port" size=1 class="form-control" value="22">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">Group</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>
|
||||
<tr>
|
||||
<td class="padding20">Enable</td>
|
||||
<td>
|
||||
<label for="enable"></label><input type="checkbox" id="enable" checked>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td>
|
||||
<label for="typeip"></label><input type="checkbox" id="typeip">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="Alert if backend change status">Alert(?)</span></td>
|
||||
<td>
|
||||
<label for="alert"></label><input type="checkbox" id="alert">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td>
|
||||
<label for="metrics"></label><input type="checkbox" id="metrics">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20" title="Actions with master config will automatically apply on slave">Slave for</td>
|
||||
<td>
|
||||
<select id="slavefor">
|
||||
<option value="0" selected>Not slave</option>
|
||||
{% for master in masters %}
|
||||
<option value="{{master.0}}">{{master.1}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">Credentials</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">Desciption</td>
|
||||
<td>
|
||||
<input type="text" id="desc" size="30" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<style>
|
||||
.ui-selectmenu-button.ui-button {
|
||||
width: 12em;
|
||||
width: 10em;
|
||||
}
|
||||
.ui-selectmenu-menu {
|
||||
z-index: 1010;
|
||||
}
|
||||
.first-collumn {
|
||||
width: 10%;
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
</ul>
|
||||
</nav>
|
||||
<div class="copyright-menu">
|
||||
HAproxy-WI v3.2.11
|
||||
HAproxy-WI v3.2.12
|
||||
<br>
|
||||
<a href="https://www.patreon.com/haproxy_wi" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Patreon</a>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<div id="dialog-confirm" title="Are you sure you want to delete?" style="display: none;">
|
||||
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Deleting irreversibly all data will be lost?</p>
|
||||
</div>
|
||||
<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-ssh-group-add" name="new-ssh-group-add" value="{{ ssh_group }}" >
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#users">Users</a></li>
|
||||
|
@ -31,7 +34,6 @@
|
|||
<tr id="user-{{user.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" id="login-{{user.0}}" value="{{user.1}}" class="form-control">
|
||||
<input type="hidden" id="new-group" name="new-group" value="{{ group }}">
|
||||
<input type="hidden" id="usergroup-{{user.0}}" name="usergroup-{{user.0}}" value="{{ group }}">
|
||||
</td>
|
||||
<td><input type="password" id="password-{{user.0}}" value="{{user.3}}" class="form-control"></td>
|
||||
|
@ -98,14 +100,14 @@
|
|||
<table class="overview" id="ajax-servers">
|
||||
<tr class="overviewHead">
|
||||
<td class="padding10 first-collumn">Hostname</td>
|
||||
<td>IP</td>
|
||||
<td><span title="SSH port">Port(?)</span></td></td>
|
||||
<td>Enable</td>
|
||||
<td><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td><span title="Alert if backend change status. Before enable add Telgram chanel at Checker tab">Alert(?)</span></td>
|
||||
<td><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td><span title="Actions with master config will automatically apply on slave">Slave for (?)</span></td>
|
||||
<td>Credentials</td>
|
||||
<td class="ip-field">IP</td>
|
||||
<td class="checkbox-head"><span title="SSH port">Port(?)</span></td></td>
|
||||
<td class="checkbox-head">Enable</td>
|
||||
<td class="checkbox-head"><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td class="checkbox-head"><span title="Alert if backend change status. Before enable add Telgram chanel at Checker tab">Alert(?)</span></td>
|
||||
<td class="checkbox-head"><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td class="slave-field"><span title="Actions with master config will automatically apply on slave">Slave for (?)</span></td>
|
||||
<td class="cred-field">Credentials</td>
|
||||
<td>Desciption</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
@ -118,34 +120,33 @@
|
|||
</td>
|
||||
<td>
|
||||
<input type="text" id="ip-{{server.0}}" value="{{server.2}}" size="14" class="form-control">
|
||||
<input type="hidden" id="new-server-group-add" name="servergroup-{{server.0}}" value="{{ group }}" >
|
||||
<input type="hidden" id="servergroup-{{server.0}}" name="servergroup-{{server.0}}" value="{{ group }}" >
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
<input type="text" id="port-{{server.0}}" value="{{server.10}}" size="1" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.5 == 1 %}
|
||||
<label for="enable-{{server.0}}"></label><input type="checkbox" id="enable-{{server.0}}" checked>
|
||||
{% else %}
|
||||
<label for="enable-{{server.0}}"></label><input type="checkbox" id="enable-{{server.0}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.4 == 1 %}
|
||||
<label for="typeip-{{server.0}}"></label><input type="checkbox" id="typeip-{{server.0}}" checked>
|
||||
{% else %}
|
||||
<label for="typeip-{{server.0}}"></label><input type="checkbox" id="typeip-{{server.0}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.8 == 1 %}
|
||||
<label for="alert-{{server.0}}"></label><input type="checkbox" id="alert-{{server.0}}" checked>
|
||||
{% else %}
|
||||
<label for="alert-{{server.0}}"></label><input type="checkbox" id="alert-{{server.0}}">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<td class="checkbox">
|
||||
{% if server.9 == 1 %}
|
||||
<label for="metrics-{{server.0}}"></label><input type="checkbox" id="metrics-{{server.0}}" checked>
|
||||
{% else %}
|
||||
|
@ -194,70 +195,6 @@
|
|||
</table>
|
||||
<br /><span class="add-button" title="Add server" id="add-server-button">+ Add</span>
|
||||
<br /><br />
|
||||
<table class="overview" id="server-add-table" style="display: none;">
|
||||
<tr class="overviewHead">
|
||||
<td class="padding10 first-collumn">New hostname</td>
|
||||
<td>IP</td>
|
||||
<td><span title="SSH port">Port(?)</span></td></td>
|
||||
<td>Enable</td>
|
||||
<td><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td><span title="Alert if backend change status">Alert(?)</span></td>
|
||||
<td><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td title="Actions with master config will automatically apply on slave">Slave for</td>
|
||||
<td>Credentials</td>
|
||||
<td>Desciption</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding10 first-collumn">
|
||||
<input type="text" name="new-server-add" id="new-server-add" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="new-ip" id="new-ip" size="14" class="form-control">
|
||||
<input type="hidden" id="new-sshgroup" name="new-sshgroup" value="{{ group }}" >
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="new-port" id="new-port" size=1 class="form-control" value="22">
|
||||
</td>
|
||||
<td>
|
||||
<label for="enable"></label><input type="checkbox" id="enable" checked>
|
||||
</td>
|
||||
<td>
|
||||
<label for="typeip"></label><input type="checkbox" id="typeip">
|
||||
</td>
|
||||
<td>
|
||||
<label for="alert"></label><input type="checkbox" id="alert">
|
||||
</td>
|
||||
<td>
|
||||
<label for="metrics"></label><input type="checkbox" id="metrics">
|
||||
</td>
|
||||
<td>
|
||||
<select id="slavefor">
|
||||
<option selected value="0">Not slave</option>
|
||||
{% for master in masters %}
|
||||
<option value="{{master.0}}">{{master.1}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</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>
|
||||
<td>
|
||||
<input type="text" id="desc" size="30" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
<a class="add-admin" id="add-server" title="Add new server" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="ssh">
|
||||
|
@ -279,7 +216,6 @@
|
|||
<tr style="width: 50%;" id="ssh-table-{{ssh.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="first-collumn">
|
||||
<input type="text" id="ssh_name-{{ssh.0}}" class="form-control" value="{{ssh.1}}" style="margin-bottom: 23px;">
|
||||
<input type="hidden" id="new-ssh-group-add" name="new-ssh-group-add" value="{{ ssh_group }}" >
|
||||
</td>
|
||||
<td class="first-collumn" valign="top" style="padding-top: 15px;">
|
||||
{% if ssh.2 == 1 %}
|
||||
|
@ -423,9 +359,87 @@
|
|||
<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 id="server-add-table" title="View certificate " style="display: none;">
|
||||
<table class="overview">
|
||||
<tr>
|
||||
<td class="padding20">New hostname</td>
|
||||
<td>
|
||||
<input type="text" name="new-server-add" id="new-server-add" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">IP</td>
|
||||
<td>
|
||||
<input type="text" name="new-ip" id="new-ip" size="14" class="form-control">
|
||||
<input type="hidden" id="new-sshgroup" name="new-sshgroup" value="{{ group }}" >
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="SSH port">Port(?)</span></td></td>
|
||||
<td>
|
||||
<input type="text" name="new-port" id="new-port" size=1 class="form-control" value="22">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">Enable</td>
|
||||
<td>
|
||||
<label for="enable"></label><input type="checkbox" id="enable" checked>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="Vitrual IP, something like VRRP">Virt(?)</span></td>
|
||||
<td>
|
||||
<label for="typeip"></label><input type="checkbox" id="typeip">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="Alert if backend change status">Alert(?)</span></td>
|
||||
<td>
|
||||
<label for="alert"></label><input type="checkbox" id="alert">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20"><span title="Enable save and show metrics">Metrics(?)</span></td>
|
||||
<td>
|
||||
<label for="metrics"></label><input type="checkbox" id="metrics">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20" title="Actions with master config will automatically apply on slave">Slave for</td>
|
||||
<td>
|
||||
<select id="slavefor">
|
||||
<option selected value="0">Not slave</option>
|
||||
{% for master in masters %}
|
||||
<option value="{{master.0}}">{{master.1}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">Credentials</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>
|
||||
<tr>
|
||||
<td class="padding20">Desciption</td>
|
||||
<td>
|
||||
<input type="text" id="desc" size="30" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
if($('#new-server-group-add').val() == 1) {
|
||||
$('#group_error').css('display', 'block');
|
||||
$('#add-user-button').css('display', 'none');
|
||||
$('#add-server-button').css('display', 'none');
|
||||
$('#add-ssh-button').css('display', 'none');
|
||||
$('#ssh_key_upload').css('display', 'none');
|
||||
|
@ -443,10 +457,22 @@
|
|||
</script>
|
||||
<style>
|
||||
.ui-selectmenu-button.ui-button {
|
||||
width: 12em;
|
||||
width: 10em;
|
||||
}
|
||||
.ui-selectmenu-menu {
|
||||
z-index: 1010;
|
||||
}
|
||||
.first-collumn {
|
||||
width: 10%;
|
||||
}
|
||||
.checkbox {
|
||||
width: 90px;
|
||||
}
|
||||
.group-field, .slave-field {
|
||||
width: 15%;
|
||||
}
|
||||
.cred-field {
|
||||
width: 20%;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
|
@ -35,7 +35,7 @@
|
|||
$('td').css('font-size', '11');
|
||||
$('h1').css('display', 'none');
|
||||
$('td').css('border-color', '#ddd');
|
||||
$('td').css('padding', '4px');
|
||||
$('td').css('padding', '3px');
|
||||
$('th').css('padding-top', '4px');
|
||||
$('th').css('padding-bottom', '4px');
|
||||
$('th').css('border-color', '#ddd');
|
||||
|
|
|
@ -304,10 +304,25 @@ pre {
|
|||
border-bottom: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/*.overviewTd {
|
||||
padding-top: 20px;
|
||||
}*/
|
||||
.checkbox {
|
||||
width: 60px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.checkbox-head {
|
||||
padding: 0;
|
||||
}
|
||||
.ip-field {
|
||||
width: 100px;
|
||||
}
|
||||
.group-field, .slave-field {
|
||||
width: 10%;
|
||||
}
|
||||
.slave-field {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.cred-field {
|
||||
width: 17%;
|
||||
}
|
||||
.overviewTr {
|
||||
margin: 0;
|
||||
background-color: #f6f8fa;
|
||||
|
@ -343,6 +358,10 @@ pre {
|
|||
border: none;
|
||||
width: 23%;
|
||||
}
|
||||
.padding20 {
|
||||
padding: 15px;
|
||||
width: 30%;
|
||||
}
|
||||
.first-collumn {
|
||||
padding-left: 15px;
|
||||
width: 15%;
|
||||
|
@ -477,7 +496,7 @@ b,
|
|||
strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
button,
|
||||
//button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
|
|
154
inc/users.js
154
inc/users.js
|
@ -188,64 +188,6 @@ $( function() {
|
|||
}
|
||||
} );
|
||||
});
|
||||
$('#add-server').click(function() {
|
||||
$('#error').remove();
|
||||
$('.alert-danger').remove();
|
||||
var typeip = 0;
|
||||
var enable = 0;
|
||||
var alert_en = 0;
|
||||
var metrics = 0;
|
||||
if ($('#typeip').is(':checked')) {
|
||||
typeip = '1';
|
||||
}
|
||||
if ($('#enable').is(':checked')) {
|
||||
enable = '1';
|
||||
}
|
||||
if ($('#alert').is(':checked')) {
|
||||
var alert_en = '1';
|
||||
}
|
||||
if ($('#metrics').is(':checked')) {
|
||||
var metrics = '1';
|
||||
}
|
||||
$.ajax( {
|
||||
url: "sql.py",
|
||||
data: {
|
||||
newserver: "1",
|
||||
servername: $('#new-server-add').val(),
|
||||
newip: $('#new-ip').val(),
|
||||
newport: $('#new-port').val(),
|
||||
newservergroup: $('#new-server-group-add').val(),
|
||||
typeip: typeip,
|
||||
enable: enable,
|
||||
slave: $('#slavefor' ).val(),
|
||||
cred: $('#credentials').val(),
|
||||
alert_en: alert_en,
|
||||
metrics: metrics,
|
||||
page: cur_url[0],
|
||||
desc: $('#desc').val()
|
||||
},
|
||||
type: "GET",
|
||||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
$("#ajax-servers").append(data);
|
||||
$('#errorMess').click(function() {
|
||||
$('#error').remove();
|
||||
$('.alert-danger').remove();
|
||||
});
|
||||
} else {
|
||||
$('.alert-danger').remove();
|
||||
$("#ajax-servers").append(data);
|
||||
$(".newserver").addClass( "update", 1000, callbackServer );
|
||||
$( "input[type=submit], button" ).button();
|
||||
$( "input[type=checkbox]" ).checkboxradio();
|
||||
$( "select" ).selectmenu();
|
||||
$.getScript(awesome);
|
||||
}
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
$('#add-ssh').click(function() {
|
||||
$('#error').remove();
|
||||
$('.alert-danger').remove();
|
||||
|
@ -349,9 +291,29 @@ $( function() {
|
|||
}
|
||||
});
|
||||
$('#add-server-button').click(function() {
|
||||
if ($('#server-add-table').css('display', 'none')) {
|
||||
$('#server-add-table').show("blind", "fast");
|
||||
}
|
||||
$( "#server-add-table" ).dialog({
|
||||
resizable: false,
|
||||
height: "auto",
|
||||
width: 600,
|
||||
modal: true,
|
||||
title: "Add new server",
|
||||
show: {
|
||||
effect: "fade",
|
||||
duration: 200
|
||||
},
|
||||
hide: {
|
||||
effect: "fade",
|
||||
duration: 200
|
||||
},
|
||||
buttons: {
|
||||
"Add": function() {
|
||||
addServer();
|
||||
},
|
||||
Cancel: function() {
|
||||
$( this ).dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#add-ssh-button').click(function() {
|
||||
if ($('#ssh-add-table').css('display', 'none')) {
|
||||
|
@ -422,7 +384,75 @@ $( function() {
|
|||
});
|
||||
|
||||
} );
|
||||
|
||||
function addServer() {
|
||||
$('#error').remove();
|
||||
$('.alert-danger').remove();
|
||||
var servername = $('#new-server-add').val();
|
||||
var newip = $('#new-ip').val();
|
||||
var newservergroup = $('#new-server-group-add').val();
|
||||
var cred = $('#credentials').val();
|
||||
var typeip = 0;
|
||||
var enable = 0;
|
||||
var alert_en = 0;
|
||||
var metrics = 0;
|
||||
if ($('#typeip').is(':checked')) {
|
||||
typeip = '1';
|
||||
}
|
||||
if ($('#enable').is(':checked')) {
|
||||
enable = '1';
|
||||
}
|
||||
if ($('#alert').is(':checked')) {
|
||||
var alert_en = '1';
|
||||
}
|
||||
if ($('#metrics').is(':checked')) {
|
||||
var metrics = '1';
|
||||
}
|
||||
if (servername == '' || newip == '' || newservergroup == '' || cred == '') {
|
||||
alert('All fields must be completed');
|
||||
} else {
|
||||
$.ajax( {
|
||||
url: "sql.py",
|
||||
data: {
|
||||
newserver: "1",
|
||||
servername: servername,
|
||||
newip: newip,
|
||||
newport: $('#new-port').val(),
|
||||
newservergroup: newservergroup,
|
||||
typeip: typeip,
|
||||
enable: enable,
|
||||
slave: $('#slavefor' ).val(),
|
||||
cred: cred,
|
||||
alert_en: alert_en,
|
||||
metrics: metrics,
|
||||
page: cur_url[0],
|
||||
desc: $('#desc').val()
|
||||
},
|
||||
type: "GET",
|
||||
success: function( data ) {
|
||||
data = data.replace(/\s+/g,' ');
|
||||
if (data.indexOf('error') != '-1') {
|
||||
$("#ajax-servers").append(data);
|
||||
$('#errorMess').click(function() {
|
||||
$('#error').remove();
|
||||
$('.alert-danger').remove();
|
||||
});
|
||||
} else {
|
||||
$('.alert-danger').remove();
|
||||
$("#ajax-servers").append(data);
|
||||
$(".newserver").addClass( "update", 1000 );
|
||||
setTimeout(function() {
|
||||
$( ".newserver" ).removeClass( "update" );
|
||||
}, 2500 );
|
||||
$( "input[type=submit], button" ).button();
|
||||
$( "input[type=checkbox]" ).checkboxradio();
|
||||
$( "select" ).selectmenu();
|
||||
$.getScript(awesome);
|
||||
}
|
||||
}
|
||||
} );
|
||||
$( "#server-add-table" ).dialog("close" );
|
||||
}
|
||||
}
|
||||
function updateSettings(param, val) {
|
||||
$('.alert-danger').remove();
|
||||
$.ajax( {
|
||||
|
|
Loading…
Reference in New Issue