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

Unified Diff: appengine/swarming/ui/res/imp/botlist/bot-list.html

Issue 2988773002: Fix sorting of status to account for time bot has been dead. (Closed)
Patch Set: Rebuild Created 3 years, 5 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') | appengine/swarming/ui/res/imp/common/swarming-app.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/ui/res/imp/botlist/bot-list.html
diff --git a/appengine/swarming/ui/res/imp/botlist/bot-list.html b/appengine/swarming/ui/res/imp/botlist/bot-list.html
index 6d59fc544c6b1e14217c53be6cd89462f1b2dda0..4651c7f851db8cd1d159c43b8c779c4bc1076214 100644
--- a/appengine/swarming/ui/res/imp/botlist/bot-list.html
+++ b/appengine/swarming/ui/res/imp/botlist/bot-list.html
@@ -337,6 +337,12 @@
}
return bot.state.temp.average || UNKNOWN;
},
+ cpu: function(bot) {
+ if (this._verbose) {
+ return this._attribute(bot, "cpu", "none").join(" | ");
+ }
+ return swarming.longest(this._attribute(bot, "cpu", "none"));
+ },
device_temperature: function(){
return "";
},
@@ -406,7 +412,7 @@
// If a bot is both dead and quarantined, show the deadness over the
// quarentinedness.
if (bot.is_dead) {
- return "Dead. Last seen " + sk.human.diffDate(bot.last_seen_ts) +
+ return "Dead. Last seen " + sk.human.diffDate(bot.last_seen_ts) +
" ago";
}
if (bot.quarantined) {
@@ -568,6 +574,30 @@
var botBCol = this._state(botB, "running_time") || 0;
return dir * naturalSort(botACol, botBCol)
},
+ status: function(dir, botA, botB) {
+ // Case 1: One of the bots is dead, sort dead bot over alive/quarantined bot.
+ if (botA.is_dead !== botB.is_dead) {
+ if (botA.is_dead) {
+ return dir;
+ } else {
+ return -dir;
+ }
+ }
+ // Case 2: Bots match on deadness, quarantinedness, or aliveness
+ // In this case, sort by last seen time.
+ if (botA.is_dead && botB.is_dead ||
+ botA.quarantined && botB.quarantined ||
+ !botA.is_dead && !botB.is_dead && !botA.quarantined && !botB.quarantined ) {
+ var botACol = botA.last_seen_ts;
+ var botBCol = botB.last_seen_ts;
+ return dir * naturalSort(botACol, botBCol)
+ }
+ // Case 3: One of the bots is quarantined. Sort quarantined bot over alive bot.
+ if (botA.quarantined) {
+ return dir;
+ }
+ return -dir;
+ },
uptime: function(dir, botA, botB) {
var botACol = this._state(botA, "uptime") || 0;
var botBCol = this._state(botB, "uptime") || 0;
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/common/swarming-app.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698