Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: appengine/swarming/ui/res/imp/botpage/device-summary.html

Issue 2778773002: Fix device summary when state not fully formed (Closed)
Patch Set: Fix device summary when state not fully formed: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/ui/res/imp/botpage/device-summary.html
diff --git a/appengine/swarming/ui/res/imp/botpage/device-summary.html b/appengine/swarming/ui/res/imp/botpage/device-summary.html
index 3725c51747ca3ab10ffa4cee6f547bbc56c93449..0e606f7db029e93a91c94ba53d01e360493c8218 100644
--- a/appengine/swarming/ui/res/imp/botpage/device-summary.html
+++ b/appengine/swarming/ui/res/imp/botpage/device-summary.html
@@ -101,11 +101,12 @@
var d = this.state.devices[id];
var device = {
id: id,
- battery: d.battery.level,
- state: d.state,
+ state: d.state || "???",
};
+ device.battery = (d.battery && d.battery.level) || "???"
var count = 0;
var totalTemp = 0;
+ d.temp = d.temp || [];
for (var t in d.temp) {
totalTemp += parseFloat(d.temp[t]);
count++;
@@ -113,6 +114,8 @@
// Report the average temperature of all sensors.
if (count) {
device.temp = (totalTemp/count).toFixed(1);
+ } else {
+ device.temp == "???";
}
arr.push(device);
}
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698