diff --git a/src/sunstone/etc/sunstone-views/kvm/admin.yaml b/src/sunstone/etc/sunstone-views/kvm/admin.yaml index d051cedc92..04a0c67354 100644 --- a/src/sunstone/etc/sunstone-views/kvm/admin.yaml +++ b/src/sunstone/etc/sunstone-views/kvm/admin.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml b/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml index aa895cabc8..cf178295a3 100644 --- a/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/kvm/groupadmin.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/kvm/user.yaml b/src/sunstone/etc/sunstone-views/kvm/user.yaml index 23d7165d89..b004559164 100644 --- a/src/sunstone/etc/sunstone-views/kvm/user.yaml +++ b/src/sunstone/etc/sunstone-views/kvm/user.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/mixed/admin.yaml b/src/sunstone/etc/sunstone-views/mixed/admin.yaml index e7500c2277..df9784a7a6 100644 --- a/src/sunstone/etc/sunstone-views/mixed/admin.yaml +++ b/src/sunstone/etc/sunstone-views/mixed/admin.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml b/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml index aa895cabc8..cf178295a3 100644 --- a/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/mixed/groupadmin.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/mixed/user.yaml b/src/sunstone/etc/sunstone-views/mixed/user.yaml index 23d7165d89..b004559164 100644 --- a/src/sunstone/etc/sunstone-views/mixed/user.yaml +++ b/src/sunstone/etc/sunstone-views/mixed/user.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/vcenter/admin.yaml b/src/sunstone/etc/sunstone-views/vcenter/admin.yaml index 800e04560d..e4c6dd1ffd 100644 --- a/src/sunstone/etc/sunstone-views/vcenter/admin.yaml +++ b/src/sunstone/etc/sunstone-views/vcenter/admin.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml b/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml index 4b9c45e861..8844db464a 100644 --- a/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml +++ b/src/sunstone/etc/sunstone-views/vcenter/groupadmin.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/etc/sunstone-views/vcenter/user.yaml b/src/sunstone/etc/sunstone-views/vcenter/user.yaml index 23d7165d89..b004559164 100644 --- a/src/sunstone/etc/sunstone-views/vcenter/user.yaml +++ b/src/sunstone/etc/sunstone-views/vcenter/user.yaml @@ -4,6 +4,7 @@ link_logo: text_link_logo: confirm_vms: false filter-view: true +do_count_animation: true enabled_tabs: - dashboard-tab - instances-top-tab diff --git a/src/sunstone/public/app/sunstone-config.js b/src/sunstone/public/app/sunstone-config.js index b33447b710..ecc21b1aef 100644 --- a/src/sunstone/public/app/sunstone-config.js +++ b/src/sunstone/public/app/sunstone-config.js @@ -169,7 +169,8 @@ define(function(require) { 'onedConf': _config['oned_conf'], 'confirmVMActions': _config['view']['confirm_vms'], 'scaleFactor': _config['view']['features']['instantiate_cpu_factor'], - 'filterView': _config['view']['filter_view'], + 'filterView': _config['view']['filter-view'], + 'doCountAnimation': _config['view']['do_count_animation'], "allTabs": function() { return Object.keys(_config['view']['tabs']); diff --git a/src/sunstone/public/app/tabs/hosts-tab/datatable.js b/src/sunstone/public/app/tabs/hosts-tab/datatable.js index a10c7452c9..836833a9be 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/datatable.js +++ b/src/sunstone/public/app/tabs/hosts-tab/datatable.js @@ -214,6 +214,12 @@ define(function(require) { } function _postUpdateView() { + var time = 2000; + + if ( !SunstoneConfig.doCountAnimation ){ + time = 1; + } + $(".total_hosts").text(this.totalHosts); $(".on_hosts").text(this.onHosts); $(".off_hosts").text(this.offHosts); @@ -236,7 +242,7 @@ define(function(require) { var percentage = ratio_allocated_cpu > 100 ? 100 : ratio_allocated_cpu; $("#dashboard_host_allocated_cpu_meter").animate({ value: percentage, - }, 2000, "swing"); + }, time, "swing"); var ratio_real_cpu = 0; if (this.maxCPU > 0) { @@ -255,7 +261,7 @@ define(function(require) { var percentage = ratio_real_cpu > 100 ? 100 : ratio_real_cpu; $("#dashboard_host_real_cpu_meter").animate({ value: percentage, - }, 2000, "swing"); + }, time, "swing"); var ratio_allocated_mem = 0; if (this.maxMemory > 0) { @@ -274,7 +280,7 @@ define(function(require) { var percentage = ratio_allocated_mem > 100 ? 100 : ratio_allocated_mem; $("#dashboard_host_allocated_mem_meter").animate({ value: percentage, - }, 2000, "swing"); + }, time, "swing"); var ratio_real_mem = 0; if (this.maxMemory > 0) { @@ -293,7 +299,7 @@ define(function(require) { var percentage = ratio_real_mem > 100 ? 100 : ratio_real_mem; $("#dashboard_host_real_mem_meter").animate({ value: percentage, - }, 2000, "swing"); + }, time, "swing"); } diff --git a/src/sunstone/public/app/utils/dashboard.js b/src/sunstone/public/app/utils/dashboard.js index 573074e967..e83c3ed0d5 100644 --- a/src/sunstone/public/app/utils/dashboard.js +++ b/src/sunstone/public/app/utils/dashboard.js @@ -16,7 +16,15 @@ define(function(require) { + var Config = require('sunstone-config'); + function _counterAnimation(domClass, value, extra) { + var time = 1500; + + if ( !Config.doCountAnimation ){ + time = 1; + } + if(!extra){ extra = ""; } @@ -24,7 +32,7 @@ define(function(require) { $(this).prop('Counter', 0).animate({ Counter: value }, { - duration: 1500, + duration: time, easing: 'swing', step: function (now) { $(this).text(Math.ceil(now) + " " + extra); @@ -34,6 +42,12 @@ define(function(require) { } function _counterAnimationDecimal(domClass, value, extra) { + var time = 1500; + + if ( !Config.doCountAnimation ){ + time = 1; + } + if(!extra){ extra = ""; } @@ -41,7 +55,7 @@ define(function(require) { $(this).prop('Counter', 0).animate({ Counter: value }, { - duration: 1500, + duration: time, easing: 'swing', step: function (now) { $(this).text(Math.round(now*10)/10 + " " + extra);