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

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

Issue 2768553002: Add Device errors to bot-list status (Closed)
Patch Set: Remove extra if 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 unified diff | Download patch
« no previous file with comments | « appengine/swarming/ui/res/imp/botlist/bot-list.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21 matching lines...) Expand all
32 32
33 // _attribute looks first in dimension and then in state for the 33 // _attribute looks first in dimension and then in state for the
34 // specified attribute. This will always return an array. If there is 34 // specified attribute. This will always return an array. If there is
35 // no matching attribute, ["unknown"] will be returned. 35 // no matching attribute, ["unknown"] will be returned.
36 _attribute: function(bot, attr, none) { 36 _attribute: function(bot, attr, none) {
37 none = none || UNKNOWN; 37 none = none || UNKNOWN;
38 return this._dimension(bot, attr) || this._state(bot, attr) || [none]; 38 return this._dimension(bot, attr) || this._state(bot, attr) || [none];
39 }, 39 },
40 40
41 _devices: function(bot) { 41 _devices: function(bot) {
42 return bot.state.devices; 42 return bot.state.devices || [];
43 }, 43 },
44 44
45 // _deviceType returns the codename of a given Android device. 45 // _deviceType returns the codename of a given Android device.
46 _deviceType: function(device) { 46 _deviceType: function(device) {
47 return device.device_type.toLowerCase(); 47 return device.device_type.toLowerCase();
48 }, 48 },
49 49
50 // _dimension returns the given dimension of a bot. If it is defined, it 50 // _dimension returns the given dimension of a bot. If it is defined, it
51 // is an array of strings. 51 // is an array of strings.
52 _dimension: function(bot, dim) { 52 _dimension: function(bot, dim) {
(...skipping 25 matching lines...) Expand all
78 _taskId: function(bot) { 78 _taskId: function(bot) {
79 if (bot && bot.task_id) { 79 if (bot && bot.task_id) {
80 return bot.task_id; 80 return bot.task_id;
81 } 81 }
82 return "idle"; 82 return "idle";
83 }, 83 },
84 84
85 }]; 85 }];
86 })() 86 })()
87 </script> 87 </script>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/res/imp/botlist/bot-list.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698