summaryrefslogtreecommitdiff
path: root/client/js/controllers/home/machineDetails.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/js/controllers/home/machineDetails.js')
-rw-r--r--client/js/controllers/home/machineDetails.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js
new file mode 100644
index 0000000..24fac42
--- /dev/null
+++ b/client/js/controllers/home/machineDetails.js
@@ -0,0 +1,41 @@
+/**
+ * The home controller
+ *
+ * @param {$scope} $scope The $scope service from angular
+ */
+mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout)
+{
+
+ $scope.machine={};
+ $("#waitingForToggleMachine").hide();
+
+ $scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){
+ $scope.machine=machine;
+ $scope.axioms=axioms;
+ console.log(machine);
+ $('#machineDetailsModal').modal({backdrop: false, keyboard: true});
+ });
+
+
+ $scope.toggleMachineState=function(){
+ $("#waitingForToggleMachine").show();
+
+ // Fake timeout
+ $timeout(function(){
+ $("#waitingForToggleMachine").hide();
+ }, 3000);
+ $timeout(function(){
+ $scope.machine.online=!$scope.machine.online;
+
+ }, 3000);
+
+
+ };
+
+ $scope.applyModifications=function(){
+ //Todo
+ }
+
+
+
+}]);