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

Side by Side Diff: chrome/browser/resources/sync_file_system_internals/task_log.js

Issue 304993004: [SyncFS] Add TaskLog tab on chrome://syncfs-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var TaskLog = (function() {
6 'use strict';
7
8 var nextTaskLogSeq = 1;
9 var TaskLog = {};
10
11 function observeTaskLog() {
12 chrome.send('observeTaskLog');
13 }
14
15 /**
16 * Handles per-task log event.
17 * @param {Object} taskLog a dictionary containing 'duration',
18 * 'task_description', 'result_description' and 'details'.
19 */
20 TaskLog.onTaskLogRecorded = function(taskLog) {
21 var details = document.createElement('td');
22 details.classList.add('task-log-details');
23
24 var label = document.createElement('label');
25 details.appendChild(label);
26
27 var collapseCheck = document.createElement('input');
28 collapseCheck.setAttribute('type', 'checkbox');
29 collapseCheck.classList.add('task-log-collapse-check');
30 label.appendChild(collapseCheck);
31
32 var ul = document.createElement('ul');
33 for (var i = 0; i < taskLog.details.length; ++i)
34 ul.appendChild(createElementFromText('li', taskLog.details[i]));
35 label.appendChild(ul);
36
37 var tr = document.createElement('tr');
38 tr.appendChild(createElementFromText(
39 'td', taskLog.duration, {'class': 'task-log-duration'}));
40 tr.appendChild(createElementFromText(
41 'td', taskLog.task_description, {'class': 'task-log-description'}));
42 tr.appendChild(createElementFromText(
43 'td', taskLog.result_description, {'class': 'task-log-result'}));
44 tr.appendChild(details);
45
46 $('task-log-entries').appendChild(tr);
47 }
48
49 /**
50 * Get initial sync service values and set listeners to get updated values.
51 */
52 function main() {
53 observeTaskLog();
54 }
55
56 document.addEventListener('DOMContentLoaded', main);
57 return TaskLog;
58 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698