mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-28 01:47:19 +01:00
Added wps functions
This commit is contained in:
parent
7c3e4cb782
commit
cb5ca4f1ae
14 changed files with 949 additions and 411 deletions
|
|
@ -71,6 +71,11 @@ angular.module("luci")
|
|||
"uci.revert",
|
||||
"uci.changes",
|
||||
"uci.configs",
|
||||
"wps.pbc",
|
||||
"wps.genpin",
|
||||
"wps.setpin",
|
||||
"wps.showpin",
|
||||
"wps.stapin",
|
||||
"asterisk.call_log.list",
|
||||
"asterisk.status",
|
||||
"luci2.system.password_set",
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ $juci.module("core")
|
|||
.directive("luciConfigLines", function(){
|
||||
var plugin_root = $juci.module("core").plugin_root;
|
||||
return {
|
||||
template: '<table class="table" ><tbody ng-transclude></tbody></table>',
|
||||
template: '<div class="table" ><div ng-transclude></div></div>',
|
||||
replace: true,
|
||||
transclude: true
|
||||
};
|
||||
|
|
@ -42,7 +42,13 @@ $juci.module("core")
|
|||
.directive("luciConfigLine", function(){
|
||||
var plugin_root = $juci.module("core").plugin_root;
|
||||
return {
|
||||
template: '<tr><td class="col-xs-6"><label style="font-size: 1.2em">{{title}}</label></td><td class="col-xs-6"><div class="pull-right" ng-transclude></div></td></tr>',
|
||||
template: '<div class="row" style="margin-top: 20px; ">'+
|
||||
'<div class="col-md-6">'+
|
||||
'<label style="font-size: 1.2em">{{title}}</label>'+
|
||||
'</div>'+
|
||||
'<div class="col-md-6">'+
|
||||
'<div class="pull-right" ng-transclude></div>'+
|
||||
'</div></div>',
|
||||
replace: true,
|
||||
scope: {
|
||||
title: "@"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ $juci.module("wifi")
|
|||
window.uci = $uci;
|
||||
$scope.interfaces = $uci.wireless['@wifi-iface'];
|
||||
$scope.status = $uci.wireless.status;
|
||||
$scope.easybox = $uci.easybox.settings;
|
||||
$scope.$apply();
|
||||
|
||||
next();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<luci-config-heading>{{ 'Schedule' | translate }}</luci-config-heading>
|
||||
<luci-config-info>{{ 'wifi.schedule.info' | translate }}</luci-config-info>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'Schedule Function'|translate}}"><switch id="enabled" name="enabled" ng-model="settings.scheduling.value" class="green"></switch></luci-config-line>
|
||||
<luci-config-line title="{{'Schedule Function'|translate}}"><switch id="enabled" name="enabled" ng-model="status.schedule.value" class="green"></switch></luci-config-line>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
<luci-config-apply></luci-config-apply>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
$juci.module("wifi")
|
||||
.controller("WifiSchedulePageCtrl", function($scope, $uci){
|
||||
$uci.sync(["wireless"]).done(function(){
|
||||
$scope.settings = $uci.wireless.settings;
|
||||
$scope.status = $uci.wireless.status;
|
||||
$scope.$apply();
|
||||
}).fail(function(err){
|
||||
console.log("failed to sync config: "+err);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,55 @@
|
|||
<luci-config-line title="{{'WPS Function'|translate}}"><switch id="enabled" name="enabled" ng-model="easybox.settings.wpsbutton.value" class="green"></switch></luci-config-line>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
<luci-config-apply></luci-config-apply>
|
||||
<luci-config-section>
|
||||
<luci-config-lines ng-repeat="interface in wireless['@wifi-iface']">
|
||||
<luci-config-line title="{{'Enable WPS on '|translate}} {{interface.ssid.value}}">
|
||||
<switch id="enabled" name="enabled" ng-model="interface.wps_pbc.value" class="green" inverted></switch>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
<h2 translate>WPS PBC</h2>
|
||||
<p translate>wifi.wps.pbc.info</p>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'Pressing WiFi on/off button on EasyBox for long time activates pairing '|translate}}">
|
||||
<switch id="enabled" name="enabled" ng-model="easybox.wpsbutton.value" class="green" inverted></switch>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Pair (within 2 minutes)'|translate}}">
|
||||
<button class="btn btn-default" ng-click="onPairPBC()" translate>Pair</button>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
<h2 translate>WPS with own PIN</h2>
|
||||
<p translate>wifi.wps.pin.info</p>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'WPS Using Generated PIN '|translate}}">
|
||||
<switch id="enabled" name="enabled" ng-model="easybox.settings.wpsdevicepin.value" ng-change="save" class="green"></switch>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Generated PIN'|translate}}">
|
||||
<input type="text" class="form-control" ng-model="generatedPIN" />
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Generate New PIN'|translate}}">
|
||||
<button class="btn btn-default" ng-click="onGeneratePIN()" translate>Generate</button>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
<h2 translate>WPS with foreign PIN</h2>
|
||||
<p translate>wifi.wps.otherpin.info</p>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'Enter your device PIN'|translate}}">
|
||||
<input type="text" class="form-control" ng-model="data.userPIN" />
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Pair (within 2 minutes)'|translate}}">
|
||||
<button class="btn btn-default" ng-click="onPairUserPIN()" translate>Pair</button>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
</luci-config>
|
||||
<modal title="{{'Attempting to Pair'|translate}}" ng-show="showProgress">
|
||||
<div ng-show="pairState == 'progress'" >
|
||||
<i class="fa fa-spinner fa-spin fa-3x"/>
|
||||
<p translate>wifi.wpspairmodal.progressinfo</p>
|
||||
<p>{{timeRemaining}} <span translate>seconds remaining</span></p>
|
||||
</div>
|
||||
<p ng-show="pairState == 'success'" translate>wifi.wpspairmodal.successinfo</p>
|
||||
<p ng-show="pairState == 'fail'" translate>wifi.wpspairmodal.failinfo</p>
|
||||
</modal>
|
||||
</div>
|
||||
</luci-layout-with-sidebar>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,68 @@
|
|||
$juci.module("wifi")
|
||||
.controller("WifiWPSPageCtrl", function($scope, $uci){
|
||||
$uci.sync(["easybox"]).done(function(){
|
||||
$scope.data = {
|
||||
userPIN: ""
|
||||
}
|
||||
$uci.sync(["easybox", "wireless"]).done(function(){
|
||||
$scope.easybox = $uci.easybox;
|
||||
$scope.wireless = $uci.wireless;
|
||||
$scope.$apply();
|
||||
}).fail(function(err){
|
||||
console.log("failed to sync config: "+err);
|
||||
});
|
||||
|
||||
$rpc.wps.showpin().done(function(data){
|
||||
$scope.generatedPIN = data.pin;
|
||||
});
|
||||
function pair(){
|
||||
$scope.showProgress = 1;
|
||||
$scope.pairState = 'progress';
|
||||
$scope.timeRemaining = 60;
|
||||
$uci.save().done(function(){
|
||||
var interval = setInterval(function(){
|
||||
$scope.timeRemaining --;
|
||||
if($scope.timeRemaining == 0){
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 1000);
|
||||
$rpc.wps.pbc().done(function(){
|
||||
clearInterval(interval);
|
||||
$scope.pairState = 'success';
|
||||
$scope.$apply();
|
||||
setTimeout(function(){
|
||||
$scope.showProgress = 0;
|
||||
$scope.$apply();
|
||||
}, 2000);
|
||||
}).fail(function(){
|
||||
clearInterval(interval);
|
||||
$scope.pairState = 'fail';
|
||||
$scope.$apply();
|
||||
setTimeout(function(){
|
||||
$scope.showProgress = 0;
|
||||
$scope.$apply();
|
||||
}, 2000);
|
||||
}).always(function(){
|
||||
$scope.showProgress = 0;
|
||||
});
|
||||
});
|
||||
}
|
||||
$scope.save = function(){
|
||||
$uci.save();
|
||||
}
|
||||
$scope.onPairPBC = function(){
|
||||
|
||||
pair();
|
||||
}
|
||||
$scope.onPairUserPIN = function(){
|
||||
$rpc.wps.stapin({ pin: $scope.data.userPIN }).done(function(data){
|
||||
pair();
|
||||
});
|
||||
}
|
||||
$scope.onGeneratePIN = function(){
|
||||
$rpc.wps.genpin().done(function(data){
|
||||
$rpc.wps.setpin({pin: data.pin}).done(function(){
|
||||
$scope.generatedPIN = data.pin;
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
<switch id="enabled" name="enabled" ng-model="interface.closed.value" class="green" inverted></switch>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'wifi-iface.device'|translate}}">
|
||||
<ui-select ng-model="interface.device.value" style="width: 200px;" search-enabled="false">
|
||||
<ui-select ng-model="interface.device.value" search-enabled="false">
|
||||
<ui-select-match placeholder="{{ 'Choose Device' | translate}}">{{"interface."+$select.selected}}</ui-select-match>
|
||||
<ui-select-choices repeat="item in devices" refresh-delay="0"><div>{{"interface."+item}}</div></ui-select-choices>
|
||||
</ui-select>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'wifi-iface.encryption'|translate}}">
|
||||
<ui-select ng-model="interface.encryption.value" style="width: 200px;" theme="bootstrap" search-enabled="false">
|
||||
<ui-select ng-model="interface.encryption.value" theme="bootstrap" search-enabled="false">
|
||||
<ui-select-match placeholder="{{ 'Choose Protection' | translate}}">{{"encryption."+$select.selected}}</ui-select-match>
|
||||
<ui-select-choices repeat="item in interface.encryption.schema.allow" refresh-delay="0"><div >{{"encryption."+item}}</div></ui-select-choices>
|
||||
</ui-select>
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
18
luciexpress/htdocs/themes/vodafone/vodafone.js
Normal file
18
luciexpress/htdocs/themes/vodafone/vodafone.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(function(){
|
||||
var overrides = {
|
||||
"luciFooterDirective": "/widgets/luci.footer.html",
|
||||
"luciLayoutNakedDirective": "/widgets/luci.layout.naked.html",
|
||||
"luciLayoutSingleColumnDirective": "/widgets/luci.layout.single_column.html",
|
||||
"luciLayoutWithSidebarDirective": "/widgets/luci.layout.with_sidebar.html",
|
||||
"luciNavDirective": "/widgets/luci.nav.html",
|
||||
"luciNavbarDirective": "/widgets/luci.navbar.html",
|
||||
"luciTopBarDirective": "/widgets/luci.top_bar.html"
|
||||
};
|
||||
Object.keys(overrides).map(function(k){
|
||||
$juci.decorator(k, function($delegate){
|
||||
var plugin_root = $juci.module("vodafone").plugin_root;
|
||||
$delegate[1].templateUrl = plugin_root + overrides[k];
|
||||
return $delegate;
|
||||
});
|
||||
});
|
||||
})();
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -109,6 +109,13 @@
|
|||
"ubus": {
|
||||
"luci2.system": [
|
||||
"sshkeys_get"
|
||||
],
|
||||
"wps": [
|
||||
"genpin",
|
||||
"setpin",
|
||||
"pbc",
|
||||
"showpin",
|
||||
"stapin"
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
|
|
@ -122,6 +129,13 @@
|
|||
"luci2.system": [
|
||||
"sshkeys_set",
|
||||
"password_set"
|
||||
],
|
||||
"wps": [
|
||||
"genpin",
|
||||
"setpin",
|
||||
"pbc",
|
||||
"showpin",
|
||||
"stapin"
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue