summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2016-02-18 18:06:06 +0100
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2016-02-18 18:06:06 +0100
commitd3047bb539a2256cf357784ff49e0ad58e638500 (patch)
tree1938dab3f617cc7b54d1eb6bc439c78a113ac565 /client
parentf90968d920f236faa5419aaf6ef189a120129703 (diff)
Add compute service
Diffstat (limited to 'client')
-rw-r--r--client/index.html3
-rw-r--r--client/js/controllers/home/main.js4
-rw-r--r--client/js/services/Compute.js30
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
+ };
+
+
+}]);