diff options
| -rw-r--r-- | client/index.html | 3 | ||||
| -rw-r--r-- | client/js/controllers/home/main.js | 4 | ||||
| -rw-r--r-- | client/js/services/Compute.js | 30 |
3 files changed, 34 insertions, 3 deletions
diff --git a/client/index.html b/client/index.html index 26430f9..ba183df 100644 --- a/client/index.html +++ b/client/index.html @@ -75,7 +75,8 @@ <!-- Include services --> <script src="./js/services/Identity.js"></script> <script src="./js/services/Image.js"></script> - + <script src="./js/services/Compute.js"></script> + <!-- Include controller --> <script src="./js/controllers/login.js"></script> <script src="./js/controllers/status.js"></script> diff --git a/client/js/controllers/home/main.js b/client/js/controllers/home/main.js index e629779..d42e413 100644 --- a/client/js/controllers/home/main.js +++ b/client/js/controllers/home/main.js @@ -3,8 +3,8 @@ * * @param {$scope} $scope The $scope service from angular */ -mainApp.controller('homeCtrl', function ($scope) +mainApp.controller('homeCtrl', [ '$scope', 'Compute', function ($scope, Compute) { -});
\ No newline at end of file +}]); diff --git a/client/js/services/Compute.js b/client/js/services/Compute.js new file mode 100644 index 0000000..748510e --- /dev/null +++ b/client/js/services/Compute.js @@ -0,0 +1,30 @@ + +mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){ + + + + // Parser + var parseGetMachinesAnswer=function(response, failedToSendRequest){ + + }; + + + // Get Machine + var getMachines=function(callback){ + + var result=$http.post('../server/index.php', + $.param({"token" : Identity.profile.token, "task" : "Compute"})); + + + + }; + + + + // Return services objects + return { + getMachines: getMachines + }; + + +}]); |
