diff options
Diffstat (limited to 'client/js/services/Compute.js')
| -rw-r--r-- | client/js/services/Compute.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/client/js/services/Compute.js b/client/js/services/Compute.js index 9f404c4..8148948 100644 --- a/client/js/services/Compute.js +++ b/client/js/services/Compute.js @@ -2,11 +2,12 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){ - + // Create data var data={}; data.machines={}; + // Parser var parseGetMachinesAnswer=function(response, failedToSendRequest){ @@ -15,9 +16,16 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){ // Get Machine var getMachines=function(callback){ + + var params={ + "token" : Identity.getToken(), + "task" : "compute", + "action":"getServer", + "serverId":"69d5bcc4-2fab-4634-b0d2-f455fee5b7bd" + }; var result=$http.post('../server/index.php', - $.param({"token" : Identity.getToken(), "task" : "compute", "action":"getServer", serverId:"69d5bcc4-2fab-4634-b0d2-f455fee5b7bd"})); + $.param(params)); // Wait and handle the response result.then(function (response){ @@ -25,7 +33,7 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){ callback(parseGetMachinesAnswer(response, false)); },function(response){ alert(response.status); - callback(parseGetMachinesAnswer(response, true)); + callback(parseGetMachinesAnswer(response, true)); }); |
