Browse Source

Merge "Revert "Network Topology graph "twitches""" into stable/rocky

Zuul 8 months ago
parent
commit
0aa126ddd0
1 changed files with 4 additions and 60 deletions
  1. 4
    60
      openstack_dashboard/static/js/horizon.networktopologycommon.js

+ 4
- 60
openstack_dashboard/static/js/horizon.networktopologycommon.js View File

@@ -20,59 +20,6 @@ horizon.networktopologycommon = {
20 20
   }
21 21
 };
22 22
 
23
-function isEqual(data1, data2) {
24
-  var list1 = [], list2 = [];
25
-  function compare2Objects (data1, data2) {
26
-    var item;
27
-
28
-    if (isNaN(data1) && isNaN(data2) && typeof data1 === 'number' && typeof data2 === 'number') {
29
-      return true;
30
-    }
31
-
32
-    // Compare primitives and functions.
33
-    // Check if both arguments link to the same object.
34
-    // Especially useful on the step where we compare prototypes
35
-    if (data1 === data2) {
36
-      return true;
37
-    }
38
-    for (item in data1) {
39
-      if (data2.hasOwnProperty(item) !== data1.hasOwnProperty(item)) {
40
-        return false;
41
-      }
42
-      else if (typeof data2[item] !== typeof data1[item]) {
43
-        return false;
44
-      }
45
-
46
-      switch (typeof (data1[item])) {
47
-        case 'object':
48
-          if (!compare2Objects (data1[item], data2[item])) {
49
-                    return false;
50
-          }
51
-          break;
52
-
53
-        default:
54
-          if (data1[item] !== data2[item]) {
55
-            list1.push(data1[item]);
56
-            list2.push(data2[item]);
57
-          }
58
-          break;
59
-      }
60
-    }
61
-    return true;
62
-  }
63
-  if (!compare2Objects(data1, data2)) {
64
-    return false;
65
-  } else {
66
-    list1 = list1.sort();
67
-    list2 = list2.sort();
68
-    for (var i in list1) {
69
-      if (list2[i] != list1[i])
70
-        return false;
71
-    }
72
-  }
73
-  return true;
74
-}
75
-
76 23
 /**
77 24
  * Common data loader for network topology views
78 25
  */
@@ -83,7 +30,7 @@ horizon.networktopologyloader = {
83 30
   reload_duration: 10000,
84 31
   // timer controlling update intervals
85 32
   update_timer: null,
86
-  previous_data : {},
33
+
87 34
   init:function() {
88 35
     var self = this;
89 36
     if($('#networktopology').length === 0) {
@@ -101,11 +48,8 @@ horizon.networktopologyloader = {
101 48
       angular.element('#networktopology').data('networktopology') + '?' + angular.element.now(),
102 49
       function(data) {
103 50
         self.model = data;
104
-        if (!isEqual(data,self.previous_data)) {
105
-          angular.copy(data, self.previous_data);
106
-          $('#networktopology').trigger('change');
107
-        }
108
-        self.update_timer = setTimeout(function() {
51
+        $('#networktopology').trigger('change');
52
+        self.update_timer = setTimeout(function(){
109 53
           self.update();
110 54
         }, self.reload_duration);
111 55
       }
@@ -154,7 +98,7 @@ horizon.networktopologymessager = {
154 98
         setTimeout(function() {
155 99
           self.previous_message = null;
156 100
           self.delete_data = {};
157
-        }, self.reload_duration);
101
+        },self.reload_duration);
158 102
       }
159 103
     });
160 104
   },

Loading…
Cancel
Save