Add compute service

This commit is contained in:
manzerbredes 2016-02-18 18:06:06 +01:00
parent f90968d920
commit d3047bb539
3 changed files with 34 additions and 3 deletions

View file

@ -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>

View file

@ -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)
{
});
}]);

View file

@ -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
};
}]);