diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-02-28 20:30:57 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-02-28 20:30:57 +0100 |
| commit | d1991fca2b3e9517da9aff571494dbc1374344d9 (patch) | |
| tree | 9a8eeb82a6009ecde32fdb37355082ffc1c3c732 | |
| parent | 847e4c04aea8c56ac4e4b8d12fcb405e78159026 (diff) | |
Erreur !
| -rw-r--r-- | client/js/controllers/home/main.js | 2 | ||||
| -rw-r--r-- | client/js/services/Compute.js | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/client/js/controllers/home/main.js b/client/js/controllers/home/main.js index d93c376..4e3bcda 100644 --- a/client/js/controllers/home/main.js +++ b/client/js/controllers/home/main.js @@ -13,6 +13,8 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($s // Retrieve all Data Compute.pullData(updatePage); + Compute.getMachines(function(adzda){}); + $scope.raiseShowMachineDetailsEvent=function(){ var machine={name: "Machine 1", online:true}; $rootScope.$broadcast("showMachineDetailsEvent", machine); diff --git a/client/js/services/Compute.js b/client/js/services/Compute.js index 70359ee..7e1764f 100644 --- a/client/js/services/Compute.js +++ b/client/js/services/Compute.js @@ -15,9 +15,18 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){ // Get Machine var getMachines=function(callback){ - + var result=$http.post('../server/index.php', - $.param({"token" : Identity.profile.token, "task" : "Compute"})); + $.param({"token" : Identity.getToken(), "task" : "compute", action:"getImage", serverID:"69d5bcc4-2fab-4634-b0d2-f455fee5b7bd"})); + + // Wait and handle the response + result.then(function (response){ + alert(response); + callback(parseGetMachinesAnswer(response, false)); + },function(response){ + alert(response.status); + callback(parseGetMachinesAnswer(response, true)); + }); }; |
