Edit Compute service and home controller
This commit is contained in:
parent
0c31cbdbd4
commit
ff1832adcf
4 changed files with 24 additions and 5 deletions
|
@ -1 +0,0 @@
|
|||
loic@Manzerbredes.home.30343:1455008378
|
|
@ -5,6 +5,13 @@
|
|||
*/
|
||||
mainApp.controller('homeCtrl', [ '$scope', 'Compute', function ($scope, Compute)
|
||||
{
|
||||
|
||||
|
||||
|
||||
var updatePage=function(){
|
||||
// TODO Update graph etc...
|
||||
}
|
||||
|
||||
// Retrieve all Data
|
||||
Compute.pullData(updatePage);
|
||||
|
||||
}]);
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
*/
|
||||
mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($scope, Identity, $rootScope)
|
||||
{
|
||||
|
||||
// Give profile to model
|
||||
$scope.profile=Identity.profile;
|
||||
|
||||
|
||||
// Function to logout
|
||||
$scope.logout=function(){
|
||||
Identity.logout();
|
||||
$rootScope.$broadcast('logoutEvent');
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
|
||||
|
||||
|
||||
|
||||
var data={};
|
||||
data.machines={};
|
||||
|
||||
|
||||
// Parser
|
||||
var parseGetMachinesAnswer=function(response, failedToSendRequest){
|
||||
|
@ -13,17 +17,23 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
|
|||
var getMachines=function(callback){
|
||||
|
||||
var result=$http.post('../server/index.php',
|
||||
$.param({"token" : Identity.profile.token, "task" : "Compute"}));
|
||||
$.param({"token" : Identity.profile.token, "task" : "Compute"}));
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
var pullData=function(callback){
|
||||
// TODO call getMachines etc...
|
||||
}
|
||||
|
||||
|
||||
// Return services objects
|
||||
return {
|
||||
getMachines: getMachines
|
||||
pullData: pullData
|
||||
data:data
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue