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 #717 from ammendonca/HAWKULAR-742-743
Browse files Browse the repository at this point in the history
HAWKULAR-742 & HAWKULAR-743 : Handle switch persona at URL & App Servers
  • Loading branch information
mtho11 committed Dec 15, 2015
2 parents 49cbdaf + 6c099f7 commit 4cb7895
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
</div>

<div ng-show="vm.resourceList" ng-class="{'hk-fade-in': vm.resourceList}">
<h1 class="text-center">{{userDetails.firstName}}'s application servers</h1>
<h1 class="text-center">
{{currentPersona.owner ? currentPersona.name : userDetails.firstName}}'s application servers
</h1>

<h3 class="pull-left">Current Status</h3>
<span class="hk-update pull-right" tooltip-trigger tooltip-placement="top" tooltip="Last update">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p class="hk-spinner-legend-below">Loading...</p>
</div>
<div class="hk-urls-list" ng-class="{'hk-urls-empty text-center': vm.resourceList.length === 0, 'hk-fade-in': vm.resourceList}" ng-show="vm.resourceList">
<h1 class="text-center">Hello {{userDetails.firstName}}!</h1>
<h1 class="text-center">Hello {{currentPersona.owner ? currentPersona.name : userDetails.firstName}}!</h1>
<i class="fa fa-line-chart" ng-show="vm.resourceList.length === 0"></i>
<h2 ng-show="vm.resourceList.length === 0">Collect metrics from a URL that you want to monitor.</h2>
<form class="form-horizontal hk-add-url" name="addUrlForm" role="form" novalidate ng-submit="vm.addUrl(vm.resourceUrl)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ module HawkularMetrics {
}
});

$scope.$on('SwitchedPersona', () => $location.path('/hawkular-ui/app/app-list'));

HawkularInventory.ResourceUnderFeed.get({
feedId: this.$routeParams.feedId,
resourcePath: this.$routeParams.resourceId + '~~'
Expand Down
2 changes: 2 additions & 0 deletions console/src/main/scripts/plugins/metrics/ts/appServerList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ module HawkularMetrics {

this.serverStatusArray = Object.keys(ServerStatus).map(type => ServerStatus[type]);

$scope.$on('SwitchedPersona', () => this.getResourceList());

this.setConfigForDataTable();
this.autoRefresh(20);
}
Expand Down
2 changes: 2 additions & 0 deletions console/src/main/scripts/plugins/metrics/ts/urlList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ module HawkularMetrics {
currentPersona && this.getResourceList(currentPersona.id));
}

$scope.$on('SwitchedPersona', () => this.getResourceList());

this.autoRefresh(20);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void startUp() {
// we use just an observable inventory here, because it allows us to see all the tenants. This essentially
// circumvents any authz present on the inventory.
// We need that though because pinger doesn't have storage of its own and is considered "trusted", so it's ok.
Set<Resource> urls = inventory.tenants().getAll().allResourceTypes().getAll(With.id(PingDestination.URL_TYPE))
Set<Resource> urls = inventory.tenants().getAll().resourceTypes().getAll(With.id(PingDestination.URL_TYPE))
.resources().getAll().entities();
Log.LOG.iInitializedWithUrls(urls.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void publish(PingStatus status) {

try {
Resources.ReadWrite resourceAccess = inventory.tenants().get(dest.getTenantId()).environments()
.get(dest.getEnvironmentId()).feedlessResources();
.get(dest.getEnvironmentId()).resources();

Resource resource = resourceAccess.get(dest.getResourceId()).entity();

Expand All @@ -76,7 +76,7 @@ public void publish(PingStatus status) {
updateBuilder.withProperty(TRAIT_PROPERTY_PREFIX + "powered-by", poweredBy);
}

inventory.tenants().get(dest.getTenantId()).environments().get(dest.getEnvironmentId()).feedlessResources()
inventory.tenants().get(dest.getTenantId()).environments().get(dest.getEnvironmentId()).resources()
.update(dest.getResourceId(), updateBuilder.build());
} catch (EntityNotFoundException e) {
Log.LOG.iResourceNotFound(dest.getResourceId(), dest.getTenantId());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<version.org.hawkular.commons>0.2.3.Final</version.org.hawkular.commons>
<version.org.hawkular.cmdgw>0.10.4.Final</version.org.hawkular.cmdgw>
<version.org.hawkular.metrics>0.9.0.Final</version.org.hawkular.metrics>
<version.org.hawkular.inventory>0.9.1.Final-SRC-revision-8620a7ffb2eea0c994705217b59768e89dca57e8</version.org.hawkular.inventory>
<version.org.hawkular.inventory>0.10.0.Final</version.org.hawkular.inventory>
<version.org.keycloak>1.6.1.Final</version.org.keycloak>
<version.org.testng>6.5.2</version.org.testng>
</properties>
Expand Down

0 comments on commit 4cb7895

Please sign in to comment.