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

Unified Diff: chrome/browser/resources/chromeos/drive_internals.js

Issue 10828422: drive: Add information about in-flight operations to chrome:drive-internals (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/drive_internals.js
diff --git a/chrome/browser/resources/chromeos/drive_internals.js b/chrome/browser/resources/chromeos/drive_internals.js
index 8e07931593549732e6110687364e54006ccd43eb..42003db971beeef174ab855583634a2b13c4c7f2 100644
--- a/chrome/browser/resources/chromeos/drive_internals.js
+++ b/chrome/browser/resources/chromeos/drive_internals.js
@@ -79,6 +79,31 @@ function updateLocalStorageUsage(localStorageSummary) {
}
/**
+ * Updates the summary about in-flight operations.
+ * @param {Object} operationsSummary Dictionaty describing the status of
satorux1 2012/08/22 20:20:02 seems to me that operationsSummary is a list of di
Haruki Sato 2012/08/24 19:06:11 Yes. Done. Thanks!
+ * in-flight operations.
+ */
+function updateInFlightOperations(operationsSummary) {
+ for (var i = 0; i < operationsSummary.length; i++) {
+ var operation = operationsSummary[i];
+ var tr = document.createElement('tr');
+ tr.appendChild(createElementFromText('td', operation.operation_id));
+ tr.appendChild(createElementFromText('td', operation.operation_type));
+ tr.appendChild(createElementFromText('td', operation.file_path));
+ tr.appendChild(createElementFromText('td', operation.transfer_state));
+ tr.appendChild(createElementFromText('td', operation.start_time));
+ var progress = operation.progress_current + '/' + operation.progress_total;
+ if (operation.progress_total > 0) {
+ progress += ' (' +
+ (operation.progress_current / operation.progress_total * 100) + '%)';
+ }
+ tr.appendChild(createElementFromText('td', progress));
+
+ $('in-flight-operations-contents').appendChild(tr);
+ }
satorux1 2012/08/22 20:20:02 I think we want to be able to monitor the in-fligh
Haruki Sato 2012/08/24 19:06:11 Done. Added periodic update using setInterval.
+}
+
+/**
* Creates an element named |elementName| containing the content |text|.
* @param {string} elementName Name of the new element to be created.
* @param {string} text Text to be contained in the new element.

Powered by Google App Engine
This is Rietveld 408576698