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

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: Added corresponding color to pending time and duration. 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>
460 <font color="#EE8788">[[_pending(_result)]]</font>
461 </td>
462 </tr>
463 <tr>
464 <td>Duration</td>
465 <td>
466 <font color="#1E78B4">[[_result.human_duration]]</font>
467 </td>
468 </tr>
469 </tbody>
470 </table>
471 </div>
472 <div class="right flex">
473 <template is="dom-if" if="[[_result.human_completed_ts]]">
474 <center>
475 <svg-piechart
476 data="[[_computePiechartData(_result)]]"
477 colors="[&quot;rgb(238,135,136)&quot;, &quot;rgb(30,120,18 0)&quot;]">
kjlubick 2017/06/07 12:12:58 Are these colors okay for people with various type
ayanaadylova 2017/06/07 17:01:54 Done.
478 </svg-piechart>
479 </center>
480 </template>
481 </div>
482 </div>
483
459 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</ div> 484 <div class="title" hidden$="[[_not(_task_exists)]]">Task Execution</ div>
460 <template is="dom-if" if="[[_wasPickedUp(_result)]]"> 485 <template is="dom-if" if="[[_wasPickedUp(_result)]]">
461 <table hidden$="[[_not(_task_exists)]]"> 486 <table hidden$="[[_not(_task_exists)]]">
462 <tr> 487 <tr>
463 <td>Bot assigned to task</td> 488 <td>Bot assigned to task</td>
464 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]] </td> 489 <td><a href$="[[_botLink(_result.bot_id)]]">[[_result.bot_id]] </td>
465 </tr> 490 </tr>
466 <tr> 491 <tr>
467 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]"> 492 <td rowspan$="[[_rowspan(_result.bot_dimensions)]]">
468 <a>Bot Dimensions</a> 493 <a>Bot Dimensions</a>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 value: false, 692 value: false,
668 }, 693 },
669 _busyPendingCount: { 694 _busyPendingCount: {
670 type: Boolean, 695 type: Boolean,
671 value: false, 696 value: false,
672 }, 697 },
673 _busyBotCount: { 698 _busyBotCount: {
674 type: Boolean, 699 type: Boolean,
675 value: false, 700 value: false,
676 }, 701 },
702
677 _dialog_prompt: { 703 _dialog_prompt: {
678 type: String, 704 type: String,
679 value: "", 705 value: "",
680 }, 706 },
681 _host_url: { 707 _host_url: {
682 type: String, 708 type: String,
683 value: function(){ 709 value: function(){
684 return window.location.hostname; 710 return window.location.hostname;
685 } 711 }
686 }, 712 },
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 }, 824 },
799 825
800 _command: function(request) { 826 _command: function(request) {
801 if (!request || !request.properties) { 827 if (!request || !request.properties) {
802 return ""; 828 return "";
803 } 829 }
804 var args = request.properties.command || []; 830 var args = request.properties.command || [];
805 return args.join(" "); 831 return args.join(" ");
806 }, 832 },
807 833
834 _computePiechartData: function(result) {
835 var created = new Date(result.created_ts);
kjlubick 2017/06/07 12:12:58 I don't think you need to create Date objects, *_t
ayanaadylova 2017/06/07 17:01:54 Done.
836 var started = new Date(result.started_ts);
837 var completed = new Date(result.completed_ts);
838 return [
839 this._duration(created, started),
840 this._duration(started, completed)];
841 },
842
808 _cost: function(result) { 843 _cost: function(result) {
809 if (!result || !result.costs_usd || !result.costs_usd.length) { 844 if (!result || !result.costs_usd || !result.costs_usd.length) {
810 return 0; 845 return 0;
811 } 846 }
812 return result.costs_usd[0].toFixed(4); 847 return result.costs_usd[0].toFixed(4);
813 }, 848 },
814 849
815 _disambiguate: function(taskId, result) { 850 _disambiguate: function(taskId, result) {
816 if (!taskId.endsWith("0") || !result) { 851 if (!taskId.endsWith("0") || !result) {
817 return false; 852 return false;
818 } 853 }
819 return result.try_number > 1; 854 return result.try_number > 1;
820 }, 855 },
821 856
857 _duration: function(start, end) {
858 return end.getTime() - start.getTime();
859 },
860
822 _empty: function(array) { 861 _empty: function(array) {
823 return !array || array.length == 0; 862 return !array || array.length == 0;
824 }, 863 },
825 864
826 _eq: function(a,b) { 865 _eq: function(a,b) {
827 return a === b; 866 return a === b;
828 }, 867 },
829 868
830 _expires: function(request) { 869 _expires: function(request) {
831 var delta = parseInt(request.expiration_secs); 870 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); 1103 this._getJsonAsync("_other_running", "/api/swarming/v1/tasks/count", " _busyRunningCount", this._auth_headers, taskCountParams);
1065 // change running to pending 1104 // change running to pending
1066 taskCountParams.state = ["PENDING"]; 1105 taskCountParams.state = ["PENDING"];
1067 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", " _busyPendingCount", this._auth_headers, taskCountParams); 1106 this._getJsonAsync("_other_pending", "/api/swarming/v1/tasks/count", " _busyPendingCount", this._auth_headers, taskCountParams);
1068 } 1107 }
1069 } 1108 }
1070 }); 1109 });
1071 })(); 1110 })();
1072 </script> 1111 </script>
1073 </dom-module> 1112 </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