Bugs
pull/30/head
Aidaho12 2018-08-04 20:44:09 +06:00
parent 71e3a99fc6
commit 2cc270859f
4 changed files with 7 additions and 24 deletions

View File

@ -449,30 +449,10 @@ def update_db_v_2_8(**kwargs):
print("An error occurred:", e.args[0])
return False
else:
print("DB was update to 2.8<br />")
return True
cur.close()
con.close()
def update_db_v_2_8(**kwargs):
con, cur = get_cur()
sql = """CREATE TABLE IF NOT EXISTS `metrics` (`serv` varchar(64), curr_con INTEGER, cur_ssl_con INTEGER, sess_rate INTEGER, max_sess_rate INTEGER,`date` DATETIME default '0000-00-00 00:00:00'); """
try:
cur.execute(sql)
con.commit()
except sqltool.Error as e:
if kwargs.get('silent') != 1:
if e.args[0] == 'duplicate column name: token' or e == "1060 (42S21): Duplicate column name 'token' ":
print('Updating... go to version 2.6')
else:
print("An error occurred:", e.args[0])
return False
else:
print("DB was update to 2.8<br />")
return True
cur.close()
con.close()
def update_db_v_2_8_2(**kwargs):
con, cur = get_cur()
sql = """ ALTER TABLE `servers` ADD COLUMN metrics INTEGER NOT NULL DEFAULT 0 """
@ -484,10 +464,10 @@ def update_db_v_2_8_2(**kwargs):
if e.args[0] == 'duplicate column name: metrics' or e == "1060 (42S21): Duplicate column name 'metrics' ":
print('DB was update to 2.8. It\' last version')
else:
print("An error occurred:", e.args[0])
print("An error occurred:", e)
return False
else:
print("DB was update to 2.8<br />")
#print("DB was update to 2.8<br />")
return True
cur.close()
con.close()

View File

@ -415,6 +415,7 @@ if form.getvalue('metrics'):
p[serv].y_range.start = 0
p[serv].y_range.end = int(df['max_sess_rate'].max()) + 100
p[serv].add_tools(hover)
p[serv].title.text_font_size = "20px"
p[serv].line("Date", "curr_con", source=source, alpha=0.5, color='#5cb85c', line_width=2, legend="Conn")
p[serv].line("Date", "curr_ssl_con", source=source, alpha=0.5, color="#5d9ceb", line_width=2, legend="SSL con")

View File

@ -3,6 +3,7 @@
<style>
iframe {
border: none;
padding: 10px;
}
</style>
<div id="metrics_iframe"></div>

View File

@ -15,7 +15,7 @@
<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>
<div id="ajax" style="margin-left: 20px; margin-right: 5px;"></div>
<script>
window.onload = showStats();
function sleep(ms) {
@ -27,6 +27,7 @@
$( "input[type=submit], button" ).button();
$('li').css('margin-top', '0');
$('table.tbl th.pxname').css('background-color', '#5d9ceb');
$('table.tbl th.pxname').css('width', '100%');
$('a.px:link').css('color', '#fff');
$('h1').css('display', 'none');
$('h1').next().css('display', 'none');