diff --git a/src/sunstone/public/app/tabs/dashboard-tab/storage.hbs b/src/sunstone/public/app/tabs/dashboard-tab/storage.hbs new file mode 100644 index 0000000000..66e0de5286 --- /dev/null +++ b/src/sunstone/public/app/tabs/dashboard-tab/storage.hbs @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/src/sunstone/public/app/tabs/images-tab/datatable.js b/src/sunstone/public/app/tabs/images-tab/datatable.js index aa863f9d20..aa5ab48245 100644 --- a/src/sunstone/public/app/tabs/images-tab/datatable.js +++ b/src/sunstone/public/app/tabs/images-tab/datatable.js @@ -68,12 +68,17 @@ define(function(require) { "you_selected_multiple": Locale.tr("You selected the following images:") }; + this.totalImages = 0; + this.sizeImages = 0; + TabDataTable.call(this); }; Table.prototype = Object.create(TabDataTable.prototype); Table.prototype.constructor = Table; Table.prototype.elementArray = _elementArray; + Table.prototype.preUpdateView = _preUpdateView; + Table.prototype.postUpdateView = _postUpdateView; Table.COLUMN_IDS = COLUMN_IDS; return Table; @@ -90,6 +95,9 @@ define(function(require) { return false; } + this.sizeImages = this.sizeImages + parseInt(element.SIZE); + this.totalImages++; + return [ '', element.ID, @@ -106,4 +114,16 @@ define(function(require) { element.TEMPLATE.TARGET ? element.TEMPLATE.TARGET : '--' ]; } + + function _preUpdateView() { + this.totalImages = 0; + this.sizeImages = 0; + } + + function _postUpdateView() { + var size = Humanize.sizeFromMB(this.sizeImages); + + $(".total_images").text(this.totalImages); + $(".size_images").text(size); + } });