Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #645 from Jiri-Kremser/HAWKULAR-788
Browse files Browse the repository at this point in the history
HAWKULAR-788 - Topology view keeps showing the waiting spinner when no resource.
  • Loading branch information
mtho11 committed Nov 11, 2015
2 parents a760271 + 141fafe commit 95e0e3b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<li ng-class="getClass('/hawkular-ui/app/')">
<a href="/hawkular-ui/app/app-list">Application Servers</a>
</li>
<li ng-class="getClass('/hawkular-ui/topology/')" ng-show="$root.isExperimental">
<li ng-class="getClass('/hawkular-ui/topology/')">
<a href="/hawkular-ui/topology/view">Topology</a>
</li>
</ul>
9 changes: 8 additions & 1 deletion console/src/main/scripts/plugins/topology/html/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<div class="hk-application-servers" data-ng-controller="HawkularTopology.TopologyController as vm">

<div class="text-center hk-urls-list hk-spinner-container hawkular-topology-spinner" ng-hide="vm.data.relations.length">
<div class="text-center hk-urls-list hk-spinner-container hawkular-topology-spinner"
ng-hide="vm.data.relations.length || !vm.requestPending">
<div class="spinner spinner-lg"></div>
<p class="hk-spinner-legend-below">Loading...</p>
</div>

<div class="text-center hk-urls-list hk-spinner-container hawkular-topology-spinner"
ng-hide="vm.data.relations.length || vm.requestPending">
<p class="hk-spinner-legend-below">No Data</p>
</div>

<div ng-class="{'hk-fade-in': vm.data.relations.length}">

<hawkular-topology-graph items="vm.data.items" relations="vm.data.relations" kinds="vm.kinds">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module HawkularTopology {

export class TopologyController {
private data: any;
private requestPending: boolean;
private index = 0;
private kinds: any;
private autoRefreshPromise: ng.IPromise<any>;
Expand Down Expand Up @@ -113,6 +114,7 @@ module HawkularTopology {
}

public getData(): any {
this.requestPending = true;
let typeToKind = {
'WildFly Server': 'Server',
'Datasource': 'DataSource',
Expand All @@ -122,6 +124,7 @@ module HawkularTopology {

this.HawkularInventory.Feed.query({environmentId:globalEnvironmentId}, (aFeedList) => {
if (!aFeedList.length) {
this.requestPending = false;
return;
}
let promises = [];
Expand All @@ -135,6 +138,10 @@ module HawkularTopology {
relations: {}
};
let flatResources = _.flatten(aResourceList, true);
if (!flatResources.length) {
this.requestPending = false;
return;
}
angular.forEach(flatResources, (res) => {
let newItem = {
kind: typeToKind[res.type.id],
Expand All @@ -156,6 +163,7 @@ module HawkularTopology {
});
newData.relations = newRelations;
this.data = newData;
this.requestPending = false;
});
});
}
Expand Down

0 comments on commit 95e0e3b

Please sign in to comment.