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

Side by Side Diff: appengine/swarming/elements/res/imp/botlist/bot-list-shared.html

Issue 2204483002: Add UI to new botlist to show summary (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@bot-summary-api
Patch Set: Add docs Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 5
6 window.SwarmingBehaviors.BotListBehavior contains any shared functions and 6 window.SwarmingBehaviors.BotListBehavior contains any shared functions and
7 constants used by the bot-list and its sub-elements. 7 constants used by the bot-list and its sub-elements.
8 8
9 To use it, include 9 To use it, include
10 behaviors: [SwarmingBehaviors.BotListBehavior] 10 behaviors: [SwarmingBehaviors.BotListBehavior]
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 _gpuAlias: function(gpu) { 126 _gpuAlias: function(gpu) {
127 var a = GPU_ALIASES[gpu]; 127 var a = GPU_ALIASES[gpu];
128 if (!a) { 128 if (!a) {
129 return "UNKNOWN"; 129 return "UNKNOWN";
130 } 130 }
131 return a; 131 return a;
132 }, 132 },
133 133
134 _not: function(a) { 134 _not: function(a) {
135 return a; 135 return !a;
136 },
137
138 _or: function() {
139 var result = false;
140 // can't use .foreach, as arguments isn't really a function.
141 for (var i = 0; i < arguments.length; i++) {
142 result = result || arguments[i];
143 }
144 return result;
136 }, 145 },
137 146
138 _taskId: function(bot) { 147 _taskId: function(bot) {
139 if (bot && bot.task_id) { 148 if (bot && bot.task_id) {
140 return bot.task_id; 149 return bot.task_id;
141 } 150 }
142 return "idle"; 151 return "idle";
143 }, 152 },
144 153
145 // _unalias will return the base dimension/state with its alias removed 154 // _unalias will return the base dimension/state with its alias removed
146 // if it had one. This is handy for sorting and filtering. 155 // if it had one. This is handy for sorting and filtering.
147 _unalias: function(str) { 156 _unalias: function(str) {
148 var match = ALIAS_REGEXP.exec(str); 157 var match = ALIAS_REGEXP.exec(str);
149 if (match) { 158 if (match) {
150 return match[1]; 159 return match[1];
151 } 160 }
152 return str; 161 return str;
153 }, 162 },
154 } 163 }
155 })() 164 })()
156 </script> 165 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698