summaryrefslogtreecommitdiff
path: root/client/js/services/Compute.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/js/services/Compute.js')
-rw-r--r--client/js/services/Compute.js13
1 files changed, 11 insertions, 2 deletions
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));
+ });
};