Skip to content

Commit

Permalink
F #2410: VM autorefresh (#2466)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abel Coronado authored and Tino Vázquez committed Oct 3, 2018
1 parent bc43781 commit 3db8ade
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sunstone/public/app/sunstone-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ define(function(require) {
return _config['user_config']["table_order"];
},

"autorefreshInfo": function(tabName) {
return _config['view']['tabs'][tabName]['autorefresh_info'] || 10000;
},

"provision": {
"dashboard": {
"isEnabled": function(widget) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ define(function(require) {
$(context).off("click", "#import_vcenter_images");
$(context).on("click", "#import_vcenter_images", function(){
that.vCenterImages.import(context);
$("#images-tabrefresh_buttons button").click();
return false;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ define(function(require) {
$(context).off("click", "#import_vcenter_templates");
$(context).on("click", "#import_vcenter_templates", function(){
that.vCenterTemplates.import(context);
$("#templates-tabrefresh_buttons button").click();
return false;
});

Expand Down
7 changes: 7 additions & 0 deletions src/sunstone/public/app/tabs/vms-tab/panels/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ define(function(require) {
var RESOURCE = "VM";
var XML_ROOT = "VM";

setInterval(function() {
var tab = $('#' + TAB_ID);
if (Sunstone.rightInfoVisible(tab)){
$("#vms-tabrefresh_buttons button").click();
}
}, Config.autorefreshInfo("vms-tab"));

/*
CONSTRUCTOR
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ define(function(require) {
$(context).off("click", "#import_vcenter_networks");
$(context).on("click", "#import_vcenter_networks", function(){
that.vCenterNetworks.import(context);
$("#vnets-tabrefresh_buttons button").click();
return false;
});

Expand Down

0 comments on commit 3db8ade

Please sign in to comment.