Compare commits
No commits in common. "a905386ee817c4783052604428dc9344d1092240" and "206af05f2606c0178a3702536a3275b1869169a0" have entirely different histories.
a905386ee8
...
206af05f26
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__version__ = '0.3.1'
|
__version__ = '0.3'
|
||||||
__author__ = ['Marcel Paffrath <marcel.paffrath@rub.de>', 'Kasper D. Fischer <kasper.fischer@rub.de>']
|
__author__ = ['Marcel Paffrath <marcel.paffrath@rub.de>', 'Kasper D. Fischer <kasper.fischer@rub.de>']
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@ -551,8 +551,7 @@ class SurveillanceBot(object):
|
|||||||
|
|
||||||
def update_status_message(self):
|
def update_status_message(self):
|
||||||
timespan = timedelta(seconds=int(self.parameters.get('timespan') * 24 * 3600))
|
timespan = timedelta(seconds=int(self.parameters.get('timespan') * 24 * 3600))
|
||||||
self.status_message = f' Version {__version__} | ' \
|
self.status_message = f'Program starttime (UTC) {self.starttime.strftime("%Y-%m-%d %H:%M:%S")} | ' \
|
||||||
f'Program start time (UTC) {self.starttime.strftime("%Y-%m-%d %H:%M:%S")} | ' \
|
|
||||||
f'Current time (UTC) {UTCDateTime().strftime("%Y-%m-%d %H:%M:%S")} | ' \
|
f'Current time (UTC) {UTCDateTime().strftime("%Y-%m-%d %H:%M:%S")} | ' \
|
||||||
f'Refresh period: {self.refresh_period}s | ' \
|
f'Refresh period: {self.refresh_period}s | ' \
|
||||||
f'Showing data of last {timespan}'
|
f'Showing data of last {timespan}'
|
||||||
|
@ -17,7 +17,7 @@ def get_html_text(text):
|
|||||||
|
|
||||||
def get_html_header(refresh_rate=10):
|
def get_html_header(refresh_rate=10):
|
||||||
header = ['<!DOCTYPE html>',
|
header = ['<!DOCTYPE html>',
|
||||||
'<html lang="en">',
|
'<html>',
|
||||||
'<head>',
|
'<head>',
|
||||||
' <title>SurvBot status</title>',
|
' <title>SurvBot status</title>',
|
||||||
' <link rel="stylesheet" media="only screen and (max-width: 400px)" href="mobile.css">',
|
' <link rel="stylesheet" media="only screen and (max-width: 400px)" href="mobile.css">',
|
||||||
@ -26,7 +26,7 @@ def get_html_header(refresh_rate=10):
|
|||||||
' <meta charset="utf-8">',
|
' <meta charset="utf-8">',
|
||||||
' <meta name="viewport" content="width=device-width, initial-scale=1">',
|
' <meta name="viewport" content="width=device-width, initial-scale=1">',
|
||||||
'</head>',
|
'</head>',
|
||||||
'<body>\n']
|
'<body>']
|
||||||
header = _convert_to_textstring(header)
|
header = _convert_to_textstring(header)
|
||||||
return header
|
return header
|
||||||
|
|
||||||
@ -86,14 +86,8 @@ def get_html_row(items, html_key='td'):
|
|||||||
text_str = get_html_link(text, hyperlink) if hyperlink else text
|
text_str = get_html_link(text, hyperlink) if hyperlink else text
|
||||||
html_class = item.get('html_class')
|
html_class = item.get('html_class')
|
||||||
class_str = f' class="{html_class}"' if html_class else ''
|
class_str = f' class="{html_class}"' if html_class else ''
|
||||||
row_string += 2 * default_space + f'<{html_key}{class_str} '
|
row_string += 2 * default_space + f'<{html_key}{class_str} bgcolor="{color}" title="{tooltip}"' \
|
||||||
row_string += f'title="{tooltip}" ' if tooltip else ''
|
+ f'style="color:{font_color}">{text_str}</{html_key}>\n'
|
||||||
row_string += 'style="' if color or font_color else ''
|
|
||||||
row_string += f'background-color: {color};' if color else 'style="'
|
|
||||||
row_string += ' ' if font_color else ''
|
|
||||||
row_string += f'color: {font_color};' if font_color else ''
|
|
||||||
row_string += '" ' if color or font_color else ''
|
|
||||||
row_string += f'>{text_str}</{html_key}>\n'
|
|
||||||
row_string += default_space + '</tr>\n'
|
row_string += default_space + '</tr>\n'
|
||||||
return row_string
|
return row_string
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user