Skip to content
Snippets Groups Projects
Commit 364b8155 authored by Akihiro Motoki's avatar Akihiro Motoki Committed by Ivan Kolodyazhny
Browse files

Revert "Network Topology graph "twitches""

This reverts commit e5dae9b3
(and commit 1ca85550 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 9fbdc810)
parent 96cdaf42
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment