summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/index.html27
-rw-r--r--client/js/controllers/home/machineDetails.js10
-rw-r--r--client/partials/home/machineDetails.html2
-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 @@
&nbsp;
<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>
- &nbsp;<img src="images/spin/32x32/Preloader_1.gif" id="waitingForToggleMachine"></span>
+ &nbsp;<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