mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 01:04:33 +00:00
Fix a bug where the "last updated time"/"last spot time" of providers that have never updated would be sent as a large negative number and represented on the web UI as e.g. "2026 years ago".
This commit is contained in:
@@ -22,14 +22,14 @@ function loadStatus() {
|
||||
jsonData["spot_providers"].forEach(p => {
|
||||
$("#status-container").append(generateStatusCard("Spot Provider: " + p["name"], [
|
||||
`Status: ${p["status"]}`,
|
||||
`Last Updated: ${p["enabled"] ? moment.unix(p["last_updated"]).utc().fromNow() : "N/A"}`,
|
||||
`Latest Spot: ${p["enabled"] ? moment.unix(p["last_spot"]).utc().fromNow() : "N/A"}`
|
||||
`Last Updated: ${(p["enabled"] && p["last_updated"] > 0) ? moment.unix(p["last_updated"]).utc().fromNow() : "N/A"}`,
|
||||
`Latest Spot: ${(p["enabled"] && p["last_spot"] > 0) ? moment.unix(p["last_spot"]).utc().fromNow() : "N/A"}`
|
||||
]));
|
||||
});
|
||||
jsonData["alert_providers"].forEach(p => {
|
||||
$("#status-container").append(generateStatusCard("Alert Provider: " + p["name"], [
|
||||
`Status: ${p["status"]}`,
|
||||
`Last Updated: ${p["enabled"] ? moment.unix(p["last_updated"]).utc().fromNow() : "N/A"}`
|
||||
`Last Updated: ${(p["enabled"] && p["last_updated"] > 0) ? moment.unix(p["last_updated"]).utc().fromNow() : "N/A"}`
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user