diff --git a/src/datastore_mad/remotes/dummy/monitor b/src/datastore_mad/remotes/dummy/monitor index 35e9439a46..a0bc478062 100755 --- a/src/datastore_mad/remotes/dummy/monitor +++ b/src/datastore_mad/remotes/dummy/monitor @@ -16,6 +16,6 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -echo "USED_MB=30720" +echo "USED_MB=9720" echo "TOTAL_MB=20480" echo "FREE_MB=20480" diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index a7d99e82fd..8ec06f886a 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -290,11 +290,12 @@ tabs: - 2 # Owner - 3 # Group - 4 # Name - - 5 # Cluster - #- 6 # Basepath - #- 7 # TM - #- 8 # DS - - 9 # Type + - 5 # Capacity + - 6 # Cluster + #- 7 # Basepath + #- 8 # TM + #- 9 # DS + - 10 # Type actions: Datastore.refresh: true Datastore.create_dialog: true diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index 066feb7dfb..aaab0ce6f7 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -291,11 +291,13 @@ tabs: - 2 # Owner - 3 # Group - 4 # Name - - 5 # Cluster - #- 6 # Basepath - #- 7 # TM - #- 8 # DS - #- 9 # Type + - 5 # Capacity + - 6 # Cluster + #- 7 # Basepath + #- 8 # TM + #- 9 # DS + #- 10 # Type + actions: Datastore.refresh: true Datastore.create_dialog: false diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 6fc68e08b4..87a319fbc4 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -56,6 +56,7 @@ var datastores_tab_content = '\ '+tr("Owner")+'\ '+tr("Group")+'\ '+tr("Name")+'\ + '+tr("Capacity")+'\ '+tr("Cluster")+'\ '+tr("Basepath")+'\ '+tr("TM MAD")+'\ @@ -605,6 +606,23 @@ function datastoreElementArray(element_json){ type = element.TEMPLATE.TYPE; } + var total = parseInt(element.TOTAL_MB); + + var used = parseInt(element.USED_MB); + + if (total > 0) { + var ratio = Math.round((used / total) * 100); + info_str = humanize_size_from_mb(used) + ' / ' + humanize_size_from_mb(total) + ' (' + ratio + '%)'; + } else { + if(element.TYPE == 1) { + info_str = '- / -'; + } else { + info_str = humanize_size(used) + ' / -'; + } + } + + var pb_capacity = quotaBarHtml(used, total, info_str); + return [ '\ \ \ + '+tr("Capacity")+'\\ + \ + ' + tr("Total") + '\ + '+(is_system ? '-' : humanize_size_from_mb(info.TOTAL_MB))+'\ + \ + \ + ' + tr("Used") + '\ + '+(is_system ? '-' : humanize_size_from_mb(info.USED_MB))+'\ + \ + \ + ' + tr("Free") + '\ + '+(is_system ? '-' : humanize_size_from_mb(info.FREE_MB))+'\ + \ \ ' + insert_extended_template_table(info.TEMPLATE, @@ -1087,6 +1121,7 @@ $(document).ready(function(){ "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "35px", "aTargets": [0] }, + { "sWidth": "200px", "aTargets": [5] }, { "bVisible": true, "aTargets": config['view']['tabs']['datastores-tab']['table_columns']}, { "bVisible": false, "aTargets": ['_all']} ]