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

Commit

Permalink
HAWKULAR-370 Add new deployment wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
mtho11 committed Sep 9, 2015
1 parent fd6dd5f commit cfbcc29
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"angular-toastr": "1.4.1",
"ngInfiniteScroll": "1.2.1",
"bootstrap-select": "1.6",
"hawkular-charts": "0.4.15",
"hawkular-charts": "0.5.0",
"hawkular-ui-services": "0.6.7",
"hawtio-core-navigation": "2.0.51",
"hawtio-core": "2.0.18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ <h4 class="modal-title">Add Deployment</h4>

</wz-step>

</wizard>
</wizard>
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,26 @@ module HawkularMetrics {
}


public getResourceList(currentTenantId?:TenantId):void {
///this.alertList = []; FIXME: when we have alerts for app server
public getResourceList(currentTenantId?: TenantId): any {
this.alertList = []; // FIXME: when we have alerts for app server
let tenantId:TenantId = currentTenantId || this.$rootScope.currentPersona.id;

this.HawkularInventory.ResourceOfType.query({resourceTypeId: 'Deployment'},
(aResourceList, getResponseHeaders) => {
let idParts = this.$routeParams.resourceId.split('~');
let feedId = idParts[0];
this.HawkularInventory.ResourceOfTypeUnderFeed.query({
environmentId: globalEnvironmentId,
feedId: feedId,
resourceTypeId: 'Deployment'}, (aResourceList, getResponseHeaders) => {
let promises = [];
let tmpResourceList = [];
angular.forEach(aResourceList, (res:any) => {
angular.forEach(aResourceList, function(res: any) {
if (res.id.startsWith(new RegExp(this.$routeParams.resourceId + '~/'))) {
tmpResourceList.push(res);
res.selected = _.result(_.find(this.resourceList, {'id': res.id}), 'selected');
promises.push(this.HawkularMetric.AvailabilityMetricData(this.$rootScope.currentPersona.id).query({
tenantId: tenantId,
availabilityId: 'AI~R~[' + res.id + ']~AT~Deployment Status~Deployment Status',
distinct: true
}, (resource) => {
let latestData = _.last(resource);
distinct: true}, (resource) => {
let latestData = resource[resource.length-1];
if (latestData) {
res['state'] = latestData['value'];
res['updateTimestamp'] = latestData['timestamp'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@ module HawkularMetrics {
},
link: (scope, element ) => {
element.bind('change', (changeEvent) => {
var theFile = changeEvent.target.files[0];
var reader = new FileReader();
let theFile = changeEvent.target.files[0];
let reader = new FileReader();

//reader.onload = (loadEvent:any) => {
// scope.$apply(() => {
// scope.fileread = loadEvent.target.result;
// });
//};
reader.onload = (readEvent:any) => {
if (readEvent.target.readyState === FileReader.DONE) {
scope.$apply(() => {
Expand Down
10 changes: 5 additions & 5 deletions console/src/main/scripts/plugins/metrics/ts/metricsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module HawkularMetrics {
}).$promise;
resPromise.then(function (hkResourceList) {
$location.path('/metrics/response-time/' + hkResourceList[0].id);
}, function () {
}, () => {
$location.url('/error');
});

Expand Down Expand Up @@ -120,13 +120,13 @@ module HawkularMetrics {
templateUrl: 'plugins/metrics/html/app-details/app-server-details.html',
reloadOnSearch: false,
resolve: {
resource: function ($route, $location, HawkularInventory, NotificationsService:INotificationsService) {
var redirectMissingAppServer = function() {
resource: ($route, $location, HawkularInventory, NotificationsService:INotificationsService) => {
var redirectMissingAppServer = () => {
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 = function() {
var checkAppServerExists = () => {
var idParts = $route.current.params.resourceId.split('~');
if (idParts.length !== 2) {
redirectMissingAppServer();
Expand Down

0 comments on commit cfbcc29

Please sign in to comment.