| -  })(); </script> </dom-module><dom-module id="task-page-data" assetpath="/res/imp/taskpage/"> <script>!function(){var t,e=400;Polymer({is:"task-page-data",behaviors:[SwarmingBehaviors.CommonBehavior],properties:{auth_headers:{type:Object},task_id:{type:String},busy:{type:Boolean,computed:"_or(_busy1,_busy2,_busy3)",notify:!0},request:{type:Object,computed:"_parseRequest(_request)",notify:!0},result:{type:Array,computed:"_parseResult(_result)",notify:!0},stdout:{type:String,computed:"_parseStdout(_stdout)",notify:!0},_busy1:{type:Boolean,value:!1},_busy2:{type:Boolean,value:!1},_busy3:{type:Boolean,value:!1},_request:{type:Object},_result:{type:Object},_stdout:{type:Object}},observers:["reload(auth_headers,task_id)"],reload:function(){return this.task_id&&this.auth_headers?(t&&this.cancelAsync(t),void(t=this.async(function(){t=void 0;var e="/_ah/api/swarming/v1/task/"+this.task_id;this._getJsonAsync("_request",e+"/request","_busy1",this.auth_headers),this._getJsonAsync("_result",e+"/result?include_performance_stats=true","_busy2",this.auth_headers),this._getJsonAsync("_stdout",e+"/stdout","_busy3",this.auth_headers)},e))):void console.log("task_id and auth_headers can't be empty")},_parseRequest:function(t){return console.log(t),t?t:{}},_parseResult:function(t){return console.log(t),t?t:{}},_parseStdout:function(t){return console.log(t),t&&t.output?t.output:""}})}()</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskpage/"> <template> <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-style"></style> <url-param name="id" value="{{task_id}}"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" signed_in="{{_signed_in}}" busy="[[_busy]]" name="Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-page-data auth_headers="[[_auth_headers]]" task_id="[[task_id]]" busy="{{_busy}}" request="{{_request}}" result="{{_result}}" stdout="{{_stdout}}"> </task-page-data> <h1>Task Page Stub</h1> </div> </swarming-app> </template> <script>!function(){Polymer({is:"task-page",behaviors:[SwarmingBehaviors.CommonBehavior],properties:{task_id:{type:String},client_id:{type:String}}})}()</script> </dom-module></div></body></html> | 
| +  })(); </script> </dom-module><dom-module id="task-page-data" assetpath="/res/imp/taskpage/"> <script>!function(){var t,e=400,s=["abandoned_ts","completed_ts","created_ts","modified_ts","started_ts"];Polymer({is:"task-page-data",behaviors:[SwarmingBehaviors.CommonBehavior],properties:{auth_headers:{type:Object},task_id:{type:String},busy:{type:Boolean,computed:"_or(_busy1,_busy2,_busy3)",notify:!0},request:{type:Object,computed:"_parseRequest(_request)",notify:!0},result:{type:Object,computed:"_parseResult(_result)",notify:!0},stdout:{type:String,computed:"_parseStdout(_stdout)",notify:!0},_busy1:{type:Boolean,value:!1},_busy2:{type:Boolean,value:!1},_busy3:{type:Boolean,value:!1},_request:{type:Object},_result:{type:Object},_stdout:{type:Object}},observers:["reload(auth_headers,task_id)"],reload:function(){return this.task_id&&this.auth_headers?(t&&this.cancelAsync(t),void(t=this.async(function(){t=void 0;var e="/_ah/api/swarming/v1/task/"+this.task_id;this._getJsonAsync("_request",e+"/request","_busy1",this.auth_headers),this._getJsonAsync("_result",e+"/result?include_performance_stats=true","_busy2",this.auth_headers),this._getJsonAsync("_stdout",e+"/stdout","_busy3",this.auth_headers)},e))):void console.log("task_id and auth_headers can't be empty")},_parseRequest:function(t){return t?(t.tagMap={},t.tags=t.tags||[],t.tags.forEach(function(e){var s=e.split(":",1),a=s[0],n=e.substring(a.length+1);t.tagMap[a]=n}),s.forEach(function(e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),t.properties=t.properties||{},t.properties.dimensions&&t.properties.dimensions.forEach(function(t){swarming.alias.has(t.key)&&(t.value=swarming.alias.apply(t.value,t.key))}),t):{}},_parseResult:function(t){if(!t)return{};var e=new Date;return s.forEach(function(e){t[e]&&(t[e]=new Date(t[e]),t["human_"+e]=sk.human.localeTime(t[e]))}),!t.duration&&"RUNNING"===t.state&&t.started_ts&&(t.duration=(e-t.started_ts)/1e3),t.duration&&(t.human_duration=this._humanDuration(t.duration)),t.bot_dimensions&&t.bot_dimensions.forEach(function(t){swarming.alias.has(t.key)&&t.value.forEach(function(e,s){t.value[s]=swarming.alias.apply(e,t.key)})}),t},_parseStdout:function(t){return t&&t.output?t.output:""}})}()</script> </dom-module><dom-module id="task-page" assetpath="/res/imp/taskpage/"> <template> <style include="iron-flex iron-flex-alignment iron-positioning swarming-app-style"></style> <url-param name="id" value="{{task_id}}"> </url-param> <swarming-app client_id="[[client_id]]" auth_headers="{{_auth_headers}}" signed_in="{{_signed_in}}" busy="[[_busy]]" name="Swarming Task Page"> <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> <div hidden$="[[_not(_signed_in)]]"> <task-page-data auth_headers="[[_auth_headers]]" task_id="[[task_id]]" busy="{{_busy}}" request="{{_request}}" result="{{_result}}" stdout="{{_stdout}}"> </task-page-data> <h1>Task Page Stub</h1> </div> </swarming-app> </template> <script>!function(){Polymer({is:"task-page",behaviors:[SwarmingBehaviors.CommonBehavior],properties:{task_id:{type:String},client_id:{type:String}}})}()</script> </dom-module></div></body></html> |