Cleaned up eibi/repeaterbook status display.

This commit is contained in:
Marat Fayzullin 2025-01-12 12:42:14 -05:00
parent e1bd2cd7c4
commit 7e427a6a80
1 changed files with 8 additions and 6 deletions

View File

@ -32,8 +32,10 @@ class ServiceController(AuthorizationMixin, WebpageController):
<th>Frequency</th> <th>Frequency</th>
</tr> </tr>
{services} {services}
<tr>
<td colspan=3>{status}</td>
</tr>
</table> </table>
{status}
""".format( """.format(
services="".join(ServiceController.renderService(c) for c in Services.listAll()), services="".join(ServiceController.renderService(c) for c in Services.listAll()),
status=ServiceController.renderStatus() status=ServiceController.renderStatus()
@ -45,16 +47,16 @@ class ServiceController(AuthorizationMixin, WebpageController):
ts = Repeaters.lastDownloaded() ts = Repeaters.lastDownloaded()
if ts > 0: if ts > 0:
ts = datetime.fromtimestamp(ts).strftime("%H:%M:%S, %m/%d/%Y") ts = datetime.fromtimestamp(ts).strftime("%H:%M:%S, %m/%d/%Y")
result += "<div style='color:#00FF00;width:100%;text-align:center;'>Repeaters database downloaded at {0}.</div>\n".format(ts) result += "<div style='color:#00FF00;text-align:center;'>Repeaters database downloaded at {0}.</div>\n".format(ts)
else: else:
result += "<div style='color:#FF0000;width:100%;text-align:center;'>Repeaters database not downloaded.</div>\n" result += "<div style='color:#FF0000;text-align:center;'>Repeaters database not downloaded.</div>\n"
ts = EIBI.lastDownloaded() ts = EIBI.lastDownloaded()
if ts > 0: if ts > 0:
ts = datetime.fromtimestamp(ts).strftime("%H:%M:%S, %m/%d/%Y") ts = datetime.fromtimestamp(ts).strftime("%H:%M:%S, %m/%d/%Y")
result += "<div style='color:#00FF00;width:100%;text-align:center;'>Shortwave schedule downloaded at {0}.</div>\n".format(ts) result += "<div style='color:#00FF00;text-align:center;'>Shortwave schedule downloaded at {0}.</div>\n".format(ts)
else: else:
result += "<div style='color:#FF0000;width:100%;text-align:center;'>Shortwave schedule not downloaded.</div>\n" result += "<div style='color:#FF0000;text-align:center;'>Shortwave schedule not downloaded.</div>\n"
return "<p style='width:100%;'>\n" + result + "</p>\n" return result
@staticmethod @staticmethod
def renderService(c): def renderService(c):