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

Side by Side Diff: appengine/swarming/ui/res/imp/taskpage/task-page.html

Issue 2918353002: Swarming UI: Added piechart for timing information. (Closed)
Patch Set: Removed _convertToInteger() function. Created 3 years, 6 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/bower.json ('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 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <task-page> 9 <task-page>
10 10
(...skipping 14 matching lines...) Expand all
25 --> 25 -->
26 26
27 <link rel="import" href="/res/imp/bower_components/iron-icon/iron-icon.html"> 27 <link rel="import" href="/res/imp/bower_components/iron-icon/iron-icon.html">
28 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> 28 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html">
29 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm l"> 29 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm l">
30 <link rel="import" href="/res/imp/bower_components/paper-checkbox/paper-checkbox .html"> 30 <link rel="import" href="/res/imp/bower_components/paper-checkbox/paper-checkbox .html">
31 <link rel="import" href="/res/imp/bower_components/paper-dialog/paper-dialog.htm l"> 31 <link rel="import" href="/res/imp/bower_components/paper-dialog/paper-dialog.htm l">
32 <link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html" > 32 <link rel="import" href="/res/imp/bower_components/paper-input/paper-input.html" >
33 <link rel="import" href="/res/imp/bower_components/paper-tabs/paper-tabs.html"> 33 <link rel="import" href="/res/imp/bower_components/paper-tabs/paper-tabs.html">
34 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> 34 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html">
35 <link rel="import" href="/res/imp/bower_components/svg-piechart/svg-piechart.htm l">
35 36
36 <link rel="import" href="/res/imp/common/common-behavior.html"> 37 <link rel="import" href="/res/imp/common/common-behavior.html">
37 <link rel="import" href="/res/imp/common/interval-timer.html"> 38 <link rel="import" href="/res/imp/common/interval-timer.html">
38 <link rel="import" href="/res/imp/common/single-page-style.html"> 39 <link rel="import" href="/res/imp/common/single-page-style.html">
39 <link rel="import" href="/res/imp/common/swarming-app.html"> 40 <link rel="import" href="/res/imp/common/swarming-app.html">
40 <link rel="import" href="/res/imp/common/task-behavior.html"> 41 <link rel="import" href="/res/imp/common/task-behavior.html">
41 <link rel="import" href="/res/imp/common/url-param.html"> 42 <link rel="import" href="/res/imp/common/url-param.html">
42 43
43 <link rel="import" href="task-page-data.html"> 44 <link rel="import" href="task-page-data.html">
44 <link rel="import" href="task-retry-prompt.html"> 45 <link rel="import" href="task-retry-prompt.html">
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 <a 230 <a
230 title="The list of bots that matches the list of dimensi ons" 231 title="The list of bots that matches the list of dimensi ons"
231 href$="[[_botListLink(_request.properties.dimensions)]]" >bots</a> 232 href$="[[_botListLink(_request.properties.dimensions)]]" >bots</a>
232 can run this task 233 can run this task
233 (<span class$="[[_it(_bots_count.dead)]]">[[_bots_count.dead ]]</span> 234 (<span class$="[[_it(_bots_count.dead)]]">[[_bots_count.dead ]]</span>
234 dead, 235 dead,
235 <span class$="[[_it(_bots_count.dead)]]">[[_bots_count.quara ntined]]</span> 236 <span class$="[[_it(_bots_count.dead)]]">[[_bots_count.quara ntined]]</span>
236 quarantined) 237 quarantined)
237 </td> 238 </td>
238 </tr> 239 </tr>
239 <tr>
240 <td>Created</td>
241 <td title$="[[_request.created_ts]]">[[_request.human_created_ ts]]</td>
242 </tr>
243 <template is="dom-if" if="[[_wasPickedUp(_result)]]">
244 <tr>
245 <td>Started</td>
246 <td title$="[[_result.started_ts]]">[[_result.human_started_ ts]]</td>
247 </tr>
248 </template>
249 <template is="dom-if" if="[[_wasNotPickedUp(_result)]]">
250 <tr>
251 <td>Expires</td>
252 <td>[[_expires(_request)]]</td>
253 </tr>
254 </template>
255 <template is="dom-if" if="[[_result.human_completed_ts]]">
256 <tr>
257 <td>Completed</td>
258 <td title$="[[_result.completed_ts]]">[[_result.human_comple ted_ts]]</td>
259 </tr>
260 </template>
261 <template is="dom-if" if="[[_result.human_abandoned_ts]]">
262 <tr>
263 <td>Abandoned</td>
264 <td title$="[[_result.abandoned_ts]]">[[_result.human_abando ned_ts]]</td>
265 </tr>
266 </template>
267 <tr>
268 <td>Last Updated</td>
269 <td title$="[[_result.modified_ts]]">[[_result.human_modified_ ts]]</td>
270 </tr>
271 <template is="dom-if" if="[[_result.deduped_from]]"> 240 <template is="dom-if" if="[[_result.deduped_from]]">
272 <tr> 241 <tr>
273 <td><b>Deduped from</b></td> 242 <td><b>Deduped from</b></td>
274 <td> 243 <td>
275 <a href$="[[_taskLink(_result.deduped_from)]]"> 244 <a href$="[[_taskLink(_result.deduped_from)]]">
276 [[_result.deduped_from]] 245 [[_result.deduped_from]]
277 </a> 246 </a>
278 </td> 247 </td>
279 </tr> 248 </tr>
280 </template> 249 </template>
281 <tr> 250 <tr>
282 <td>Pending Time</td>
283 <td>[[_pending(_result)]]</td>
284 </tr>
285 <tr>
286 <td>Duration</td>
287 <td>[[_result.human_duration]]</td>
288 </tr>
289 <tr>
290 <td>Priority</td> 251 <td>Priority</td>
291 <td>[[_request.priority]]</td> 252 <td>[[_request.priority]]</td>
292 </tr> 253 </tr>
293 <tr> 254 <tr>
294 <td>User</td> 255 <td>User</td>
295 <td>[[_request.user]]</td> 256 <td>[[_request.user]]</td>
296 </tr> 257 </tr>
297 <tr> 258 <tr>
298 <td>Authenticated</td> 259 <td>Authenticated</td>
299 <td>[[_request.authenticated]]</td> 260 <td>[[_request.authenticated]]</td>
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 </tr> 410 </tr>
450 <template is="dom-repeat" items="[[_request.properties.caches]]" as="cache"> 411 <template is="dom-repeat" items="[[_request.properties.caches]]" as="cache">
451 <tr> 412 <tr>
452 <td><span>[[cache.name]]</span>:<span>[[cache.path]]</span>< /td> 413 <td><span>[[cache.name]]</span>:<span>[[cache.path]]</span>< /td>
453 </tr> 414 </tr>
454 </template> 415 </template>
455 416
456 </tbody> 417 </tbody>
457 </table> 418 </table>
458 419
420 <div class="title" hidden$="[[_not(_task_exists)]]">Task Timing Info rmation</div>
421 <div class="horizontal layout wrap">
422 <div class="left flex">
423 <table class="task-info" hidden$="[[_not(_task_exists)]]">
424 <tbody>
425 <tr>
426 <td>Created</td>
427 <td title$="[[_request.created_ts]]">[[_request.human_crea ted_ts]]</td>
428 </tr>
429 <template is="dom-if" if="[[_wasPickedUp(_result)]]">
430 <tr>
431 <td>Started</td>
432 <td title$="[[_result.started_ts]]">[[_result.human_star ted_ts]]</td>
433 </tr>
434 </template>
435 <template is="dom-if" if="[[_wasNotPickedUp(_result)]]">
436 <tr>
437 <td>Expires</td>
438 <td>[[_expires(_request)]]</td>
439 </tr>
440 </template>
441 <template is="dom-if" if="[[_result.human_completed_ts]]">
442 <tr>
443 <td>Completed</td>
444 <td title$="[[_result.completed_ts]]">[[_result.human_co mpleted_ts]]</td>
445 </tr>
446 </template>
447 <template is="dom-if" if="[[_result.human_abandoned_ts]]">
448 <tr>
449 <td>Abandoned</td>
450 <td title$="[[_result.abandoned_ts]]">[[_result.human_ab andoned_ts]]</td>
451 </tr>
452 </template>
453 <tr>
454 <td>Last updated</td>
455 <td title$="[[_result.modified_ts]]">[[_result.human_modif ied_ts]]</td>
456 </tr>
457 <tr>
458 <td>Pending Time</td>
459 <td>[[_pending(_result)]]</td>
Sergey Berezin 2017/06/06 18:29:08 Let's also add the corresponding color to pending
ayanaadylova 2017/06/06 18:57:55 Done.
460 </tr>
461 <tr>
462 <td>Duration</td>
463 <td>[[_result.human_duration]]</td>
464 </tr>
465 </tbody>
466 </table>
467 </div>
468 <div class="right flex">
469 <template is="dom-if" if="[[_result.human_completed_ts]]">
470 <center>
471 <svg-piechart
472 data="[[_computePiechartData(_result)]]"
473 colors="[&quot;rgb(238,135,136)&quot;, &quot;rgb(30,120,18 0)&quot;]">
474 </svg-piechart>
475 </center>
476 </template>
477 </div>
478 </div>
479
459 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</ div> 480 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</ div>
460 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> 481 <template is="dom-if" if="[[_wasPickedUp(_result)]]">
461 <table hidden$="[[_not(_task_exists)]]"> 482 <table hidden$="[[_not(_task_exists)]]">
462 <tr> 483 <tr>
463 <td>Bot assigned to task</td> 484 <td>Bot assigned to task</td>
464 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]] </td> 485 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]] </td>
465 </tr> 486 </tr>
466 <tr> 487 <tr>
467 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> 488 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]">
468 <a>Bot Dimensions</a> 489 <a>Bot Dimensions</a>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 value: false, 688 value: false,
668 }, 689 },
669 _busyPendingCount: { 690 _busyPendingCount: {
670 type: Boolean, 691 type: Boolean,
671 value: false, 692 value: false,
672 }, 693 },
673 _busyBotCount: { 694 _busyBotCount: {
674 type: Boolean, 695 type: Boolean,
675 value: false, 696 value: false,
676 }, 697 },
698
677 _dialog_prompt: { 699 _dialog_prompt: {
678 type: String, 700 type: String,
679 value: "", 701 value: "",
680 }, 702 },
681 _host_url: { 703 _host_url: {
682 type: String, 704 type: String,
683 value: function(){ 705 value: function(){
684 return window.location.hostname; 706 return window.location.hostname;
685 } 707 }
686 }, 708 },
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 }, 820 },
799 821
800 _command: function(request) { 822 _command: function(request) {
801 if (!request || !request.properties) { 823 if (!request || !request.properties) {
802 return ""; 824 return "";
803 } 825 }
804 var args = request.properties.command || []; 826 var args = request.properties.command || [];
805 return args.join(" "); 827 return args.join(" ");
806 }, 828 },
807 829
830 _computePiechartData: function(result) {
831 var created = new Date(result.created_ts);
832 var started = new Date(result.started_ts);
833 var completed = new Date(result.completed_ts);
834 return [
835 this._duration(created, started),
836 this._duration(started, completed)];
837 },
838
808 _cost: function(result) { 839 _cost: function(result) {
809 if (!result || !result.costs_usd || !result.costs_usd.length) { 840 if (!result || !result.costs_usd || !result.costs_usd.length) {
810 return 0; 841 return 0;
811 } 842 }
812 return result.costs_usd[0].toFixed(4); 843 return result.costs_usd[0].toFixed(4);
813 }, 844 },
814 845
815 _disambiguate: function(taskId, result) { 846 _disambiguate: function(taskId, result) {
816 if (!taskId.endsWith("0") || !result) { 847 if (!taskId.endsWith("0") || !result) {
817 return false; 848 return false;
818 } 849 }
819 return result.try_number > 1; 850 return result.try_number > 1;
820 }, 851 },
821 852
853 _duration: function(start, end) {
854 return end.getTime() - start.getTime();
855 },
856
822 _empty: function(array) { 857 _empty: function(array) {
823 return !array || array.length == 0; 858 return !array || array.length == 0;
824 }, 859 },
825 860
826 _eq: function(a,b) { 861 _eq: function(a,b) {
827 return a === b; 862 return a === b;
828 }, 863 },
829 864
830 _expires: function(request) { 865 _expires: function(request) {
831 var delta = parseInt(request.expiration_secs); 866 var delta = parseInt(request.expiration_secs);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", " _busyRunningCount", this._auth_headers, taskCountParams); 1099 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", " _busyRunningCount", this._auth_headers, taskCountParams);
1065 // change running to pending 1100 // change running to pending
1066 taskCountParams.state = ["PENDING"]; 1101 taskCountParams.state = ["PENDING"];
1067 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", " _busyPendingCount", this._auth_headers, taskCountParams); 1102 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", " _busyPendingCount", this._auth_headers, taskCountParams);
1068 } 1103 }
1069 } 1104 }
1070 }); 1105 });
1071 })(); 1106 })();
1072 </script> 1107 </script>
1073 </dom-module> 1108 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/bower.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698