mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-03 07:54:28 +01:00
Fixed some minor issues in mac filtering dialogs
This commit is contained in:
parent
19bd9539c6
commit
04d43ba612
7 changed files with 114 additions and 92 deletions
|
|
@ -148,6 +148,18 @@ JUCI.app.config(function ($stateProvider, $locationProvider, $compileProvider, $
|
|||
}
|
||||
}}]);
|
||||
|
||||
// make autofocus directive work as expected
|
||||
JUCI.app.directive('autofocus', ['$timeout', function($timeout) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link : function($scope, $element) {
|
||||
$timeout(function() {
|
||||
$element[0].focus();
|
||||
});
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
angular.element(document).ready(function() {
|
||||
JUCI.$init().done(function(){
|
||||
angular.bootstrap(document, ["luci"]);
|
||||
|
|
|
|||
|
|
@ -151,64 +151,6 @@
|
|||
"displayname": { dvalue: '', type: String },
|
||||
"log_size": { dvalue: 200, type: Number }
|
||||
}
|
||||
},
|
||||
"wireless": {
|
||||
"wifi-status": {
|
||||
"wlan": { dvalue: true, type: Boolean },
|
||||
"wps": { dvalue: true, type: Boolean },
|
||||
"schedule": { dvalue: false, type: Boolean },
|
||||
"sched_status": { dvalue: false, type: Boolean }
|
||||
},
|
||||
"wifi-schedule": {
|
||||
"days": { dvalue: [], type: Array, allow: ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], validator: WeekDayListValidator},
|
||||
"time": { dvalue: "", type: String, validator: TimespanValidator}
|
||||
},
|
||||
"wifi-device": {
|
||||
"type": { dvalue: "", type: String },
|
||||
"country": { dvalue: "", type: String},
|
||||
"band": { dvalue: "none", type: String, allow: [ "a", "b" ] },
|
||||
"bandwidth": { dvalue: 0, type: String, allow: [ "20", "40", "80" ] },
|
||||
"channel": { dvalue: "auto", type: String, allow: [ "auto", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48 ] },
|
||||
"scantimer": { dvalue: 0, type: Number },
|
||||
"wmm": { dvalue: false, type: Boolean },
|
||||
"wmm_noack": { dvalue: false, type: Boolean },
|
||||
"wmm_apsd": { dvalue: false, type: Boolean },
|
||||
"txpower": { dvalue: 0, type: Number },
|
||||
"rateset": { dvalue: "default", type: String, allow: [ "default" ] },
|
||||
"frag": { dvalue: 0, type: Number },
|
||||
"rts": { dvalue: 0, type: Number },
|
||||
"dtim_period":{ dvalue: 0, type: Number },
|
||||
"beacon_int": { dvalue: 0, type: Number },
|
||||
"rxchainps": { dvalue: false, type: Boolean },
|
||||
"rxchainps_qt":{ dvalue: 0, type: Number },
|
||||
"rxchainps_pps":{ dvalue: 0, type: Number },
|
||||
"rifs": { dvalue: false, type: Boolean },
|
||||
"rifs_advert":{ dvalue: false, type: Boolean },
|
||||
"maxassoc": { dvalue: 0, type: Number },
|
||||
"doth": { dvalue: 0, type: Boolean },
|
||||
"hwmode": { dvalue: "auto", type: String, allow: [ "auto", "11a", "11n", "11ac" ] },
|
||||
"disabled": { dvalue: false, type: Boolean }
|
||||
},
|
||||
"wifi-iface": {
|
||||
"device": { dvalue: "wl0", type: String, match: /^wl0|wl1$/ },
|
||||
"network": { dvalue: "lan", type: String, allow: [ "lan", "guest" ] },
|
||||
"mode": { dvalue: "ap", type: String, allow: [ "ap" ] },
|
||||
"ssid": { dvalue: "Inteno", type: String },
|
||||
"encryption": { dvalue: "mixed-psk", type: String, allow: [ "none", "wep", "psk", "psk2", "mixed-psk" ] },
|
||||
"cipher": { dvalue: "auto", type: String, allow: [ "auto" ] },
|
||||
"key": { dvalue: "", type: String },
|
||||
"gtk_rekey": { dvalue: false, type: Boolean },
|
||||
"wps_pbc": { dvalue: false, type: Boolean },
|
||||
"wmf_bss_enable":{ dvalue: false, type: Boolean },
|
||||
"bss_max": { dvalue: 0, type: Number },
|
||||
"instance": { dvalue: 0, type: Number },
|
||||
"up": { dvalue: false, type: Boolean },
|
||||
"closed": { dvalue: false, type: Boolean },
|
||||
"disabled": { dvalue: false, type: Boolean },
|
||||
"macmode": { dvalue: 1, type: Number, allow: [ 0, 1, 2 ] },
|
||||
"macfilter": { dvalue: false, type: Boolean },
|
||||
"maclist": { dvalue: [], type: Array, match_each: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/ }
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"interface": {
|
||||
|
|
@ -230,10 +172,6 @@
|
|||
// "password": { dvalue: "", type: String }
|
||||
//},
|
||||
"unknown": {
|
||||
"host": {
|
||||
"hostname": { dvalue: "", type: String, required: true},
|
||||
"macaddr": { dvalue: "", type: String, match: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/, required: true}
|
||||
},
|
||||
"upgrade": {
|
||||
"fw_check_url": { dvalue: "", type: String, required: false},
|
||||
"fw_path_url": { dvalue: "", type: String, required: false},
|
||||
|
|
@ -724,7 +662,11 @@
|
|||
}
|
||||
|
||||
scope.UCI = new UCI();
|
||||
|
||||
scope.UCI.validators = {
|
||||
WeekDayListValidator: WeekDayListValidator,
|
||||
TimespanValidator: TimespanValidator,
|
||||
PortValidator: PortValidator
|
||||
};
|
||||
/*if(exports.JUCI){
|
||||
var JUCI = exports.JUCI;
|
||||
JUCI.uci = exports.uci = new UCI();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<luci-config-heading>{{ 'MAC Filter' | translate }}</luci-config-heading>
|
||||
<luci-config-info>{{ 'wifi.macfilter.info' | translate }}</luci-config-info>
|
||||
<luci-config-section ng-repeat="iface in interfaces">
|
||||
<luci-config-heading>{{ "wifi-iface."+iface['.name'] }}</luci-config-heading>
|
||||
<luci-config-heading>{{ iface.ssid.value }}</luci-config-heading>
|
||||
<uci-wireless-interface-macfilter-edit ng-model="iface"></uci-wifi-iface-macfilter-edit>
|
||||
</luci-config-section>
|
||||
<!--<luci-config-section>
|
||||
|
|
|
|||
|
|
@ -5,11 +5,25 @@
|
|||
<luci-config-heading>{{'Settings'|translate}}</luci-config-heading>
|
||||
<luci-config-info>{{'wifi.settings.info'|translate}}</luci-config-info>
|
||||
<div ng-repeat="dev in devices">
|
||||
<h3>{{ "wifi-device."+dev[".name"] | translate }}</h3>
|
||||
<uci-wireless-device-edit ng-model="dev"></uci-wireless-device-edit>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="btn-group pull-right">
|
||||
<span class="btn " ng-click="dev.expanded = !(dev.expanded)">
|
||||
<i class="fa fa-caret-down fa-2x" ng-show="dev.expanded"></i>
|
||||
<i class="fa fa-caret-left fa-2x" ng-hide="dev.expanded"></i>
|
||||
</span>
|
||||
</div>
|
||||
<h3 class="panel-title" style="font-size: 1.5em; padding-top: 0.4em; font-weight: bold; font-family: 'vodafont';">{{dev.frequency}}</h3>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<div class="panel-body " ng-show="dev.expanded" >
|
||||
<uci-wireless-device-edit ng-model="dev.fields"></uci-wireless-device-edit>
|
||||
</div>
|
||||
<div class="panel-footer" ng-show="dev.expanded">
|
||||
<luci-config-apply></luci-config-apply>
|
||||
</div>
|
||||
</div>
|
||||
</luci-config-section>
|
||||
<luci-config-apply></luci-config-apply>
|
||||
</luci-config>
|
||||
</div>
|
||||
</luci-layout-with-sidebar>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,17 @@
|
|||
$juci.module("wifi")
|
||||
.controller("WifiSettingsPageCtrl", function($scope, $uci){
|
||||
.controller("WifiSettingsPageCtrl", function($scope, $uci, gettext){
|
||||
function load(){
|
||||
$uci.sync("wireless").done(function(){
|
||||
$scope.devices = $uci.wireless["@wifi-device"];
|
||||
$scope.devices = $uci.wireless["@wifi-device"].map(function(dev){
|
||||
// TODO: this should be a uci "displayname" or something
|
||||
var ret = { expanded: true, fields: dev };
|
||||
if(dev.band.value == "a") ret.frequency = gettext("5GHz");
|
||||
else if(dev.band.value == "b") ret.frequency = gettext("2.4GHz");
|
||||
else ret.frequency = gettext("Unknown");
|
||||
return ret;
|
||||
});
|
||||
$scope.$apply();
|
||||
});
|
||||
} load();
|
||||
|
||||
|
||||
$scope.onApply = function(){
|
||||
$scope.busy = 1;
|
||||
$uci.save().done(function(){
|
||||
console.log("Saved configuration!");
|
||||
}).always(function(){
|
||||
$scope.busy = 0;
|
||||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,22 +2,13 @@
|
|||
<luci-config-section>
|
||||
<luci-config-lines>
|
||||
<luci-config-line title="{{'Wifi Mode'|translate}}">
|
||||
<ui-select ng-model="device.hwmode.value" search-enabled="false" style="width: 200px;">
|
||||
<ui-select-match placeholder="{{ 'Choose Mode' | translate}}">{{$select.selected|translate}}</ui-select-match>
|
||||
<ui-select-choices repeat="item in device.hwmode.schema.allow" refresh-delay="0"><div>{{item|translate}}</div></ui-select-choices>
|
||||
</ui-select>
|
||||
<luci-select ng-model="device.hwmode.value" ng-items="device.hwmode.schema.allow"/>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Bandwidth'|translate}}">
|
||||
<ui-select ng-model="device.bandwidth.value" theme="bootstrap" search-enabled="false" style="width: 200px;">
|
||||
<ui-select-match placeholder="{{ 'Choose Bandwidth' | translate}}">{{$select.selected|translate}}</ui-select-match>
|
||||
<ui-select-choices repeat="item in device.bandwidth.schema.allow" refresh-delay="0"><div >{{item|translate}}</div></ui-select-choices>
|
||||
</ui-select>
|
||||
<luci-select ng-model="device.bandwidth.value" ng-items="device.bandwidth.schema.allow"/>
|
||||
</luci-config-line>
|
||||
<luci-config-line title="{{'Channel'|translate}}">
|
||||
<ui-select ng-model="device.channel.value" theme="bootstrap" search-enabled="false" style="width: 200px;">
|
||||
<ui-select-match placeholder="{{ 'Choose Channel' | translate}}">{{$select.selected | translate}}</ui-select-match>
|
||||
<ui-select-choices repeat="item in device.channel.schema.allow" refresh-delay="0"><div >{{item|translate}}</div></ui-select-choices>
|
||||
</ui-select>
|
||||
<luci-select ng-model="device.channel.value" ng-items="device.channel.schema.allow"/>
|
||||
</luci-config-line>
|
||||
</luci-config-lines>
|
||||
</luci-config-section>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,74 @@
|
|||
angular.module("luci").config(function($stateProvider) {
|
||||
JUCI.app
|
||||
.config(function($stateProvider) {
|
||||
$stateProvider.state("wifi", {
|
||||
url: "/wifi",
|
||||
onEnter: function($state){
|
||||
$juci.redirect("wifi-general");
|
||||
}
|
||||
});
|
||||
|
||||
UCI.$registerConfig("wireless");
|
||||
UCI.wireless.$registerSectionType("wifi-status", {
|
||||
"wlan": { dvalue: true, type: Boolean },
|
||||
"wps": { dvalue: true, type: Boolean },
|
||||
"schedule": { dvalue: false, type: Boolean },
|
||||
"sched_status": { dvalue: false, type: Boolean }
|
||||
});
|
||||
UCI.wireless.$registerSectionType("wifi-schedule", {
|
||||
"days": { dvalue: [], type: Array, allow: ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], validator: UCI.validators.WeekDayListValidator},
|
||||
"time": { dvalue: "", type: String, validator: UCI.validators.TimespanValidator}
|
||||
});
|
||||
UCI.wireless.$registerSectionType("wifi-device", {
|
||||
"type": { dvalue: "", type: String },
|
||||
"country": { dvalue: "", type: String},
|
||||
"band": { dvalue: "none", type: String, allow: [ "a", "b" ] },
|
||||
"bandwidth": { dvalue: 0, type: String, allow: [ "20", "40", "80" ] },
|
||||
"channel": { dvalue: "auto", type: String, allow: [ "auto", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48 ] },
|
||||
"scantimer": { dvalue: 0, type: Number },
|
||||
"wmm": { dvalue: false, type: Boolean },
|
||||
"wmm_noack": { dvalue: false, type: Boolean },
|
||||
"wmm_apsd": { dvalue: false, type: Boolean },
|
||||
"txpower": { dvalue: 0, type: Number },
|
||||
"rateset": { dvalue: "default", type: String, allow: [ "default" ] },
|
||||
"frag": { dvalue: 0, type: Number },
|
||||
"rts": { dvalue: 0, type: Number },
|
||||
"dtim_period":{ dvalue: 0, type: Number },
|
||||
"beacon_int": { dvalue: 0, type: Number },
|
||||
"rxchainps": { dvalue: false, type: Boolean },
|
||||
"rxchainps_qt":{ dvalue: 0, type: Number },
|
||||
"rxchainps_pps":{ dvalue: 0, type: Number },
|
||||
"rifs": { dvalue: false, type: Boolean },
|
||||
"rifs_advert":{ dvalue: false, type: Boolean },
|
||||
"maxassoc": { dvalue: 0, type: Number },
|
||||
"doth": { dvalue: 0, type: Boolean },
|
||||
"hwmode": { dvalue: "auto", type: String, allow: [ "auto", "11a", "11n", "11ac" ] },
|
||||
"disabled": { dvalue: false, type: Boolean }
|
||||
});
|
||||
UCI.wireless.$registerSectionType("wifi-iface", {
|
||||
"device": { dvalue: "wl0", type: String, match: /^wl0|wl1$/ },
|
||||
"network": { dvalue: "lan", type: String, allow: [ "lan", "guest" ] },
|
||||
"mode": { dvalue: "ap", type: String, allow: [ "ap" ] },
|
||||
"ssid": { dvalue: "Inteno", type: String },
|
||||
"encryption": { dvalue: "mixed-psk", type: String, allow: [ "none", "wep", "psk", "psk2", "mixed-psk" ] },
|
||||
"cipher": { dvalue: "auto", type: String, allow: [ "auto" ] },
|
||||
"key": { dvalue: "", type: String },
|
||||
"gtk_rekey": { dvalue: false, type: Boolean },
|
||||
"wps_pbc": { dvalue: false, type: Boolean },
|
||||
"wmf_bss_enable":{ dvalue: false, type: Boolean },
|
||||
"bss_max": { dvalue: 0, type: Number },
|
||||
"instance": { dvalue: 0, type: Number },
|
||||
"up": { dvalue: false, type: Boolean },
|
||||
"closed": { dvalue: false, type: Boolean },
|
||||
"disabled": { dvalue: false, type: Boolean },
|
||||
"macmode": { dvalue: 1, type: Number, allow: [ 0, 1, 2 ] },
|
||||
"macfilter": { dvalue: false, type: Boolean },
|
||||
"maclist": { dvalue: [], type: Array, match_each: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/ }
|
||||
});
|
||||
|
||||
|
||||
UCI.$registerConfig("hosts");
|
||||
UCI.hosts.$registerSectionType("host", {
|
||||
"hostname": { dvalue: "", type: String, required: true},
|
||||
"macaddr": { dvalue: "", type: String, match: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/, required: true}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue