1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

F #2600: Added key into yamls to disable dashboard count animation (#2601)

This commit is contained in:
juanmont 2018-11-16 11:07:55 +01:00 committed by Ruben S. Montero
parent 3ade0c3d3f
commit 0443cac0a7
12 changed files with 37 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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']);

View File

@ -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");
}

View File

@ -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);