summaryrefslogtreecommitdiff
path: root/client/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'client/js/controllers')
-rw-r--r--client/js/controllers/home/machineDetails.js1
-rw-r--r--client/js/controllers/home/main.js9
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);