mirror of https://github.com/Aidaho12/haproxy-wi
v3.4.9.4
Improved the User page, Improved the log pages, logo, Improved designpull/161/head
parent
53a26808a0
commit
42a681182c
|
@ -400,7 +400,7 @@ def update_db_v_3_4_7(**kwargs):
|
|||
|
||||
def update_ver(**kwargs):
|
||||
con, cur = get_cur()
|
||||
sql = """update version set version = '3.4.9.3'; """
|
||||
sql = """update version set version = '3.4.9.4'; """
|
||||
try:
|
||||
cur.execute(sql)
|
||||
con.commit()
|
||||
|
@ -410,19 +410,6 @@ def update_ver(**kwargs):
|
|||
con.close()
|
||||
|
||||
|
||||
# def check_hash():
|
||||
# con, cur = get_cur()
|
||||
# sql = """select hash from version"""
|
||||
|
||||
# try:
|
||||
# cur.execute(sql)
|
||||
# return False
|
||||
# except sqltool.Error as e:
|
||||
# return True
|
||||
# cur.close()
|
||||
# con.close()
|
||||
|
||||
|
||||
def update_to_hash():
|
||||
cur_ver = funct.check_ver()
|
||||
cur_ver = cur_ver.replace('.','')
|
||||
|
@ -450,20 +437,6 @@ def update_to_hash():
|
|||
if kwargs.get('silent') != 1:
|
||||
print("An error occurred:", e)
|
||||
|
||||
# con, cur = get_cur()
|
||||
# sql = """
|
||||
# ALTER TABLE `version` ADD COLUMN hash INTEGER NOT NULL DEFAULT 1;
|
||||
# """
|
||||
# try:
|
||||
# cur.execute(sql)
|
||||
# con.commit()
|
||||
# except sqltool.Error as e:
|
||||
# if kwargs.get('silent') != 1:
|
||||
# print("An error occurred:", e)
|
||||
|
||||
# cur.close()
|
||||
# con.close()
|
||||
|
||||
|
||||
def update_all():
|
||||
update_db_v_31()
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HAProxy-WI</title>
|
||||
<link href="/image/pic/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link href="/inc/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="/inc/images/favicon.ico" type="image/x-icon">
|
||||
<link href="/inc/style.css" rel="stylesheet">
|
||||
<link href="/inc/nprogress.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/inc/jquery-ui.css">
|
||||
|
@ -13,7 +13,7 @@
|
|||
<script src="/inc/nprogress.js"></script>
|
||||
<meta http-equiv="refresh" content="0; url=/app/overview.py" />
|
||||
</head>
|
||||
<body style="background-color: #5d9ceb;">
|
||||
<body style="background-color: #239dee;">
|
||||
<script>
|
||||
$( function() {
|
||||
NProgress.start();
|
||||
|
@ -24,7 +24,7 @@
|
|||
<center>
|
||||
<div style="color: white;">
|
||||
<h1 style="font-size: 100px;">Welcome to</h1>
|
||||
<h1 style="font-size: 130px;">HAProxy-WI</h1>
|
||||
<img src="/inc/images/logo_index.png" alt="logo" style="margin-top: -50px;display: block;padding-bottom: 70px;" />
|
||||
<b style="font-size: 30px;">Redirecting... Please wait</b>
|
||||
</div>
|
||||
</center>
|
||||
|
|
11
app/logs.py
11
app/logs.py
|
@ -19,6 +19,11 @@ if form.getvalue('rows') is None:
|
|||
else:
|
||||
rows = form.getvalue('rows')
|
||||
|
||||
hour = form.getvalue('hour')
|
||||
hour1 = form.getvalue('hour1')
|
||||
minut = form.getvalue('minut')
|
||||
minut1 = form.getvalue('minut1')
|
||||
|
||||
print('Content-type: text/html\n')
|
||||
funct.check_login()
|
||||
|
||||
|
@ -34,7 +39,7 @@ except:
|
|||
|
||||
output_from_parsed_template = template.render(h2 = 1,
|
||||
autorefresh = 1,
|
||||
title = "Show logs",
|
||||
title = "HAProxy logs",
|
||||
role = sql.get_user_role_by_uuid(user_id.value),
|
||||
user = user,
|
||||
onclick = "showLog()",
|
||||
|
@ -43,6 +48,10 @@ output_from_parsed_template = template.render(h2 = 1,
|
|||
serv = form.getvalue('serv'),
|
||||
rows = rows,
|
||||
grep = grep,
|
||||
hour = hour,
|
||||
hour1 = hour1,
|
||||
minut = minut,
|
||||
minut1 = minut1,
|
||||
versions = funct.versions(),
|
||||
token = token)
|
||||
print(output_from_parsed_template)
|
||||
|
|
|
@ -251,7 +251,7 @@ if serv is not None and form.getvalue('rows1') is not None:
|
|||
if form.getvalue('viewlogs') is not None:
|
||||
viewlog = form.getvalue('viewlogs')
|
||||
log_path = funct.get_config_var('main', 'log_path')
|
||||
rows = form.getvalue('rows2')
|
||||
rows = form.getvalue('rows')
|
||||
grep = form.getvalue('grep')
|
||||
hour = form.getvalue('hour')
|
||||
minut = form.getvalue('minut')
|
||||
|
|
|
@ -32,6 +32,30 @@
|
|||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<script>
|
||||
$( function() {
|
||||
{% for user in users %}
|
||||
$("#role-{{user.0}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#usergroup-{{user.0}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
|
||||
{% endfor %}
|
||||
{% for server in servers %}
|
||||
$("#servergroup-{{ server.0}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#slavefor-{{server.0}}" ).selectmenu({
|
||||
width: 130
|
||||
});
|
||||
$("#credentials-{{server.0}}" ).selectmenu({
|
||||
width: 150
|
||||
});
|
||||
{% endfor %}
|
||||
});
|
||||
</script>
|
||||
{% for user in users %}
|
||||
<tr id="user-{{user.0}}" class="{{ loop.cycle('odd', 'even') }}">
|
||||
<td class="padding10 first-collumn">
|
||||
|
@ -42,10 +66,10 @@
|
|||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if user.6 == 1%}
|
||||
<input type="password" id="password-{{user.0}}" value="{{user.3}}" class="form-control" readonly>
|
||||
{% else %}
|
||||
<input type="password" id="password-{{user.0}}" value="{{user.3}}" class="form-control">
|
||||
{% if user.6 != 1%}
|
||||
<span title="Change password" style="cursor: pointer">
|
||||
<img src="/inc/images/edit.png" alt="Edit" width="15" style="margin-bottom: -3px; padding-left: 15px;" onclick="openChangeUserPasswordDialog('{{user.0}}')" />
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="checkbox">
|
||||
|
@ -256,9 +280,9 @@
|
|||
</td>
|
||||
<td>
|
||||
{% if server.11 != "None" %}
|
||||
<input type="text" id="desc-{{server.0}}" value="{{server.11}}" size="30" class="form-control">
|
||||
<input type="text" id="desc-{{server.0}}" value="{{server.11}}" size="20" class="form-control">
|
||||
{% else %}
|
||||
<input type="text" id="desc-{{server.0}}" value="" size="30" class="form-control">
|
||||
<input type="text" id="desc-{{server.0}}" value="" size="20" class="form-control">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
|
@ -662,6 +686,36 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="user-change-password-table" style="display: none;">
|
||||
<table class="overview">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<p class="validateTips alert alert-success">Enter password and confirm</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">
|
||||
Password
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="change-password" id="change-password" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padding20">
|
||||
Confirm password
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" name="change2-password" id="change2-password" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="missmatchpass" style="display: none;">
|
||||
<td colspan="2">
|
||||
<p class="validateTips alert alert-danger" style="margin-top: 10px;">Passwords are mismatched</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<style>
|
||||
.ui-selectmenu-button.ui-button {
|
||||
width: 10em;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{% for server in servers %}
|
||||
|
||||
<tr id="server-{{server.0}}" class="newserver">
|
||||
<td class="padding10 first-collumn" style="padding-top: 20px;">
|
||||
<input type="text" id="hostname-{{server.0}}" value="{{server.1}}" class="form-control">
|
||||
|
@ -89,9 +90,9 @@
|
|||
</td>
|
||||
<td>
|
||||
{% if server.11 != "None" %}
|
||||
<input type="text" id="desc-{{server.0}}" value="{{server.11}}" size="30" class="form-control">
|
||||
<input type="text" id="desc-{{server.0}}" value="{{server.11}}" size="20" class="form-control">
|
||||
{% else %}
|
||||
<input type="text" id="desc-{{server.0}}" value="" size="30" class="form-control">
|
||||
<input type="text" id="desc-{{server.0}}" value="" size="20" class="form-control">
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
|
@ -101,4 +102,17 @@
|
|||
<a class="delete" onclick="removeServer({{server.0}})" title="Delete server {{server.1}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<script>
|
||||
$( function() {
|
||||
$("#servergroup-{{ server.0}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#slavefor-{{server.0}}" ).selectmenu({
|
||||
width: 130
|
||||
});
|
||||
$("#credentials-{{server.0}}" ).selectmenu({
|
||||
width: 150
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endfor %}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
<input type="text" id="login-{{user.0}}" value="{{user.1}}" class="form-control">
|
||||
</td>
|
||||
<td>
|
||||
{% if user.6 == 1%}
|
||||
<input type="password" id="password-{{user.0}}" value="{{user.3}}" class="form-control" readonly>
|
||||
{% else %}
|
||||
<input type="password" id="password-{{user.0}}" value="{{user.3}}" class="form-control">
|
||||
{% if user.6 != 1%}
|
||||
<span title="Change password" style="cursor: pointer">
|
||||
<img src="/inc/images/edit.png" alt="Edit" width="15" style="margin-bottom: -3px; padding-left: 15px;" onclick="openChangeUserPasswordDialog('{{user.0}}')" />
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="checkbox">
|
||||
|
@ -48,9 +48,22 @@
|
|||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<td>
|
||||
<a class="add" onclick="cloneUser({{user.0}})" id="clone-{{user.0}}" title="Clone {{user.1}}" style="cursor: pointer;"></a>
|
||||
</td>
|
||||
<td><a class="delete" onclick="removeUser({{user.0}})" style="cursor: pointer;"></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<script>
|
||||
$( function() {
|
||||
$("#role-{{user.0}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
$("#usergroup-{{user.0}}" ).selectmenu({
|
||||
width: 100
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endfor %}
|
||||
<script>
|
||||
$( "#ajax-users input" ).change(function() {
|
||||
var id = $(this).attr('id').split('-');
|
||||
|
|
|
@ -25,7 +25,11 @@
|
|||
<input type="hidden" id="token" value="{{ token }}">
|
||||
<div class="top-menu">
|
||||
<div class="LogoText">
|
||||
<span id="logo_text">HAProxy-WI</span>
|
||||
<span id="logo_text">
|
||||
<a href="https://haproxy-wi.org" title="HAProxy-WI site" target="_blank">
|
||||
<img src="/inc/images/logo_menu.png" alt="logo" width="170" />
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div id="top-link" class="top-link">
|
||||
<nav id="menu">
|
||||
|
@ -101,7 +105,6 @@
|
|||
{% set current_ver_without_dots = versions.2 %}
|
||||
{% set new_ver_without_dots = versions.3 %}
|
||||
{% endif %}
|
||||
<a href="https://github.com/aidaho12/haproxy-wi/" title="Github repo" target="_blank" style="color: #fff">HAproxy-WI</a>
|
||||
{% if new_ver_without_dots is defined and current_ver_without_dots is defined and new_ver is defined and new_ver_without_dots is defined %}
|
||||
{% if new_ver_without_dots > current_ver_without_dots and new_ver != "Sorry cannot get current version" %}
|
||||
<span id="show-updates-button" class="new-version-exists">v{{current_ver}} </span>
|
||||
|
@ -112,7 +115,7 @@
|
|||
v{{current_ver}}
|
||||
{% endif %}
|
||||
<br>
|
||||
<a href="https://haproxy-wi.org/donate.py" title="Donate" target="_blank" style="color: #fff; margin-left: 30px; color: red;" class="patreon"> Donate</a>
|
||||
<a href="https://haproxy-wi.org/donate.py" title="Donate" target="_blank" style="color: #fff; margin-left: -10px; color: red;" class="patreon"> Donate</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<a href="/app/config.py?serv={{s.2}}&showCompare" class="ui-button ui-widget ui-corner-all" title="Compare configs">Compare</a>
|
||||
<a href="/app/config.py?serv={{s.2}}&showMap" class="ui-button ui-widget ui-corner-all" title="Show map">Map</a>
|
||||
<a href="/app/viewsttats.py?serv={{s.2}}" class="ui-button ui-widget ui-corner-all" title="View stat">Stat</a>
|
||||
<a href="/app/logs.py?serv={{s.2}}" class="ui-button ui-widget ui-corner-all" title="View log">Log</a>
|
||||
{% if role <= 2 %}
|
||||
<a href="/app/versions.py?serv={{s.2}}&open=open" class="ui-button ui-widget ui-corner-all">Versions</a>
|
||||
{% endif %}
|
||||
|
|
|
@ -32,9 +32,11 @@ body, .container {
|
|||
{{error}}
|
||||
{{db_create}}
|
||||
<div id="login-form" style="padding-top: 40px; padding-bottom: 50px; height: 250px; color: #000;">
|
||||
<span style="font-size: 50px; font-weight: bold; color: #fff;">HAProxy-WI</span>
|
||||
<!-- <span><img src="/inc/images/logo_big1.png" width=300 style="margin-top: -100px; margin-bottom: -100px; padding-left: 70px;"></span> -->
|
||||
<form name="auth" id="auth" action="login.py" class="form-horizontal" method="post" >
|
||||
<!-- <span style="font-size: 50px; font-weight: bold; color: #fff;">HAProxy-WI</span> -->
|
||||
<span style="float: left;margin-left: 8%;border-right: 3px solid #ddd;height: 270px;">
|
||||
<img src="/inc/images/logo_login.png" width=330 style="margin-top: -40px; margin-bottom: -40px; padding-left: 70px;">
|
||||
</span>
|
||||
<form name="auth" id="auth" action="login.py" class="form-horizontal" method="post" style="margin-top: 40px;left: 0;float: left;margin-left: 93px;">
|
||||
<br>
|
||||
<input type="text" name="login" id="login" required class="form-control" placeholder="Login"><br /><br />
|
||||
<input type="password" name="pass" id="pass" required class="form-control" placeholder="Password"><br /><br />
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
<td class="padding10" style="width: 10%;">Ex for grep</td>
|
||||
<td style="width: 10%;">
|
||||
<label for="time_range_out_hour" style="padding: 0">Time range:</label>
|
||||
<input type="text" id="time_range_out_hour" readonly class="time-range">:<input type="text" id="time_range_out_minut" readonly class="time-range"> -
|
||||
<input type="text" id="time_range_out_hour1" readonly class="time-range">:<input type="text" id="time_range_out_minut1" readonly class="time-range">
|
||||
<input type="text" id="time_range_out_hour" readonly class="time-range" value="{{hour}}">:<input type="text" id="time_range_out_minut" readonly class="time-range" value="{{minut}}"> -
|
||||
<input type="text" id="time_range_out_hour1" readonly class="time-range" value="{{hour1}}">:<input type="text" id="time_range_out_minut1" readonly class="time-range" value="{{minut1}}">
|
||||
</td>
|
||||
<td style="width: 10%;"> </td>
|
||||
</tr>
|
||||
|
@ -29,7 +29,7 @@
|
|||
{% if onclick == 'viewLogs()' %}
|
||||
<option disabled selected>Choose log</option>
|
||||
{% for select in selects %}
|
||||
{% if select.2 == serv %}
|
||||
{% if select.0 == serv %}
|
||||
<option value="{{ select.0 }}" selected>{{ select.1 }}</option>
|
||||
{% else %}
|
||||
<option value="{{ select.0 }}">{{ select.1 }}</option>
|
||||
|
@ -69,4 +69,17 @@
|
|||
</table>
|
||||
<div id="ajax">
|
||||
</div>
|
||||
{% if onclick == 'viewLogs()' and serv != '' and viewlogs != '' and viewlogs != 'haproxy-wi.error.log' and viewlogs != 'haproxy-wi.access.log' %}
|
||||
<script>
|
||||
viewLogs()
|
||||
</script>
|
||||
{% elif serv == 'haproxy-wi.error.log' or serv == 'haproxy-wi.access.log' %}
|
||||
<script>
|
||||
showApacheLog('{{serv}}');
|
||||
</script>
|
||||
{% else %}
|
||||
<script>
|
||||
showLog()
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -19,6 +19,16 @@ if form.getvalue('rows') is None:
|
|||
rows = 10
|
||||
else:
|
||||
rows = form.getvalue('rows')
|
||||
|
||||
if form.getvalue('viewlogs') is None:
|
||||
serv = form.getvalue('serv')
|
||||
else:
|
||||
serv = form.getvalue('viewlogs')
|
||||
|
||||
hour = form.getvalue('hour')
|
||||
hour1 = form.getvalue('hour1')
|
||||
minut = form.getvalue('minut')
|
||||
minut1 = form.getvalue('minut1')
|
||||
|
||||
print('Content-type: text/html\n')
|
||||
funct.check_login()
|
||||
|
@ -64,11 +74,15 @@ output_from_parsed_template = template.render(h2 = 1,
|
|||
role = sql.get_user_role_by_uuid(user_id.value),
|
||||
user = user,
|
||||
onclick = "viewLogs()",
|
||||
serv = form.getvalue('viewlogs'),
|
||||
serv = serv,
|
||||
select_id = "viewlogs",
|
||||
selects = selects,
|
||||
rows = rows,
|
||||
grep = grep,
|
||||
hour = hour,
|
||||
hour1 = hour1,
|
||||
minut = minut,
|
||||
minut1 = minut1,
|
||||
versions = funct.versions(),
|
||||
token = token)
|
||||
print(output_from_parsed_template)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
107
inc/script.js
107
inc/script.js
|
@ -106,7 +106,7 @@ function setRefreshInterval(interval) {
|
|||
if (interval == "0") {
|
||||
Cookies.remove('auto-refresh');
|
||||
pauseAutoRefresh();
|
||||
$('.auto-refresh').prepend('<img src=/image/pic/update.png alt="restart" class="icon">');
|
||||
$('.auto-refresh').prepend('<img src=/inc/images/update.png alt="restart" class="icon">');
|
||||
$('.auto-refresh').css('margin-top', '-3px');
|
||||
$('#1').text('Auto-refresh');
|
||||
$('#0').text('Auto-refresh');
|
||||
|
@ -310,23 +310,35 @@ function showLog() {
|
|||
if ($('#waf').is(':checked')) {
|
||||
waf = '1';
|
||||
}
|
||||
var rows = $('#rows').val()
|
||||
var grep = $('#grep').val()
|
||||
var hour = $('#time_range_out_hour').val()
|
||||
var minut = $('#time_range_out_minut').val()
|
||||
var hour1 = $('#time_range_out_hour1').val()
|
||||
var minut1 = $('#time_range_out_minut1').val()
|
||||
$.ajax( {
|
||||
url: "options.py",
|
||||
data: {
|
||||
rows: $('#rows').val(),
|
||||
rows: rows,
|
||||
serv: $("#serv").val(),
|
||||
waf: waf,
|
||||
grep: $("#grep").val(),
|
||||
hour: $('#time_range_out_hour').val(),
|
||||
minut: $('#time_range_out_minut').val(),
|
||||
hour1: $('#time_range_out_hour1').val(),
|
||||
minut1: $('#time_range_out_minut1').val(),
|
||||
grep: grep,
|
||||
hour: hour,
|
||||
minut: minut,
|
||||
hour1: hour1,
|
||||
minut1: minut1,
|
||||
token: $('#token').val()
|
||||
},
|
||||
type: "GET",
|
||||
success: function( data ) {
|
||||
$("#ajax").html(data);
|
||||
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+$("#serv").val()+"&rows="+$('#rows').val()+"&grep="+$("#grep").val());
|
||||
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+$("#serv").val()+
|
||||
'&rows='+rows+
|
||||
'&grep='+grep+
|
||||
'&hour='+hour+
|
||||
'&minut='+minut+
|
||||
'&hour1='+hour1+
|
||||
'&minut1='+minut1);
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -457,22 +469,34 @@ function viewLogs() {
|
|||
if($('#viewlogs').val() == 'haproxy-wi.error.log' || $('#viewlogs').val() == 'haproxy-wi.access.log') {
|
||||
showApacheLog($('#viewlogs').val());
|
||||
} else {
|
||||
var rows = $('#rows').val()
|
||||
var grep = $('#grep').val()
|
||||
var hour = $('#time_range_out_hour').val()
|
||||
var minut = $('#time_range_out_minut').val()
|
||||
var hour1 = $('#time_range_out_hour1').val()
|
||||
var minut1 = $('#time_range_out_minut1').val()
|
||||
$.ajax( {
|
||||
url: "options.py",
|
||||
data: {
|
||||
viewlogs: $('#viewlogs').val(),
|
||||
rows2: $('#rows').val(),
|
||||
grep: $("#grep").val(),
|
||||
hour: $('#time_range_out_hour').val(),
|
||||
minut: $('#time_range_out_minut').val(),
|
||||
hour1: $('#time_range_out_hour1').val(),
|
||||
minut1: $('#time_range_out_minut1').val(),
|
||||
rows: rows,
|
||||
grep: grep,
|
||||
hour: hour,
|
||||
minut: minut,
|
||||
hour1: hour1,
|
||||
minut1: minut1,
|
||||
token: $('#token').val(),
|
||||
},
|
||||
type: "GET",
|
||||
success: function( data ) {
|
||||
$("#ajax").html(data);
|
||||
window.history.pushState("View logs", "View logs", cur_url[0]+"?viewlogs="+$("#viewlogs").val());
|
||||
window.history.pushState("View logs", "View logs", cur_url[0]+"?viewlogs="+$("#viewlogs").val()+
|
||||
'&rows='+rows+
|
||||
'&grep='+grep+
|
||||
'&hour='+hour+
|
||||
'&minut='+minut+
|
||||
'&hour1='+hour1+
|
||||
'&minut1='+minut1);
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
@ -547,8 +571,16 @@ $( function() {
|
|||
}
|
||||
|
||||
var now = new Date(Date.now());
|
||||
var date1 = now.getHours() * 60 - 1 * 60;
|
||||
var date2 = now.getHours() * 60 + now.getMinutes();
|
||||
if($('#time_range_out_hour').val() != '' && $('#time_range_out_hour').val() != 'None') {
|
||||
var date1 = parseInt($('#time_range_out_hour').val(), 10) * 60 + parseInt($('#time_range_out_minut').val(), 10)
|
||||
} else {
|
||||
var date1 = now.getHours() * 60 - 1 * 60;
|
||||
}
|
||||
if($('#time_range_out_hour').val() != '' && $('#time_range_out_hour').val() != 'None') {
|
||||
var date2 = parseInt($('#time_range_out_hour1').val(), 10) * 60 + parseInt($('#time_range_out_minut1').val(), 10)
|
||||
} else {
|
||||
var date2 = now.getHours() * 60 + now.getMinutes();
|
||||
}
|
||||
$("#time-range").slider({
|
||||
range: true,
|
||||
min: 0,
|
||||
|
@ -567,10 +599,18 @@ $( function() {
|
|||
|
||||
if(hours1.toString().length == 1) hours1 = '0' + hours1;
|
||||
if(minutes1.toString().length == 1) minutes1 = '0' + minutes1;
|
||||
$('#time_range_out_hour').val(hours);
|
||||
$('#time_range_out_minut').val(minutes);
|
||||
$('#time_range_out_hour1').val(hours1);
|
||||
$('#time_range_out_minut1').val(minutes1);
|
||||
if($('#time_range_out_hour').val() != '' && $('#time_range_out_hour').val() != 'None') {
|
||||
$('#time_range_out_hour').val(hours);
|
||||
}
|
||||
if($('#time_range_out_minut').val() != '' && $('#time_range_out_minut').val() != 'None') {
|
||||
$('#time_range_out_minut').val(minutes);
|
||||
}
|
||||
if($('#time_range_out_hour1').val() != '' && $('#time_range_out_hour1').val() != 'None') {
|
||||
$('#time_range_out_hour1').val(hours1);
|
||||
}
|
||||
if($('#time_range_out_minut1').val() != '' && $('#time_range_out_minut1').val() != 'None') {
|
||||
$('#time_range_out_minut1').val(minutes1);
|
||||
}
|
||||
}
|
||||
});
|
||||
var date1_hours = Math.floor(date1/60);
|
||||
|
@ -579,11 +619,26 @@ $( function() {
|
|||
if(date1_hours <= 9) date1_hours = '0' + date1_hours;
|
||||
if(date2_hours <= 9) date2_hours = '0' + date2_hours;
|
||||
if(date2_minute <= 9) date2_minute = '0' + date2_minute;
|
||||
|
||||
$('#time_range_out_hour').val(date1_hours);
|
||||
$('#time_range_out_minut').val('00');
|
||||
$('#time_range_out_hour1').val(date2_hours);
|
||||
$('#time_range_out_minut1').val(date2_minute);
|
||||
if($('#time_range_out_hour').val() != '' && $('#time_range_out_hour').val() != 'None') {
|
||||
$('#time_range_out_hour').val($('#time_range_out_hour').val());
|
||||
} else {
|
||||
$('#time_range_out_hour').val(date1_hours);
|
||||
}
|
||||
if($('#time_range_out_minut').val() != '' && $('#time_range_out_minut').val() != 'None') {
|
||||
$('#time_range_out_minut').val($('#time_range_out_minut').val());
|
||||
} else {
|
||||
$('#time_range_out_minut').val('00');
|
||||
}
|
||||
if($('#time_range_out_hour1').val() != '' && $('#time_range_out_hour1').val() != 'None') {
|
||||
$('#time_range_out_hour1').val($('#time_range_out_hour1').val());
|
||||
} else {
|
||||
$('#time_range_out_hour1').val(date2_hours);
|
||||
}
|
||||
if($('#time_range_out_minut1').val() != '' && $('#time_range_out_minut1').val() != 'None') {
|
||||
$('#time_range_out_minut1').val($('#time_range_out_minut1').val());
|
||||
} else {
|
||||
$('#time_range_out_minut1').val(date2_minute);
|
||||
}
|
||||
|
||||
$('#0').click(function() {
|
||||
$('.auto-refresh-div').show("blind", "fast");
|
||||
|
|
|
@ -52,7 +52,7 @@ pre {
|
|||
left: 0;
|
||||
z-index: 1000;
|
||||
display: block;
|
||||
background-color: #292e34;
|
||||
background-color: #222a31;
|
||||
}
|
||||
.logoText {
|
||||
color: #EBF1F1;
|
||||
|
@ -69,9 +69,9 @@ pre {
|
|||
margin-top: -4px;
|
||||
}
|
||||
.top-menu img {
|
||||
max-width: 125px;
|
||||
float: left;
|
||||
padding-left: 20px;
|
||||
max-width: 200px;
|
||||
margin-left: -7px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
.container {
|
||||
min-height: calc(99vh - 50px);
|
||||
|
@ -234,16 +234,13 @@ pre {
|
|||
.paramInSec {
|
||||
font-weight: bold;
|
||||
}
|
||||
/* .copyright { */
|
||||
/* color: #23527c; */
|
||||
/* margin-left: 15px; */
|
||||
/* } */
|
||||
.copyright-menu {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
color: #fff;
|
||||
margin-left: 30px;
|
||||
position: fixed;
|
||||
margin-left: 65px;
|
||||
}
|
||||
.line {
|
||||
background-color: #f5faf4;
|
||||
|
@ -346,8 +343,7 @@ pre {
|
|||
border-radius: 5px;
|
||||
}
|
||||
.checkbox {
|
||||
width: 60px;
|
||||
padding-left: 5px;
|
||||
min-width: 30px;
|
||||
}
|
||||
.checkbox-head {
|
||||
padding: 0;
|
||||
|
@ -448,7 +444,7 @@ ul{
|
|||
font-size: 1.1em;
|
||||
}
|
||||
.menu a{
|
||||
background: #292e34;
|
||||
background: #222a31;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
display: block;
|
||||
|
@ -700,9 +696,12 @@ label {
|
|||
.div-server {
|
||||
background-color: #fbfbfb;
|
||||
border: 1px solid #A4C7F5;
|
||||
width: 25em;
|
||||
width: 365px;
|
||||
padding: 20px;
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
margin: 20px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 0;
|
||||
margin-top: 13px;
|
||||
display: block;
|
||||
|
@ -729,10 +728,14 @@ label {
|
|||
.server-desc {
|
||||
padding-bottom: 10px;
|
||||
color: #999;
|
||||
padding-top: 10px;;
|
||||
padding-top: 10px;
|
||||
min-height: 60px;
|
||||
}
|
||||
.server-act-links {
|
||||
margin-left: -2px;
|
||||
}
|
||||
.server-act-links a {
|
||||
margin-right: 4.3px !important
|
||||
margin-right: 2.8px !important
|
||||
}
|
||||
.server-act-links a:last-child {
|
||||
margin-right: 0 !important;
|
||||
|
@ -743,14 +746,14 @@ label {
|
|||
}
|
||||
.ajax-server {
|
||||
margin: 25px;
|
||||
margin-left: 32em;
|
||||
margin-left: 440px;
|
||||
margin-bottom: 0;
|
||||
width: 60em;
|
||||
display: none;
|
||||
margin-top: px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 14px;
|
||||
height: 12.3em;
|
||||
height: 172px;
|
||||
}
|
||||
.haproxy-info {
|
||||
display: inline-block;
|
||||
|
|
24
inc/users.js
24
inc/users.js
|
@ -1125,22 +1125,32 @@ function updateTelegram(id) {
|
|||
} );
|
||||
}
|
||||
function showApacheLog(serv) {
|
||||
var rows = $('#rows').val()
|
||||
var grep = $('#grep').val()
|
||||
var hour = $('#time_range_out_hour').val()
|
||||
var minut = $('#time_range_out_minut').val()
|
||||
var hour1 = $('#time_range_out_hour1').val()
|
||||
var minut1 = $('#time_range_out_minut1').val()
|
||||
$.ajax( {
|
||||
url: "options.py",
|
||||
data: {
|
||||
rows1: $('#rows').val(),
|
||||
rows1: rows,
|
||||
serv: serv,
|
||||
grep: $("#grep").val(),
|
||||
hour: $('#time_range_out_hour').val(),
|
||||
minut: $('#time_range_out_minut').val(),
|
||||
hour1: $('#time_range_out_hour1').val(),
|
||||
minut1: $('#time_range_out_minut1').val(),
|
||||
grep: grep,
|
||||
hour: hour,
|
||||
minut:minut,
|
||||
hour1: hour1,
|
||||
minut1: minut1,
|
||||
token: $('#token').val()
|
||||
},
|
||||
type: "GET",
|
||||
success: function( data ) {
|
||||
$("#ajax").html(data);
|
||||
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+$("#serv").val()+"&rows1="+$('#rows').val()+"&grep="+$("#grep").val());
|
||||
window.history.pushState("Logs", "Logs", cur_url[0]+"?serv="+serv+"&rows1="+rows+"&grep="+grep+
|
||||
'&hour='+hour+
|
||||
'&minut='+minut+
|
||||
'&hour1='+hour1+
|
||||
'&minut1='+minut1);
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>HAProxy-WI</title>
|
||||
<link href="/image/pic/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link href="/inc/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="/inc/images/favicon.ico" type="image/x-icon">
|
||||
<link href="/inc/style.css" rel="stylesheet">
|
||||
<link href="/inc/nprogress.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/inc/jquery-ui.css">
|
||||
|
@ -13,7 +13,7 @@
|
|||
<script src="/inc/nprogress.js"></script>
|
||||
<meta http-equiv="refresh" content="0; url=/app/overview.py" />
|
||||
</head>
|
||||
<body style="background-color: #5d9ceb;">
|
||||
<body style="background-color: #239dee;">
|
||||
<script>
|
||||
$( function() {
|
||||
NProgress.start();
|
||||
|
@ -24,7 +24,7 @@
|
|||
<center>
|
||||
<div style="color: white;">
|
||||
<h1 style="font-size: 100px;">Welcome to</h1>
|
||||
<h1 style="font-size: 130px;">HAProxy-WI</h1>
|
||||
<img src="/inc/images/logo_index.png" alt="logo" style="margin-top: -50px;display: block;padding-bottom: 70px;" />
|
||||
<b style="font-size: 30px;">Redirecting... Please wait</b>
|
||||
</div>
|
||||
</center>
|
||||
|
|
Loading…
Reference in New Issue