Skip to content

Commit ec5079a

Browse files
committedAug 21, 2015
updating to new ui-services, volume 2
1 parent e940f0f commit ec5079a

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed
 

‎console/src/main/scripts/bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"angular-toastr": "1.4.1",
2222
"bootstrap-select": "1.6",
2323
"hawkular-charts": "~0.4.11",
24-
"hawkular-ui-services": "Jiri-Kremser/hawkular-ui-services#HAWKULAR-565",
24+
"hawkular-ui-services": "Jiri-Kremser/hawkular-ui-services#edc2d761b435ecc5428dacfb298dab28e543a3ea",
2525
"hawtio-core-navigation": "2.0.51",
2626
"hawtio-core": "2.0.16",
2727
"hawtio-template-cache": "2.0.3",

‎console/src/main/scripts/plugins/metrics/ts/metricsAppServerList.ts

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ module HawkularMetrics {
119119
var tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;
120120
this.HawkularInventory.Feed.query({environmentId:globalEnvironmentId},
121121
(aFeedList) => {
122+
this.resourceList = [];
122123
angular.forEach(aFeedList, (feed) => {
123124
this.getResourceListForOneFeed(feed.id, tenantId);
124125
});

‎console/src/main/scripts/plugins/metrics/ts/metricsPlugin.ts

+7-13
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ module HawkularMetrics {
6060
reloadOnSearch: false,
6161
resolve: {
6262
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
63-
var idParts = $route.current.params.resourceId.split('~');
64-
var feedId = idParts[0];
65-
var p = HawkularInventory.ResourceUnderFeed.get({environmentId: globalEnvironmentId,
66-
feedId: feedId, resourceId: $route.current.params.resourceId}).$promise;
63+
var p = HawkularInventory.Resource.get({environmentId: globalEnvironmentId,
64+
resourcePath: $route.current.params.resourceId}).$promise;
6765
p.then((response:any) => {
6866
return response.properties.url;
6967
},
@@ -80,10 +78,8 @@ module HawkularMetrics {
8078
reloadOnSearch: false,
8179
resolve: {
8280
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
83-
var idParts = $route.current.params.resourceId.split('~');
84-
var feedId = idParts[0];
85-
var p = HawkularInventory.ResourceUnderFeed.get({environmentId: globalEnvironmentId,
86-
feedId: feedId, resourceId: $route.current.params.resourceId}).$promise;
81+
var p = HawkularInventory.Resource.get({environmentId: globalEnvironmentId,
82+
resourcePath: $route.current.params.resourceId}).$promise;
8783
p.then((response:any) => {
8884
return response.properties.url;
8985
},
@@ -100,10 +96,8 @@ module HawkularMetrics {
10096
reloadOnSearch: false,
10197
resolve: {
10298
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
103-
var idParts = $route.current.params.resourceId.split('~');
104-
var feedId = idParts[0];
105-
var p = HawkularInventory.ResourceUnderFeed.get({environmentId: globalEnvironmentId,
106-
feedId: feedId, resourceId: $route.current.params.resourceId}).$promise;
99+
var p = HawkularInventory.Resource.get({environmentId: globalEnvironmentId,
100+
resourcePath: $route.current.params.resourceId}).$promise;
107101
p.then((response:any) => {
108102
return response.properties.url;
109103
},
@@ -135,7 +129,7 @@ module HawkularMetrics {
135129
var p = HawkularInventory.ResourceUnderFeed.get({
136130
environmentId: globalEnvironmentId,
137131
feedId: idParts[0],
138-
resourceId: $route.current.params.resourceId + '~~'
132+
resourcePath: $route.current.params.resourceId + '~~'
139133
}).$promise;
140134
p.then((response) => {
141135
return response;

‎console/src/main/scripts/plugins/metrics/ts/urlList.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ module HawkularMetrics {
136136
}, metric).$promise;
137137

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

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.