From eebf4d30a63b816c427dc34ff48d5858b672f7de Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Wed, 23 Jun 2021 14:02:51 +0200 Subject: [PATCH] B #5434: Disable autorefresh (#1326) (cherry picked from commit 861a63356ffc723f845095b18caf9e52150b09b2) --- src/sunstone/public/app/sunstone.js | 4 +- src/sunstone/public/app/utils/websocket.js | 61 ++++++++++++---------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/src/sunstone/public/app/sunstone.js b/src/sunstone/public/app/sunstone.js index 4347394cee..cc07a799e8 100644 --- a/src/sunstone/public/app/sunstone.js +++ b/src/sunstone/public/app/sunstone.js @@ -931,7 +931,9 @@ define(function(require) { }; var _autorefresh = function(tabName, info, contextTabId, context) { - _insertPanels(tabName, info, contextTabId, context, true); + // This code is disabled to forbid the autorefresh feature + //_insertPanels(tabName, info, contextTabId, context, true); + _insertPanels(tabName, info, contextTabId, context, false); }; diff --git a/src/sunstone/public/app/utils/websocket.js b/src/sunstone/public/app/utils/websocket.js index 545fb24fcf..faa5888b9a 100644 --- a/src/sunstone/public/app/utils/websocket.js +++ b/src/sunstone/public/app/utils/websocket.js @@ -45,6 +45,11 @@ define(function (require) { }; var _start = function (fireedgeToken="") { + /* + + // This code is disabled to forbid the autorefresh feature + + connection = STATUS.PROCESSING; if (sunstone_fireedge_active && fireedgeToken != "" ){ @@ -97,36 +102,36 @@ define(function (require) { default: break; } - /* - // this code recreate the datatable for VM and HOST this call foundation() - var response = {}; - response[object] = event_data.HOOK_MESSAGE[object]; - var request = { - "request": { - "data": [response[object].ID], - "method": "show", - "resource": object - } - }; - // update VM and HOST - var tab = $("#" + tab_id); - if( - Sunstone.getDataTable(tab_id) && - Sunstone.getDataTable(tab_id).updateElement && - typeof Sunstone.getDataTable(tab_id).updateElement === "function" - ){ - Sunstone.getDataTable(tab_id).updateElement(request, response); + // this code recreate the datatable for VM and HOST this call foundation() + + var response = {}; + response[object] = event_data.HOOK_MESSAGE[object]; + var request = { + "request": { + "data": [response[object].ID], + "method": "show", + "resource": object } - if (Sunstone.rightInfoVisible(tab) && event_data.HOOK_MESSAGE.RESOURCE_ID == Sunstone.rightInfoResourceId(tab)) { - callFunction(response); - } - if (event_data.HOOK_MESSAGE.STATE == "DONE"){ - Sunstone.getDataTable(tab_id).waitingNodes(); - Sunstone.runAction(object + ".list", {force: true}); - } - */ - } + }; + // update VM and HOST + var tab = $("#" + tab_id); + if( + Sunstone.getDataTable(tab_id) && + Sunstone.getDataTable(tab_id).updateElement && + typeof Sunstone.getDataTable(tab_id).updateElement === "function" + ){ + Sunstone.getDataTable(tab_id).updateElement(request, response); + } + if (Sunstone.rightInfoVisible(tab) && event_data.HOOK_MESSAGE.RESOURCE_ID == Sunstone.rightInfoResourceId(tab)) { + callFunction(response); + } + if (event_data.HOOK_MESSAGE.STATE == "DONE"){ + Sunstone.getDataTable(tab_id).waitingNodes(); + Sunstone.runAction(object + ".list", {force: true}); + } + + } */ }); // Close Socket when close browser or tab.