diff --git a/app/create_db.py b/app/create_db.py index e178be88..993b1413 100644 --- a/app/create_db.py +++ b/app/create_db.py @@ -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
") 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
") - 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
") + #print("DB was update to 2.8
") return True cur.close() con.close() diff --git a/app/options.py b/app/options.py index 19669cb4..0b2826b3 100644 --- a/app/options.py +++ b/app/options.py @@ -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") diff --git a/app/templates/metrics.html b/app/templates/metrics.html index fe3a60a7..5694f202 100644 --- a/app/templates/metrics.html +++ b/app/templates/metrics.html @@ -3,6 +3,7 @@
diff --git a/app/templates/viewstats.html b/app/templates/viewstats.html index ae8d1116..a742987b 100644 --- a/app/templates/viewstats.html +++ b/app/templates/viewstats.html @@ -15,7 +15,7 @@ Show
-
+