[minor] small adjustments

This commit is contained in:
Marcel Paffrath 2023-04-19 16:15:03 +02:00
parent fb4d5c2929
commit 72e3ede52f
3 changed files with 14 additions and 5 deletions

View File

@ -128,7 +128,7 @@ add_global_links:
- {"text": "show recent events on map", - {"text": "show recent events on map",
"URL": "https://fdsnws.geophysik.ruhr-uni-bochum.de/map/?lat=39.5&lon=21&zoom=7&baselayer=mapnik"} "URL": "https://fdsnws.geophysik.ruhr-uni-bochum.de/map/?lat=39.5&lon=21&zoom=7&baselayer=mapnik"}
# html logo at page bottom # html logo at page bottom (path relative to html directory)
html_logo: "figures/Logo_RUB_BLAU_rgb.png" html_logo: "figures/Logo_RUB_BLAU_rgb.png"
# E-mail notifications # E-mail notifications

View File

@ -503,12 +503,21 @@ class SurveillanceBot(object):
outfile.write(finish_html_table()) outfile.write(finish_html_table())
# add optional links below html table
for dct in self.add_global_links: for dct in self.add_global_links:
link_str = get_html_link(dct.get('text'), dct.get('URL')) link_str = get_html_link(dct.get('text'), dct.get('URL'))
outfile.write(get_html_text(link_str)) outfile.write(get_html_text(link_str))
# add status message
outfile.write(get_html_text(self.status_message)) outfile.write(get_html_text(self.status_message))
outfile.write(html_footer(footer_logo=self.parameters.get('html_logo')))
# write footer with optional logo
logo_file = self.parameters.get('html_logo')
if not os.path.isfile(logo_file):
print(f'Specified file {logo_file} not found.')
logo_file = None
outfile.write(html_footer(footer_logo=logo_file))
except Exception as e: except Exception as e:
print(f'Could not write HTML table to {fnout}:') print(f'Could not write HTML table to {fnout}:')

View File

@ -35,10 +35,10 @@ def get_bg_color(check_key, status, dt_thresh=None, hex=False):
def get_color(key): def get_color(key):
# some GUI default colors # some GUI default colors
colors_dict = {'FAIL': (255, 50, 0, 255), colors_dict = {'FAIL': (255, 85, 50, 255),
'NO DATA': (255, 255, 125, 255), 'NO DATA': (255, 255, 125, 255),
'WARN': (255, 255, 80, 255), 'WARN': (255, 255, 80, 255),
'OK': (125, 255, 125, 255), 'OK': (173, 255, 133, 255),
'undefined': (230, 230, 230, 255), 'undefined': (230, 230, 230, 255),
'disc': (255, 160, 40, 255),} 'disc': (255, 160, 40, 255),}
return colors_dict.get(key) return colors_dict.get(key)
@ -60,7 +60,7 @@ def get_time_delay_color(dt, dt_thresh):
def get_warn_color(count): def get_warn_color(count):
color = (min([255, 200 + count ** 2]), 255, 80, 255) color = (min([255, 220 + count ** 2]), 255, 80, 255)
return color return color