Add compute service
This commit is contained in:
parent
f90968d920
commit
d3047bb539
3 changed files with 34 additions and 3 deletions
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
|
||||
});
|
||||
}]);
|
||||
|
|
30
client/js/services/Compute.js
Normal file
30
client/js/services/Compute.js
Normal 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
|
||||
};
|
||||
|
||||
|
||||
}]);
|
Loading…
Add table
Reference in a new issue