summaryrefslogtreecommitdiff
path: root/client/js/controllers/home
diff options
context:
space:
mode:
authorYoggzo <yogg@epsina.com>2016-03-02 10:58:01 +0100
committerYoggzo <yogg@epsina.com>2016-03-02 10:58:01 +0100
commitd1bd9b4a0c3168eec28ea1c3992748afe1953218 (patch)
tree538ef3d0b37e1dcb0528ce6395c3a82a672a5089 /client/js/controllers/home
parentae1100c16880d4bae77513ec433ac6734da8dea4 (diff)
parentb6d7d2c30efe5e9758072bb82ea3a947bda7fd1d (diff)
Merge branch 'develop' into Evan
Diffstat (limited to 'client/js/controllers/home')
-rw-r--r--client/js/controllers/home/machineDetails.js4
-rw-r--r--client/js/controllers/home/main.js30
2 files changed, 24 insertions, 10 deletions
diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js
index f84a073..24fac42 100644
--- a/client/js/controllers/home/machineDetails.js
+++ b/client/js/controllers/home/machineDetails.js
@@ -9,8 +9,10 @@ mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$
$scope.machine={};
$("#waitingForToggleMachine").hide();
- $scope.$on('showMachineDetailsEvent', function(eventName ,machine){
+ $scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){
$scope.machine=machine;
+ $scope.axioms=axioms;
+ 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 4e3bcda..f84f625 100644
--- a/client/js/controllers/home/main.js
+++ b/client/js/controllers/home/main.js
@@ -3,21 +3,33 @@
*
* @param {$scope} $scope The $scope service from angular
*/
-mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($scope, Compute, $rootScope)
+mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', function ($scope, Compute, $rootScope, Loading, Identity)
{
- var updatePage=function(){
- // TODO Update graph etc...
+ var callMeAfterPullData=function(data){
+ $scope.machines=Compute.getData().machines;
+ Loading.stop();
}
- // Retrieve all Data
- Compute.pullData(updatePage);
+ ;
+ if(Compute.getData().machines == null && Identity.isAlreadyLogin()){
+ Loading.start();
+ Compute.pullData(callMeAfterPullData);
+ }
+
+
+
+
+ $scope.raiseShowMachineDetailsEvent=function(id){
- Compute.getMachines(function(adzda){});
+ var callback=function(){
+ Loading.stop();
+ var data=Compute.getData();
+ $rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
- $scope.raiseShowMachineDetailsEvent=function(){
- var machine={name: "Machine 1", online:true};
- $rootScope.$broadcast("showMachineDetailsEvent", machine);
+ }
+ Loading.start();
+ Compute.pullMachines(callback);
}