Clean some things
This commit is contained in:
parent
fa5a48bc3a
commit
e2be86814e
4 changed files with 21 additions and 18 deletions
|
@ -11,27 +11,28 @@
|
||||||
<link rel="stylesheet" href="./css/style.css">
|
<link rel="stylesheet" href="./css/style.css">
|
||||||
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
<body>
|
<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 -->
|
<!-- MAIN GRID -->
|
||||||
<div class="container-lg">
|
<div class="container-lg">
|
||||||
<!-- Status bar -->
|
<!-- Status bar -->
|
||||||
<div class="row" ng-controller="statusCtrl">
|
<div class="row" ng-controller="statusCtrl">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<!-- Login Overlay -->
|
<!-- Status bar -->
|
||||||
<div ng-include="'./partials/login.html'"></div>
|
<div ng-include="'./partials/status.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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Page content -->
|
<!-- Page content -->
|
||||||
|
@ -56,7 +57,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,23 +6,25 @@
|
||||||
mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout)
|
mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Init scope
|
||||||
$scope.machine={};
|
$scope.machine={};
|
||||||
$("#waitingForToggleMachine").hide();
|
$scope.machineIsStarting=false; // For loading icon
|
||||||
|
|
||||||
|
|
||||||
$scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){
|
$scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){
|
||||||
$scope.machine=machine;
|
$scope.machine=machine;
|
||||||
$scope.axioms=axioms;
|
$scope.axioms=axioms;
|
||||||
console.log(machine);
|
|
||||||
$('#machineDetailsModal').modal({backdrop: false, keyboard: true});
|
$('#machineDetailsModal').modal({backdrop: false, keyboard: true});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$scope.toggleMachineState=function(){
|
$scope.toggleMachineState=function(){
|
||||||
$("#waitingForToggleMachine").show();
|
// Display gif
|
||||||
|
$scope.machineIsStarting=true;
|
||||||
|
|
||||||
// Fake timeout
|
// Fake timeout
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
$("#waitingForToggleMachine").hide();
|
$scope.machineIsStarting=false;
|
||||||
}, 3000);
|
}, 3000);
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
$scope.machine.online=!$scope.machine.online;
|
$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-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>
|
<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>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue