Skip to content

Commit

Permalink
updating to new ui-services, volume 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jkremser committed Aug 21, 2015
1 parent e940f0f commit ec5079a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion console/src/main/scripts/bower.json
Expand Up @@ -21,7 +21,7 @@
"angular-toastr": "1.4.1",
"bootstrap-select": "1.6",
"hawkular-charts": "~0.4.11",
"hawkular-ui-services": "Jiri-Kremser/hawkular-ui-services#HAWKULAR-565",
"hawkular-ui-services": "Jiri-Kremser/hawkular-ui-services#edc2d761b435ecc5428dacfb298dab28e543a3ea",
"hawtio-core-navigation": "2.0.51",
"hawtio-core": "2.0.16",
"hawtio-template-cache": "2.0.3",
Expand Down
Expand Up @@ -119,6 +119,7 @@ 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
20 changes: 7 additions & 13 deletions console/src/main/scripts/plugins/metrics/ts/metricsPlugin.ts
Expand Up @@ -60,10 +60,8 @@ module HawkularMetrics {
reloadOnSearch: false,
resolve: {
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;
var p = HawkularInventory.Resource.get({environmentId: globalEnvironmentId,
resourcePath: $route.current.params.resourceId}).$promise;
p.then((response:any) => {
return response.properties.url;
},
Expand All @@ -80,10 +78,8 @@ module HawkularMetrics {
reloadOnSearch: false,
resolve: {
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;
var p = HawkularInventory.Resource.get({environmentId: globalEnvironmentId,
resourcePath: $route.current.params.resourceId}).$promise;
p.then((response:any) => {
return response.properties.url;
},
Expand All @@ -100,10 +96,8 @@ module HawkularMetrics {
reloadOnSearch: false,
resolve: {
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;
var p = HawkularInventory.Resource.get({environmentId: globalEnvironmentId,
resourcePath: $route.current.params.resourceId}).$promise;
p.then((response:any) => {
return response.properties.url;
},
Expand Down Expand Up @@ -135,7 +129,7 @@ module HawkularMetrics {
var p = HawkularInventory.ResourceUnderFeed.get({
environmentId: globalEnvironmentId,
feedId: idParts[0],
resourceId: $route.current.params.resourceId + '~~'
resourcePath: $route.current.params.resourceId + '~~'
}).$promise;
p.then((response) => {
return response;
Expand Down
8 changes: 4 additions & 4 deletions console/src/main/scripts/plugins/metrics/ts/urlList.ts
Expand Up @@ -136,9 +136,9 @@ module HawkularMetrics {
}, metric).$promise;

var associateResourceWithMetrics = () =>
this.HawkularInventory.ResourceMetric.save({
this.HawkularInventory.MetricOfResource.save({
environmentId: globalEnvironmentId,
resourceId: resourceId
resourcePath: resourceId
}, ['../' + metricsIds[0], '../' + metricsIds[1]]).$promise;

/// For right now we will just Register a couple of metrics automatically
Expand Down Expand Up @@ -203,7 +203,7 @@ module HawkularMetrics {
}
res['traits'] = traitsArray.join(' | ');
promises.push(this.HawkularMetric.GaugeMetricData(tenantId).queryMetrics({
resourceId: res.id, gaugeId: (res.id + '.status.duration'),
resourcePath: res.id, gaugeId: (res.id + '.status.duration'),
start: moment().subtract(1, 'hours').valueOf(), end: moment().valueOf()
}, (resource) => {
res['responseTime'] = resource;
Expand Down Expand Up @@ -278,7 +278,7 @@ module HawkularMetrics {
var removeResource = () =>
this.HawkularInventory.Resource.delete({
environmentId: globalEnvironmentId,
resourceId: this.resource.id
resourcePath: this.resource.id
}).$promise;

this.$q.all([deleteMetric(metricsIds[0]),
Expand Down

0 comments on commit ec5079a

Please sign in to comment.