28 lines
590 B
JavaScript
28 lines
590 B
JavaScript
/**
|
|
* The home controller
|
|
*
|
|
* @param {$scope} $scope The $scope service from angular
|
|
*/
|
|
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($scope, Compute, $rootScope)
|
|
{
|
|
|
|
var updatePage=function(){
|
|
// TODO Update graph etc...
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$scope.raiseShowMachineDetailsEvent=function(){
|
|
var callback=function(){
|
|
var data=Compute.getData();
|
|
console.log(data.machines[Object.keys(data.machines)[0]]);
|
|
$rootScope.$broadcast("showMachineDetailsEvent", data.machines[Object.keys(data.machines)[0]]);
|
|
|
|
}
|
|
Compute.pullMachines(callback);
|
|
}
|
|
|
|
|
|
}]);
|