Added server start time and time deltas display.
This commit is contained in:
parent
34de9145e6
commit
bc12058ce5
|
|
@ -43,21 +43,26 @@ class ServiceController(AuthorizationMixin, WebpageController):
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def renderStatus():
|
def renderTime(ts):
|
||||||
result = ""
|
ts = datetime.fromtimestamp(ts)
|
||||||
ts = datetime.fromtimestamp(EIBI.lastStarted())
|
|
||||||
td = str(datetime.now() - ts).split(".", 1)[0]
|
td = str(datetime.now() - ts).split(".", 1)[0]
|
||||||
ts = ts.astimezone().strftime("%H:%M:%S %Z, %d %b %Y")
|
ts = ts.astimezone().strftime("%H:%M:%S %Z, %d %b %Y")
|
||||||
result += "<div style='color:#00FF00;text-align:center;'>Server started at {0}, {1} ago.</div>\n".format(ts, td)
|
return ts + ", " + td + " ago"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def renderStatus():
|
||||||
|
result = ""
|
||||||
|
ts = ServiceController.renderTime(EIBI.lastStarted())
|
||||||
|
result += "<div style='color:#00FF00;text-align:center;'>Server started at {0}.</div>\n".format(ts)
|
||||||
ts = EIBI.lastDownloaded()
|
ts = EIBI.lastDownloaded()
|
||||||
if ts > 0:
|
if ts > 0:
|
||||||
ts = datetime.fromtimestamp(ts).astimezone().strftime("%H:%M:%S %Z, %d %b %Y")
|
ts = ServiceController.renderTime(ts)
|
||||||
result += "<div style='color:#00FF00;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;text-align:center;'>Shortwave schedule not downloaded.</div>\n"
|
result += "<div style='color:#FF0000;text-align:center;'>Shortwave schedule not downloaded.</div>\n"
|
||||||
ts = Repeaters.lastDownloaded()
|
ts = Repeaters.lastDownloaded()
|
||||||
if ts > 0:
|
if ts > 0:
|
||||||
ts = datetime.fromtimestamp(ts).astimezone().strftime("%H:%M:%S %Z, %d %b %Y")
|
ts = ServiceController.renderTime(ts)
|
||||||
result += "<div style='color:#00FF00;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;text-align:center;'>Repeaters database not downloaded.</div>\n"
|
result += "<div style='color:#FF0000;text-align:center;'>Repeaters database not downloaded.</div>\n"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue