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.
54 lines
1.4 KiB
54 lines
1.4 KiB
7 years ago
|
#!/usr/bin/env python3
|
||
|
import html
|
||
|
import cgi
|
||
|
import funct
|
||
|
|
||
|
form = cgi.FieldStorage()
|
||
|
serv = form.getvalue('serv')
|
||
|
|
||
|
funct.head("HAproxy Logs")
|
||
|
funct.check_config()
|
||
7 years ago
|
funct.check_login()
|
||
7 years ago
|
funct.get_auto_refresh("HAproxy logs")
|
||
7 years ago
|
|
||
7 years ago
|
print('<table class="overview">'
|
||
7 years ago
|
'<tr class="overviewHead">'
|
||
7 years ago
|
'<td class="padding10 first-collumn">Server</td>'
|
||
7 years ago
|
'<td>Number rows</td>'
|
||
|
'<td class="padding10">Ex for grep</td>'
|
||
7 years ago
|
'<td> </td>'
|
||
7 years ago
|
'</tr>'
|
||
|
'<tr>'
|
||
7 years ago
|
'<td class="padding10 first-collumn">'
|
||
7 years ago
|
'<form action="logs.py" method="get">'
|
||
|
'<select autofocus required name="serv" id="serv">'
|
||
7 years ago
|
'<option disabled selected>Choose server</option>')
|
||
7 years ago
|
|
||
7 years ago
|
funct.choose_only_select(serv)
|
||
7 years ago
|
|
||
|
print('</select>')
|
||
|
|
||
7 years ago
|
if serv is not None:
|
||
7 years ago
|
rows = 'value='+form.getvalue('rows')
|
||
|
else:
|
||
|
rows = 'value=10'
|
||
|
|
||
|
if form.getvalue('grep') is not None:
|
||
|
grep = 'value='+form.getvalue('grep')
|
||
|
else:
|
||
7 years ago
|
grep = ' '
|
||
7 years ago
|
|
||
7 years ago
|
print('</td><td><input type="number" name="rows" id="rows" %s class="form-control" required></td>' % rows)
|
||
7 years ago
|
print('<td class="padding10 first-collumn"><input type="text" name="grep" id="grep" class="form-control" %s >' % grep)
|
||
7 years ago
|
print('</td>'
|
||
7 years ago
|
'<td class="padding10 first-collumn">'
|
||
7 years ago
|
'<a class="ui-button ui-widget ui-corner-all" id="show" title="Show logs" onclick="showLog()">Show</a>'
|
||
|
'</td>'
|
||
|
'</form>'
|
||
|
'</tr></table>'
|
||
7 years ago
|
'<div id="ajax">'
|
||
7 years ago
|
'</div>'
|
||
|
'<script>'
|
||
|
'window.onload = showLog()'
|
||
|
'</script>')
|
||
7 years ago
|
funct.footer()
|