Skip to content

Commit

Permalink
Merge branch 'ManuelMcLure-fixmissingtr' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
kantlivelong committed Sep 28, 2021
2 parents b032187 + 3164d28 commit 6336854
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions octoprint_ups/static/js/ups.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ $(function() {
status_text = "Offline";
}

content += "<td>Status</td><td>" + status_text + "</td></tr>"
content += "<tr><td>Status</td><td>" + status_text + "</td></tr>"

if (status_text != "Offline") {
if (self.vars().hasOwnProperty('battery.charge')) {
content += "<td>Charge</td><td>" + parseInt(self.vars()["battery.charge"]) + "%</td></tr>"
content += "<tr><td>Charge</td><td>" + parseInt(self.vars()["battery.charge"]) + "%</td></tr>"
}

if (self.vars().hasOwnProperty('battery.runtime')) {
content += "<td>Runtime</td><td>" + parseInt(self.vars()["battery.runtime"]) / 60 + " min</td></tr>"
content += "<tr><td>Runtime</td><td>" + parseInt(self.vars()["battery.runtime"]) / 60 + " min</td></tr>"
}
}
/*
Expand Down

0 comments on commit 6336854

Please sign in to comment.