Network topology "Graph" tab always shows nothing

Network topology "Graph" tab always says "There are no networks,
routers, or connected instances to display."
This happens after a fix for bug 1661350
(commit f35eaa2d13) was merged.

The problem with that in checking the length of object.
So always will be equal undefined,
also check the object before getting filled.

Closes-Bug: #1747196
Change-Id: I72dd8d2b472677411635f58309c780a8d602ffe3
This commit is contained in:
Ameed Ashour 2018-02-04 05:38:24 -05:00 committed by Ameed Ashour
parent 6a501248f0
commit 4a3f0dcef0
1 changed files with 7 additions and 6 deletions

View File

@ -145,12 +145,6 @@ horizon.network_topology = {
// set up loader first thing
self.$loading_template.show();
if (self.data.networks.length === undefined) {
$('.loader-inline').remove();
$(self.svg_container).addClass('noinfo');
return;
}
self.create_vis();
self.force_direction(0.05,70,-700);
if(horizon.networktopologyloader.model !== null) {
@ -165,6 +159,13 @@ horizon.network_topology = {
angular.element('#networktopology').on('change', function() {
self.retrieve_network_info(true);
if(angular.equals(self.data.networks,{}) && angular.equals(self.data.routers,{}) &&
angular.equals(self.data.servers,{})){
$('.loader-inline').remove();
angular.element('#topologyCanvasContainer').find('svg').remove();
$(self.svg_container).addClass('noinfo');
return;
}
});
// register for message notifications