diff --git a/conf/hostapd.conf.tpl b/conf/hostapd.conf.tpl index 06ff2fb..71d4357 100644 --- a/conf/hostapd.conf.tpl +++ b/conf/hostapd.conf.tpl @@ -1,6 +1,8 @@ interface= ssid= hw_mode=g +ieee80211n=1 +wmm_enabled=1 channel= macaddr_acl=0 auth_algs=1 diff --git a/conf/init_ynh-hotspot b/conf/init_ynh-hotspot index 819cb1f..600123c 100644 --- a/conf/init_ynh-hotspot +++ b/conf/init_ynh-hotspot @@ -89,6 +89,12 @@ start_hostapd() { sed "s||${ynh_wifi_passphrase}|g" -i /etc/hostapd/hostapd.conf sed "s||${ynh_wifi_channel}|g" -i /etc/hostapd/hostapd.conf + if [ "${ynh_wifi_n}" -eq 1 ]; then + sed "s|||g" -i /etc/hostapd/hostapd.conf + else + sed "s||#|g" -i /etc/hostapd/hostapd.conf + fi + service hostapd start } @@ -186,6 +192,7 @@ ynh_wifi_device=$(moulinette_get wifi_device) ynh_wifi_ssid=$(moulinette_get wifi_ssid) ynh_wifi_passphrase=$(moulinette_get wifi_passphrase) ynh_wifi_channel=$(moulinette_get wifi_channel) +ynh_wifi_n=$(moulinette_get wifi_n) ynh_ip6_addr=$(moulinette_get ip6_addr) ynh_ip6_net=$(moulinette_get ip6_net) ynh_ip6_dns0=$(moulinette_get ip6_dns0) diff --git a/scripts/install b/scripts/install index 28d6f4d..ac57669 100644 --- a/scripts/install +++ b/scripts/install @@ -40,6 +40,7 @@ sudo yunohost app setting hotspot wifi_ssid -v "${wifi_ssid}" sudo yunohost app setting hotspot wifi_passphrase -v "${wifi_passphrase}" sudo yunohost app setting hotspot wifi_device -v "${wifi_device}" sudo yunohost app setting hotspot wifi_channel -v 6 +sudo yunohost app setting hotspot wifi_n -v 0 sudo yunohost app setting hotspot ip6_addr -v "${ip6_addr}" sudo yunohost app setting hotspot ip6_net -v "${ip6_net}" sudo yunohost app setting hotspot ip6_dns0 -v "${ip6_dns0}" diff --git a/sources/controller.php b/sources/controller.php index a4b7de4..e50291c 100644 --- a/sources/controller.php +++ b/sources/controller.php @@ -16,8 +16,6 @@ function restart_service() { } dispatch('/', function() { - set('title', T_('Wifi Hotspot')); - exec('ip link', $devs); $wifi_device = moulinette_get('wifi_device'); $devs_list = ""; @@ -37,6 +35,7 @@ dispatch('/', function() { set('wifi_ssid', moulinette_get('wifi_ssid')); set('wifi_passphrase', moulinette_get('wifi_passphrase')); set('wifi_channel', moulinette_get('wifi_channel')); + set('wifi_n', moulinette_get('wifi_n')); set('wifi_device', $wifi_device); set('wifi_device_list', $devs_list); set('ip6_net', moulinette_get('ip6_net')); @@ -53,6 +52,7 @@ dispatch_put('/settings', function() { moulinette_set('wifi_ssid', $_POST['wifi_ssid']); moulinette_set('wifi_passphrase', $_POST['wifi_passphrase']); moulinette_set('wifi_channel', $_POST['wifi_channel']); + moulinette_set('wifi_n', isset($_POST['wifi_n']) ? 1 : 0); moulinette_set('wifi_device', $_POST['wifi_device']); moulinette_set('ip6_net', $_POST['ip6_net']); moulinette_set('ip6_dns0', $_POST['ip6_dns0']); diff --git a/sources/public/css/bootstrap-toggle.min.css b/sources/public/css/bootstrap-toggle.min.css new file mode 100644 index 0000000..abd1c8c --- /dev/null +++ b/sources/public/css/bootstrap-toggle.min.css @@ -0,0 +1,28 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.css v2.0.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ +.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} +.toggle{position:relative;overflow:hidden} +.toggle input[type=checkbox]{display:none} +.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} +.toggle.off .toggle-group{left:-100%} +.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} +.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} +.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} +.toggle.btn{min-width:59px;min-height:34px} +.toggle-on.btn{padding-right:24px} +.toggle-off.btn{padding-left:24px} +.toggle.btn-lg{min-width:79px;min-height:45px} +.toggle-on.btn-lg{padding-right:31px} +.toggle-off.btn-lg{padding-left:31px} +.toggle-handle.btn-lg{width:40px} +.toggle.btn-sm{min-width:50px;min-height:30px} +.toggle-on.btn-sm{padding-right:20px} +.toggle-off.btn-sm{padding-left:20px} +.toggle.btn-xs{min-width:35px;min-height:22px} +.toggle-on.btn-xs{padding-right:12px} +.toggle-off.btn-xs{padding-left:12px} \ No newline at end of file diff --git a/sources/public/js/bootstrap-toggle.min.js b/sources/public/js/bootstrap-toggle.min.js new file mode 100644 index 0000000..d05310d --- /dev/null +++ b/sources/public/js/bootstrap-toggle.min.js @@ -0,0 +1,9 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.js v2.0.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ ++function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="3.0.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:""},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('