diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-02 20:46:24 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-03-02 20:46:24 +0100 |
| commit | e2be86814e8ac92778bfa9fc49e1d02946a7efbc (patch) | |
| tree | 0ab5586ab71bf37fedbee66fb2ce002b02ecba75 | |
| parent | fa5a48bc3a76b109f6611620b6e56f3024def029 (diff) | |
Clean some things
| -rw-r--r-- | client/index.html | 27 | ||||
| -rw-r--r-- | client/js/controllers/home/machineDetails.js | 10 | ||||
| -rw-r--r-- | client/partials/home/machineDetails.html | 2 | ||||
| -rw-r--r-- | client/partials/status.html (renamed from client/partials/nav.html) | 0 |
4 files changed, 21 insertions, 18 deletions
diff --git a/client/index.html b/client/index.html index 8ca2b9f..ca6bbe6 100644 --- a/client/index.html +++ b/client/index.html @@ -11,27 +11,28 @@ <link rel="stylesheet" href="./css/style.css"> - <!--[if lt IE 9]> - <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> - <![endif]--> + <!--[if lt IE 9]> + <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> </head> <body> - + + <!-- Overlay --> + <div ng-include="'./partials/login.html'"></div> + <div ng-include="'./partials/home/machineDetails.html'"></div> + <div ng-include="'./partials/loading.html'"></div> + + + <!-- MAIN GRID --> <div class="container-lg"> <!-- Status bar --> <div class="row" ng-controller="statusCtrl"> <div class="col-lg-12"> - <!-- Login Overlay --> - <div ng-include="'./partials/login.html'"></div> - <!-- Machine Details Overlay --> - <div ng-include="'./partials/home/machineDetails.html'"></div> - <div ng-include="'./partials/loading.html'"></div> - - <!-- Nav --> - <div ng-include="'./partials/nav.html'"></div> + <!-- Status bar --> + <div ng-include="'./partials/status.html'"></div> </div> </div> <!-- Page content --> @@ -56,7 +57,7 @@ </div> </div> </div> - </div> + </div> </div> </div> </div> diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js index 24fac42..c015eaa 100644 --- a/client/js/controllers/home/machineDetails.js +++ b/client/js/controllers/home/machineDetails.js @@ -6,23 +6,25 @@ mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout) { + // Init scope $scope.machine={}; - $("#waitingForToggleMachine").hide(); + $scope.machineIsStarting=false; // For loading icon + $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(); + // Display gif + $scope.machineIsStarting=true; // Fake timeout $timeout(function(){ - $("#waitingForToggleMachine").hide(); + $scope.machineIsStarting=false; }, 3000); $timeout(function(){ $scope.machine.online=!$scope.machine.online; diff --git a/client/partials/home/machineDetails.html b/client/partials/home/machineDetails.html index 47a65fb..c4c8a38 100644 --- a/client/partials/home/machineDetails.html +++ b/client/partials/home/machineDetails.html @@ -26,7 +26,7 @@ <button class="btn btn-danger" ng-if="machine.status=='ACTIVE'" ng-click="toggleMachineState()">Turn Off</button> <button class="btn btn-success" ng-if="machine.status!=='ACTIVE'" ng-click="toggleMachineState()">Turn On</button> - <img src="images/spin/32x32/Preloader_1.gif" id="waitingForToggleMachine"></span> + <img src="images/spin/32x32/Preloader_1.gif" ng-if="machineIsStarting"></span> </div> diff --git a/client/partials/nav.html b/client/partials/status.html index 01b9079..01b9079 100644 --- a/client/partials/nav.html +++ b/client/partials/status.html |
