Clean some things
This commit is contained in:
parent
fa5a48bc3a
commit
e2be86814e
4 changed files with 21 additions and 18 deletions
|
@ -19,19 +19,20 @@
|
|||
|
||||
<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 -->
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue