2018-01-15 06:16:04 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import html
|
|
|
|
import cgi
|
|
|
|
import requests
|
|
|
|
import funct
|
2018-04-16 07:01:44 +00:00
|
|
|
import sql
|
2018-04-21 14:40:59 +00:00
|
|
|
from configparser import ConfigParser, ExtendedInterpolation
|
2018-01-15 06:16:04 +00:00
|
|
|
from requests_toolbelt.utils import dump
|
|
|
|
|
2018-02-07 04:39:42 +00:00
|
|
|
print("Content-type: text/html\n")
|
2018-01-15 06:16:04 +00:00
|
|
|
|
|
|
|
form = cgi.FieldStorage()
|
|
|
|
serv = form.getvalue('serv')
|
|
|
|
|
|
|
|
if serv is None:
|
2018-04-16 07:01:44 +00:00
|
|
|
first_serv = sql.get_dick_permit()
|
|
|
|
for i in first_serv:
|
|
|
|
serv = i[2]
|
|
|
|
break
|
|
|
|
|
|
|
|
print('<a name="top"></a><div class="container">')
|
|
|
|
|
|
|
|
funct.get_auto_refresh("HAproxy statistics")
|
|
|
|
|
|
|
|
print('<br />'
|
|
|
|
'<form style="padding-left: 20px;" action="viewsttats.py" method="get">'
|
|
|
|
'<select autofocus required name="serv" id="serv">'
|
|
|
|
'<option disabled>Choose server</option>')
|
|
|
|
|
2018-05-02 11:11:22 +00:00
|
|
|
funct.choose_only_select(serv, virt=1)
|
2018-04-16 07:01:44 +00:00
|
|
|
|
|
|
|
print('</select>'
|
|
|
|
'<a class="ui-button ui-widget ui-corner-all" id="show" title="Show stats" onclick="showStats()">Show</a>'
|
2018-04-21 14:40:59 +00:00
|
|
|
'</form>'
|
|
|
|
'<div id="ajax" style="margin-left: 10px;"></div>')
|
2018-04-09 10:27:01 +00:00
|
|
|
|
2018-02-07 04:39:42 +00:00
|
|
|
funct.head("Stats HAproxy configs")
|
2018-04-21 14:40:59 +00:00
|
|
|
print('</div><script> window.onload = showStats()</script>')
|
2018-04-16 07:01:44 +00:00
|
|
|
funct.footer()
|