-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #9 get IP adresses automatically
add initial ui
- Loading branch information
1 parent
3f07c66
commit 744a76c
Showing
6 changed files
with
123 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div class="modal-header"> | ||
<h3 class="modal-title">Proessing Data</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="container-fluid"> | ||
<div class="row" data-ng-show="state.ip.register"> | ||
<div class="col-md-12"> | ||
<h4>Register IPs</h4> | ||
<uib-progressbar max="state.registerips.max" value="state.registerips.progress"> | ||
<span style="color:white; white-space:nowrap;"> | ||
{{state.registerips.progress}} / {{state.registerips.max}} | ||
</span> | ||
</uib-progressbar> | ||
</div> | ||
</div> | ||
<div class="row" data-ng-show="{{wizard.internet.share && state.internet.vpn03.generate}}"> | ||
<div class="col-md-12"> | ||
<h4>Generate VPN Certificate and Key </h4> | ||
<uib-progressbar max="state.generatevpn.max" value="state.generatevpn.progress"> | ||
<span style="color:white; white-space:nowrap;"> | ||
{{state.generatevpn.progress}} / {{state.generatevpn.max}} | ||
</span> | ||
</uib-progressbar> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button> | ||
<button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
angular.module('WizardApp').controller('DialogController', function ($scope, $modalInstance, state, wizard, $interval) { | ||
|
||
console.log(state); | ||
|
||
$scope.state = state; | ||
$scope.wizard = wizard; | ||
$scope.state.registerips = { | ||
max: 4, | ||
progress: 0 | ||
}; | ||
$scope.state.generatevpn = { | ||
max: 4, | ||
progress: 0 | ||
}; | ||
|
||
$scope.registerIPs = function() { | ||
//call register ips | ||
//render confirmation code field | ||
//check confirmation code | ||
//write ips to wizard config | ||
|
||
//just some testcode | ||
$interval(function() { | ||
if ($scope.state.registerips.progress < $scope.state.registerips.max) { | ||
$scope.state.registerips.progress++; | ||
} | ||
},1500,$scope.state.registerips.max); | ||
}; | ||
|
||
$scope.generateVPN03CertAndKey = function() { | ||
/* | ||
* since this is not handled on the client we need a service on the router | ||
* that perfomrs the following tasks and reports a status | ||
* | ||
* ask vpn server to generate cert and key | ||
* download file | ||
* untar file and copy cert and key to correct location | ||
* write file location to config file | ||
*/ | ||
|
||
//just some testcode | ||
$interval(function() { | ||
if ($scope.state.generatevpn.progress < $scope.state.generatevpn.max) { | ||
$scope.state.generatevpn.progress++; | ||
} | ||
},1200,$scope.state.registerips.max); | ||
|
||
// show download cert and key tar file button or but everything in the "Download Config"? | ||
}; | ||
|
||
$scope.ok = function () { | ||
$modalInstance.close($scope.selected.item); | ||
}; | ||
|
||
$scope.cancel = function () { | ||
$modalInstance.dismiss('cancel'); | ||
}; | ||
|
||
if ($scope.state.ip.register) { | ||
$scope.registerIPs(); | ||
} | ||
|
||
if ($scope.wizard.internet.share && $scope.state.internet.vpn03.generate) { | ||
$scope.generateVPN03CertAndKey(); | ||
} | ||
}); |