| OLD | NEW |
| 1 <!DOCTYPE html><html><head><!-- | 1 <!DOCTYPE html><html><head><!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2016 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2016 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --><!-- | 9 --><!-- |
| 10 @license | 10 @license |
| (...skipping 14628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14639 (function(){ | 14639 (function(){ |
| 14640 // This behavior wraps up all the shared swarming functionality. | 14640 // This behavior wraps up all the shared swarming functionality. |
| 14641 SwarmingBehaviors.SwarmingBehavior = { | 14641 SwarmingBehaviors.SwarmingBehavior = { |
| 14642 | 14642 |
| 14643 _not: function(a) { | 14643 _not: function(a) { |
| 14644 return !a; | 14644 return !a; |
| 14645 }, | 14645 }, |
| 14646 | 14646 |
| 14647 _or: function() { | 14647 _or: function() { |
| 14648 var result = false; | 14648 var result = false; |
| 14649 // can't use .foreach, as arguments isn't really a function. | 14649 // can't use .foreach, as arguments isn't really an Array. |
| 14650 for (var i = 0; i < arguments.length; i++) { | 14650 for (var i = 0; i < arguments.length; i++) { |
| 14651 result = result || arguments[i]; | 14651 result = result || arguments[i]; |
| 14652 } | 14652 } |
| 14653 return result; | 14653 return result; |
| 14654 }, | 14654 }, |
| 14655 }; | 14655 }; |
| 14656 })(); | 14656 })(); |
| 14657 </script> | 14657 </script> |
| 14658 <dom-module id="swarming-index" assetpath="/res/imp/index/"> | 14658 <dom-module id="swarming-index" assetpath="/res/imp/index/"> |
| 14659 <template> | 14659 <template> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14836 } | 14836 } |
| 14837 }, | 14837 }, |
| 14838 | 14838 |
| 14839 _sortChange: function(e) { | 14839 _sortChange: function(e) { |
| 14840 // The event we get from sort-toggle tells us the name of what needs | 14840 // The event we get from sort-toggle tells us the name of what needs |
| 14841 // to be sorting and how to sort it. | 14841 // to be sorting and how to sort it. |
| 14842 if (!(e && e.detail && e.detail.name)) { | 14842 if (!(e && e.detail && e.detail.name)) { |
| 14843 return; | 14843 return; |
| 14844 } | 14844 } |
| 14845 // should trigger the computation of _sort and __filterAndSort | 14845 // should trigger the computation of _sort and __filterAndSort |
| 14846 this.set("_sortstr", e.detail.name +":"+e.detail.direction); | 14846 this.set("_sortstr", e.detail.name + ":" + e.detail.direction); |
| 14847 }, | 14847 }, |
| 14848 // _stripSpecial removes the special columns and sorts the remaining | 14848 // _stripSpecial removes the special columns and sorts the remaining |
| 14849 // columns so they always appear in the same order, regardless of | 14849 // columns so they always appear in the same order, regardless of |
| 14850 // the order they are added. | 14850 // the order they are added. |
| 14851 _stripSpecial: function(){ | 14851 _stripSpecial: function(){ |
| 14852 return this._columns.filter(function(c){ | 14852 return this._columns.filter(function(c) { |
| 14853 return this._specialColumns.indexOf(c) === -1; | 14853 return this._specialColumns.indexOf(c) === -1; |
| 14854 }.bind(this)).sort(); | 14854 }.bind(this)).sort(); |
| 14855 }, | 14855 }, |
| 14856 | 14856 |
| 14857 }; | 14857 }; |
| 14858 })(); | 14858 })(); |
| 14859 </script> | 14859 </script> |
| 14860 | 14860 |
| 14861 <script> | 14861 <script> |
| 14862 | 14862 |
| (...skipping 8781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23644 }, | 23644 }, |
| 23645 | 23645 |
| 23646 _bots: function(){ | 23646 _bots: function(){ |
| 23647 if (!this._list || !this._list.items) { | 23647 if (!this._list || !this._list.items) { |
| 23648 return []; | 23648 return []; |
| 23649 } | 23649 } |
| 23650 // Do any preprocessing here | 23650 // Do any preprocessing here |
| 23651 this._list.items.forEach(function(bot){ | 23651 this._list.items.forEach(function(bot){ |
| 23652 // Parse the state, which is a JSON string. This contains a lot of | 23652 // Parse the state, which is a JSON string. This contains a lot of |
| 23653 // interesting information like details about the devices attached. | 23653 // interesting information like details about the devices attached. |
| 23654 bot.state = bot.state || "{}"; |
| 23654 bot.state = JSON.parse(bot.state); | 23655 bot.state = JSON.parse(bot.state); |
| 23655 // get the disks in an easier to deal with format, sorted by size. | 23656 // get the disks in an easier to deal with format, sorted by size. |
| 23656 var disks = bot.state["disks"]; | 23657 var disks = bot.state.disks || {}; |
| 23657 var keys = Object.keys(disks); | 23658 var keys = Object.keys(disks); |
| 23658 if (!keys || !keys.length) { | 23659 if (!keys.length) { |
| 23659 bot.disks = [{"id": "unknown", "mb": 0}]; | 23660 bot.disks = [{"id": "unknown", "mb": 0}]; |
| 23660 } else { | 23661 } else { |
| 23661 bot.disks = []; | 23662 bot.disks = []; |
| 23662 for (var i = 0; i < keys.length; i++) { | 23663 for (var i = 0; i < keys.length; i++) { |
| 23663 bot.disks.push({"id":keys[i], "mb":disks[keys[i]].free_mb}); | 23664 bot.disks.push({"id":keys[i], "mb":disks[keys[i]].free_mb}); |
| 23664 } | 23665 } |
| 23665 // Sort these so the biggest disk comes first. | 23666 // Sort these so the biggest disk comes first. |
| 23666 bot.disks.sort(function(a, b) { | 23667 bot.disks.sort(function(a, b) { |
| 23667 return b.mb - a.mb; | 23668 return b.mb - a.mb; |
| 23668 }); | 23669 }); |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 24299 if (data && data.task_id) { | 24300 if (data && data.task_id) { |
| 24300 return "/user/task/" + data.task_id; | 24301 return "/user/task/" + data.task_id; |
| 24301 } | 24302 } |
| 24302 return undefined; | 24303 return undefined; |
| 24303 } | 24304 } |
| 24304 | 24305 |
| 24305 }); | 24306 }); |
| 24306 })(); | 24307 })(); |
| 24307 </script> | 24308 </script> |
| 24308 </dom-module></div></body></html> | 24309 </dom-module></div></body></html> |
| OLD | NEW |