Edit machineDetails

This commit is contained in:
manzerbredes 2016-03-01 20:51:08 +01:00
parent f1628e280a
commit 5ef1c9b8b1
5 changed files with 48 additions and 40 deletions

View file

@ -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});
});

View file

@ -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);