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

Commit

Permalink
updating to new ui-services
Browse files Browse the repository at this point in the history
  • Loading branch information
jkremser authored and mtho11 committed Sep 9, 2015
1 parent a57faae commit fd6dd5f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 28 deletions.
4 changes: 1 addition & 3 deletions console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
"ngInfiniteScroll": "1.2.1",
"bootstrap-select": "1.6",
"hawkular-charts": "0.4.15",
"hawkular-ui-services": "0.6.3",
"hawkular-charts": "0.5.0",
"hawkular-ui-services": "0.6.10",
"hawkular-ui-services": "0.6.7",
"hawtio-core-navigation": "2.0.51",
"hawtio-core": "2.0.18",
"hawtio-template-cache": "2.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ module HawkularMetrics {
var tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
this.HawkularInventory.Feed.query({environmentId:globalEnvironmentId},
(aFeedList) => {
this.resourceList = [];
angular.forEach(aFeedList, (feed) => {
this.getResourceListForOneFeed(feed.id, tenantId);
});
Expand Down
45 changes: 21 additions & 24 deletions console/src/main/scripts/plugins/metrics/ts/metricsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,16 @@ module HawkularMetrics {
when('/metrics/response-time', {
templateUrl: 'plugins/metrics/html/response-time.html',
resolve: {
hkResourceList: ($filter, $location, $rootScope, $q, HawkularInventory) => {
var resPromise = HawkularInventory.Resource.query({
environmentId: globalEnvironmentId
hkResourceList: function ($route, $filter, $location, $rootScope, $q, HawkularInventory) {
var idParts = $route.current.params.resourceId.split('~');
var feedId = idParts[0];
var resPromise = HawkularInventory.ResourceUnderFeed.query({
environmentId: globalEnvironmentId,
feedId: feedId
}).$promise;
resPromise.then((hkResourceList) => {
resPromise.then(function (hkResourceList) {
$location.path('/metrics/response-time/' + hkResourceList[0].id);
}, () => {
}, function () {
$location.url('/error');
});

Expand All @@ -62,11 +59,11 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/response-time.html',
reloadOnSearch: false,
resolve: {
resource: ($route, $location, HawkularInventory, NotificationsService:INotificationsService) => {
var p = HawkularInventory.Resource.get({
environmentId: globalEnvironmentId,
resourceId: $route.current.params.resourceId
}).$promise;
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
var idParts = $route.current.params.resourceId.split('~');
var feedId = idParts[0];
var p = HawkularInventory.ResourceUnderFeed.get({environmentId: globalEnvironmentId,
feedId: feedId, resourceId: $route.current.params.resourceId}).$promise;
p.then((response:any) => {
return response.properties.url;
},
Expand All @@ -82,11 +79,11 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/availability.html',
reloadOnSearch: false,
resolve: {
resource: ($route, $location, HawkularInventory, NotificationsService:INotificationsService) => {
var p = HawkularInventory.Resource.get({
environmentId: globalEnvironmentId,
resourceId: $route.current.params.resourceId
}).$promise;
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
var idParts = $route.current.params.resourceId.split('~');
var feedId = idParts[0];
var p = HawkularInventory.ResourceUnderFeed.get({environmentId: globalEnvironmentId,
feedId: feedId, resourceId: $route.current.params.resourceId}).$promise;
p.then((response:any) => {
return response.properties.url;
},
Expand All @@ -102,11 +99,11 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/alerts.html',
reloadOnSearch: false,
resolve: {
resource: ($route, $location, HawkularInventory, NotificationsService:INotificationsService) => {
var p = HawkularInventory.Resource.get({
environmentId: globalEnvironmentId,
resourceId: $route.current.params.resourceId
}).$promise;
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
var idParts = $route.current.params.resourceId.split('~');
var feedId = idParts[0];
var p = HawkularInventory.ResourceUnderFeed.get({environmentId: globalEnvironmentId,
feedId: feedId, resourceId: $route.current.params.resourceId}).$promise;
p.then((response:any) => {
return response.properties.url;
},
Expand All @@ -123,13 +120,13 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/app-details/app-server-details.html',
reloadOnSearch: false,
resolve: {
resource: ($route, $location, HawkularInventory, NotificationsService:INotificationsService) => {
var redirectMissingAppServer = () => {
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
var redirectMissingAppServer = function() {
NotificationsService.info('You were redirected to this page because you requested an invalid ' +
'Application Server.');
'Application Server.');
$location.path('/hawkular-ui/app/app-list');
};
var checkAppServerExists = () => {
var checkAppServerExists = function() {
var idParts = $route.current.params.resourceId.split('~');
if (idParts.length !== 2) {
redirectMissingAppServer();
Expand Down

0 comments on commit fd6dd5f

Please sign in to comment.