diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-01 20:51:08 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-01 20:51:08 +0100 |
| commit | 5ef1c9b8b1ab47b659f512db86e51dacf1bec860 (patch) | |
| tree | 9e39ea809765f807bcb92bd6e16161e1444a81f7 /client/js/controllers/home | |
| parent | f1628e280abaf47bfdcabc7d463ce6ad5d0f0752 (diff) | |
Edit machineDetails
Diffstat (limited to 'client/js/controllers/home')
| -rw-r--r-- | client/js/controllers/home/machineDetails.js | 1 | ||||
| -rw-r--r-- | client/js/controllers/home/main.js | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js index f84a073..7476c69 100644 --- a/client/js/controllers/home/machineDetails.js +++ b/client/js/controllers/home/machineDetails.js @@ -11,6 +11,7 @@ mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$ $scope.$on('showMachineDetailsEvent', function(eventName ,machine){ $scope.machine=machine; + console.log(machine); $('#machineDetailsModal').modal({backdrop: false, keyboard: true}); }); diff --git a/client/js/controllers/home/main.js b/client/js/controllers/home/main.js index ee564b2..b44836b 100644 --- a/client/js/controllers/home/main.js +++ b/client/js/controllers/home/main.js @@ -6,18 +6,19 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($scope, Compute, $rootScope) { - var updatePage=function(){ - // TODO Update graph etc... + var callMeAfterGetMachines=function(data){ + $scope.machines=Compute.getData().machines; } + Compute.pullMachines(callMeAfterGetMachines); - $scope.raiseShowMachineDetailsEvent=function(){ + $scope.raiseShowMachineDetailsEvent=function(id){ var callback=function(){ var data=Compute.getData(); - $rootScope.$broadcast("showMachineDetailsEvent", data.machines[Object.keys(data.machines)[0]]); + $rootScope.$broadcast("showMachineDetailsEvent", data.machines[id]); } Compute.pullMachines(callback); |
