Edit machineDetails
This commit is contained in:
parent
f1628e280a
commit
5ef1c9b8b1
5 changed files with 48 additions and 40 deletions
|
@ -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});
|
||||
});
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue