[new] add logo on html webpage

This commit is contained in:
Marcel Paffrath 2023-04-19 14:59:45 +02:00
parent acc8575d70
commit 1983cc3b1e
3 changed files with 13 additions and 4 deletions

View File

@ -128,6 +128,9 @@ add_global_links:
- {"text": "show recent events on map",
"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: "figures/Logo_RUB_BLAU_rgb.png"
# E-mail notifications
EMAIL:
mailserver: "localhost"

View File

@ -508,7 +508,7 @@ class SurveillanceBot(object):
outfile.write(get_html_text(link_str))
outfile.write(get_html_text(self.status_message))
outfile.write(html_footer())
outfile.write(html_footer(footer_logo=self.parameters.get('html_logo')))
except Exception as e:
print(f'Could not write HTML table to {fnout}:')

View File

@ -47,9 +47,15 @@ def finish_html_table():
return '</table>\n'
def html_footer():
footer = ['</body>',
'</html>\n']
def html_footer(footer_logo=None):
footer = ['</body>']
if footer_logo:
logo_items = [f'<div class="footer">',
f' <img style="float: right; padding: 10px;" src="{footer_logo}" height=30px>',
f'</div>']
footer += logo_items
footer.append('</html>\n')
footer = _convert_to_textstring(footer)
return footer