mirror of https://github.com/Aidaho12/haproxy-wi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.8 KiB
57 lines
1.8 KiB
{% extends "base.html" %}
|
|
{% block content %}
|
|
<br />
|
|
<form style="padding-left: 20px;" action="viewsttats.py" method="get">
|
|
<select autofocus required name="serv" id="serv">
|
|
<option disabled>Choose server</option>
|
|
{% for select in selects %}
|
|
{% if select.2 == serv %}
|
|
<option value="{{ select.2 }}" selected>{{ select.1 }}</option>
|
|
{% else %}
|
|
<option value="{{ select.2 }}">{{ select.1 }}</option>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</select>
|
|
<a class="ui-button ui-widget ui-corner-all" id="show" title="Show stats" onclick="{{ onclick }}">Show</a>
|
|
</form>
|
|
<br />
|
|
<div id="ajax" style="margin-left: 20px; width: 98%"></div>
|
|
<script>
|
|
window.onload = showStats();
|
|
function sleep(ms) {
|
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
}
|
|
async function wait() {
|
|
$('form').append('<input type="hidden" name="serv" value='+$("#serv").val()+'>');
|
|
$('form').append('<input type="hidden" name="token" value='+$('#token').val()+'>');
|
|
$( "input[type=submit], button" ).button();
|
|
$('li').css('margin-top', '0');
|
|
$('table.tbl th.pxname').css('background-color', '#5d9ceb');
|
|
$('a.px:link').css('color', '#fff');
|
|
$('h1').css('display', 'none');
|
|
$('h1').next().css('display', 'none');
|
|
$('h1').next().next().css('display', 'none');
|
|
$('h1').next().next().next().css('display', 'none');
|
|
$('h1').next().next().next().next().css('display', 'none');
|
|
$( "select" ).selectmenu();
|
|
await sleep(2000);
|
|
|
|
$("form").submit(function() {
|
|
$.ajax({
|
|
type: "get",
|
|
url: "options.py",
|
|
dataType: "text",
|
|
data: $(this).serialize(),
|
|
success: function( data ) {
|
|
showStats();
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
}
|
|
$('#serv').on('selectmenuchange',function() {
|
|
showStats();
|
|
});
|
|
</script>
|
|
<link href="/inc/style.css" rel="stylesheet">
|
|
{% endblock %} |