From 364b8155000be4a5d00e5fd483185908d1090f8f Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 11 Aug 2018 16:31:51 +0000 Subject: [PATCH] Revert "Network Topology graph "twitches"" This reverts commit e5dae9b35349c53fa6184e415e254094893cab1f (and commit 1ca8555011ad345e6343eded2fcca4516aa70944 which is a follow-up styling fix). The reverted commit itself is a nice improvement, but considering the situation that Rocky release is approaching at the end of August we revert this to recover the original user-visible behavior. It would be nice if someone can revisit the improvement in the next Stein release. Change-Id: If324bd47a1b8c1b9579c1f38adeae31fdf583780 Closes-Bug: #1786628 Related-Bug: #1716834 (cherry picked from commit 9fbdc81038d13864c9280102c6a357e29f259ac5) --- .../js/horizon.networktopologycommon.js | 64 ++----------------- 1 file changed, 4 insertions(+), 60 deletions(-) diff --git a/openstack_dashboard/static/js/horizon.networktopologycommon.js b/openstack_dashboard/static/js/horizon.networktopologycommon.js index b855444183..a2722e8fec 100644 --- a/openstack_dashboard/static/js/horizon.networktopologycommon.js +++ b/openstack_dashboard/static/js/horizon.networktopologycommon.js @@ -20,59 +20,6 @@ horizon.networktopologycommon = { } }; -function isEqual(data1, data2) { - var list1 = [], list2 = []; - function compare2Objects (data1, data2) { - var item; - - if (isNaN(data1) && isNaN(data2) && typeof data1 === 'number' && typeof data2 === 'number') { - return true; - } - - // Compare primitives and functions. - // Check if both arguments link to the same object. - // Especially useful on the step where we compare prototypes - if (data1 === data2) { - return true; - } - for (item in data1) { - if (data2.hasOwnProperty(item) !== data1.hasOwnProperty(item)) { - return false; - } - else if (typeof data2[item] !== typeof data1[item]) { - return false; - } - - switch (typeof (data1[item])) { - case 'object': - if (!compare2Objects (data1[item], data2[item])) { - return false; - } - break; - - default: - if (data1[item] !== data2[item]) { - list1.push(data1[item]); - list2.push(data2[item]); - } - break; - } - } - return true; - } - if (!compare2Objects(data1, data2)) { - return false; - } else { - list1 = list1.sort(); - list2 = list2.sort(); - for (var i in list1) { - if (list2[i] != list1[i]) - return false; - } - } - return true; -} - /** * Common data loader for network topology views */ @@ -83,7 +30,7 @@ horizon.networktopologyloader = { reload_duration: 10000, // timer controlling update intervals update_timer: null, - previous_data : {}, + init:function() { var self = this; if($('#networktopology').length === 0) { @@ -101,11 +48,8 @@ horizon.networktopologyloader = { angular.element('#networktopology').data('networktopology') + '?' + angular.element.now(), function(data) { self.model = data; - if (!isEqual(data,self.previous_data)) { - angular.copy(data, self.previous_data); - $('#networktopology').trigger('change'); - } - self.update_timer = setTimeout(function() { + $('#networktopology').trigger('change'); + self.update_timer = setTimeout(function(){ self.update(); }, self.reload_duration); } @@ -154,7 +98,7 @@ horizon.networktopologymessager = { setTimeout(function() { self.previous_message = null; self.delete_data = {}; - }, self.reload_duration); + },self.reload_duration); } }); },