summaryrefslogtreecommitdiff
path: root/client/js/controllers/home/machineDetails.js
diff options
context:
space:
mode:
authorEole <EoleDev@outlook.fr>2016-04-27 16:42:28 +0200
committerEole <EoleDev@outlook.fr>2016-04-27 16:42:28 +0200
commit49f416dc5061032e0514ea0cfeceaca37d13e432 (patch)
tree1202ac2a6fa860b8929afdc886c94fc50bd0a1de /client/js/controllers/home/machineDetails.js
parentc7edd70b5e5b0f5159c78ce3d924d4e7f60db816 (diff)
parentc9202d9113210981ae47df40511645da2ee140df (diff)
Merge branch 'develop' into Eole_Graph
Conflicts: client/index.html client/js/controllers/home/home.js client/partials/home/home.html
Diffstat (limited to 'client/js/controllers/home/machineDetails.js')
-rw-r--r--client/js/controllers/home/machineDetails.js58
1 files changed, 30 insertions, 28 deletions
diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js
index c015eaa..9c8c602 100644
--- a/client/js/controllers/home/machineDetails.js
+++ b/client/js/controllers/home/machineDetails.js
@@ -3,41 +3,43 @@
*
* @param {$scope} $scope The $scope service from angular
*/
-mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout)
-{
+mainApp.controller('machineDetailsCtrl', ['$scope', 'Compute', '$rootScope', '$timeout', 'Identity', function ($scope, Compute, $rootScope, $timeout, Identity)
+ {
- // Init scope
- $scope.machine={};
- $scope.machineIsStarting=false; // For loading icon
+ // Init scope
+ $scope.machine = {};
+ $scope.machineIsStarting = false; // For loading icon
- $scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){
- $scope.machine=machine;
- $scope.axioms=axioms;
- $('#machineDetailsModal').modal({backdrop: false, keyboard: true});
- });
+ // When we need to show details of machine
+ $scope.$on('showMachineDetailsEvent', function (eventName, machine, axioms) {
+ $scope.machine = machine;
+ $scope.axioms = axioms;
+ $('#machineDetailsModal').modal({backdrop: false, keyboard: true});
+ });
+ // Try to stop or start a machine
+ $scope.toggleMachineState = function () {
+ // Display gif
+ $scope.machineIsStarting = true;
- $scope.toggleMachineState=function(){
- // Display gif
- $scope.machineIsStarting=true;
+ // Fake timeout
+ $timeout(function () {
+ $scope.machineIsStarting = false;
+ }, 3000);
+ $timeout(function () {
+ $scope.machine.online = !$scope.machine.online;
- // Fake timeout
- $timeout(function(){
- $scope.machineIsStarting=false;
- }, 3000);
- $timeout(function(){
- $scope.machine.online=!$scope.machine.online;
+ }, 3000);
- }, 3000);
-
- };
+ };
- $scope.applyModifications=function(){
- //Todo
- }
-
+ // Apply modifications
+ $scope.applyModifications = function () {
+ //Todo
+ };
-
-}]);
+
+
+ }]);