This commit is contained in:
manzerbredes 2016-03-28 11:27:37 +02:00
parent 3cef0ea672
commit 60cfe3ebc0
3 changed files with 9 additions and 3 deletions

View file

@ -7,6 +7,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
{ {
var callMeAfterPullData=function(data){ var callMeAfterPullData=function(data){
console.log(data);
$scope.machines=Compute.getData().machines; $scope.machines=Compute.getData().machines;
Loading.stop(); Loading.stop();
}; };

View file

@ -32,7 +32,7 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
} }
else if(failedToSendRequest){ else if(failedToSendRequest){
requestParserResult.failReason="Failed to send request"; requestParserResult.failReason="Failed to send PullMachine request";
} }
else{ else{
requestParserResult.failReason="Error"; requestParserResult.failReason="Error";
@ -79,7 +79,7 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
data.axioms.images=response.data.Images; data.axioms.images=response.data.Images;
} }
else if(failedToSendRequest){ else if(failedToSendRequest){
requestParserResult.failReason="Failed to send request"; requestParserResult.failReason="Failed to send PullImage request";
} }
else{ else{
requestParserResult.failReason="Error"; requestParserResult.failReason="Error";
@ -101,8 +101,11 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
// Wait and handle the response // Wait and handle the response
result.then(function (response){ result.then(function (response){
alert(Identity.getToken());
callback(parsePullImagesAnswer(response, false)); callback(parsePullImagesAnswer(response, false));
},function(response){ },function(response){
callback(parsePullImagesAnswer(response, true)); callback(parsePullImagesAnswer(response, true));
}); });
}; };
@ -117,6 +120,9 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
if(response.status==0){ if(response.status==0){
pullMachines(callback); pullMachines(callback);
} }
else{
callback(response);
}
} }
pullImages(nextFunction); pullImages(nextFunction);
} }

View file

@ -31,7 +31,6 @@ mainApp.factory('Identity',[ '$http', '$cookies', '$rootScope', function($http,
// If yes, put it into variables // If yes, put it into variables
angular.extend(profile, profileInCookie); angular.extend(profile, profileInCookie);
token=tokenPart_0InCookie+tokenPart_1InCookie; token=tokenPart_0InCookie+tokenPart_1InCookie;
//} //}
// Return I'm Login // Return I'm Login