Erreur !
This commit is contained in:
parent
847e4c04ae
commit
d1991fca2b
2 changed files with 13 additions and 2 deletions
|
@ -13,6 +13,8 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($s
|
||||||
// Retrieve all Data
|
// Retrieve all Data
|
||||||
Compute.pullData(updatePage);
|
Compute.pullData(updatePage);
|
||||||
|
|
||||||
|
Compute.getMachines(function(adzda){});
|
||||||
|
|
||||||
$scope.raiseShowMachineDetailsEvent=function(){
|
$scope.raiseShowMachineDetailsEvent=function(){
|
||||||
var machine={name: "Machine 1", online:true};
|
var machine={name: "Machine 1", online:true};
|
||||||
$rootScope.$broadcast("showMachineDetailsEvent", machine);
|
$rootScope.$broadcast("showMachineDetailsEvent", machine);
|
||||||
|
|
|
@ -17,7 +17,16 @@ mainApp.factory('Compute',[ '$http', 'Identity', function($http, Identity){
|
||||||
var getMachines=function(callback){
|
var getMachines=function(callback){
|
||||||
|
|
||||||
var result=$http.post('../server/index.php',
|
var result=$http.post('../server/index.php',
|
||||||
$.param({"token" : Identity.profile.token, "task" : "Compute"}));
|
$.param({"token" : Identity.getToken(), "task" : "compute", action:"getImage", serverID:"69d5bcc4-2fab-4634-b0d2-f455fee5b7bd"}));
|
||||||
|
|
||||||
|
// Wait and handle the response
|
||||||
|
result.then(function (response){
|
||||||
|
alert(response);
|
||||||
|
callback(parseGetMachinesAnswer(response, false));
|
||||||
|
},function(response){
|
||||||
|
alert(response.status);
|
||||||
|
callback(parseGetMachinesAnswer(response, true));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue