update 05-11 07:48:04
This commit is contained in:
parent
c6aba4f441
commit
2b79dd1bab
|
@ -25,7 +25,6 @@ define Package/luci-app-adguardhome/conffiles
|
||||||
/usr/share/AdGuardHome/links.txt
|
/usr/share/AdGuardHome/links.txt
|
||||||
/etc/config/AdGuardHome
|
/etc/config/AdGuardHome
|
||||||
/etc/AdGuardHome.yaml
|
/etc/AdGuardHome.yaml
|
||||||
/etc/AdGuardHome.yaml
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/luci-app-adguardhome/postinst
|
define Package/luci-app-adguardhome/postinst
|
||||||
|
|
|
@ -19,6 +19,11 @@ return view.extend({
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
|
|
||||||
var m, s, o;
|
var m, s, o;
|
||||||
|
var has_wifi = false;
|
||||||
|
|
||||||
|
if (uci.sections('wireless', 'wifi-device').length > 0) {
|
||||||
|
has_wifi = true;
|
||||||
|
}
|
||||||
|
|
||||||
m = new form.Map('wizard', [_('Inital Router Setup')],
|
m = new form.Map('wizard', [_('Inital Router Setup')],
|
||||||
_('If you are using this router for the first time, please configure it here.'));
|
_('If you are using this router for the first time, please configure it here.'));
|
||||||
|
@ -83,6 +88,16 @@ return view.extend({
|
||||||
o = s.taboption('firmware', form.Flag, 'cookie_p', _('Persistent cookies'),_('保持后台登录状态,避免每次关闭浏览器后都需要重新登录'));
|
o = s.taboption('firmware', form.Flag, 'cookie_p', _('Persistent cookies'),_('保持后台登录状态,避免每次关闭浏览器后都需要重新登录'));
|
||||||
o.default = o.enabled;
|
o.default = o.enabled;
|
||||||
|
|
||||||
|
if (has_wifi) {
|
||||||
|
s.tab('wifisetup', _('Wireless Settings'), _('Set the router\'s wireless name and password. For more advanced settings, please go to the Network-Wireless page.'));
|
||||||
|
o = s.taboption('wifisetup', form.Value, 'wifi_ssid', _('<abbr title=\"Extended Service Set Identifier\">ESSID</abbr>'));
|
||||||
|
o.datatype = 'maxlength(32)';
|
||||||
|
|
||||||
|
o = s.taboption("wifisetup", form.Value, "wifi_key", _("Key"));
|
||||||
|
o.datatype = 'wpakey';
|
||||||
|
o.password = true;
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout("document.getElementsByClassName('cbi-button-apply')[0].children[3].children[0].value='1'",1000)
|
setTimeout("document.getElementsByClassName('cbi-button-apply')[0].children[3].children[0].value='1'",1000)
|
||||||
|
|
||||||
return m.render();
|
return m.render();
|
||||||
|
|
|
@ -13,7 +13,7 @@ add_wizard() {
|
||||||
local cfg="$1"
|
local cfg="$1"
|
||||||
local wan_proto wan_pppoe_user wan_pppoe_pass
|
local wan_proto wan_pppoe_user wan_pppoe_pass
|
||||||
local lan_ipaddr lan_netmask lan_dns lan_gateway dhcp
|
local lan_ipaddr lan_netmask lan_dns lan_gateway dhcp
|
||||||
local device ipv6 old_ipv6
|
local device ipv6 old_ipv6 wifi_ssid wifi_key old_wifi_ssid old_wifi_key
|
||||||
|
|
||||||
config_get wan_proto "$cfg" wan_proto
|
config_get wan_proto "$cfg" wan_proto
|
||||||
|
|
||||||
|
@ -108,6 +108,38 @@ add_wizard() {
|
||||||
uci -q set wizard.default.old_ipv6="${ipv6}"
|
uci -q set wizard.default.old_ipv6="${ipv6}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
wifi_setup_radio(){
|
||||||
|
local radio=$1
|
||||||
|
uci -q get wireless.${radio} >/dev/null 2>&1 && {
|
||||||
|
if [ "$(uci -q get wireless.${radio}.band)" = "5g" ]; then
|
||||||
|
uci -q set wireless.default_${radio}.ssid="${wifi_ssid}_5G"
|
||||||
|
else
|
||||||
|
uci -q set wireless.default_${radio}.ssid="${wifi_ssid}_2.4G"
|
||||||
|
fi
|
||||||
|
uci -q set wireless.default_${radio}.device="${radio}"
|
||||||
|
if [ "${wifi_key}" ]; then
|
||||||
|
uci -q set wireless.default_${radio}.encryption='psk2'
|
||||||
|
uci -q set wireless.default_${radio}.key="${wifi_key}"
|
||||||
|
else
|
||||||
|
uci -q set wireless.default_${radio}.encryption='none'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
config_get wifi_ssid "$cfg" wifi_ssid
|
||||||
|
config_get wifi_key "$cfg" wifi_key
|
||||||
|
config_get old_wifi_ssid "$cfg" old_wifi_ssid
|
||||||
|
config_get old_wifi_key "$cfg" old_wifi_key
|
||||||
|
|
||||||
|
if [[ "${wifi_ssid}" != "${old_wifi_ssid}" || "${wifi_key}" != "${old_wifi_key}" ]]; then
|
||||||
|
test -n "${wifi_ssid}" && {
|
||||||
|
for radio in radio0 radio1 radio2 radio3; do
|
||||||
|
wifi_setup_radio ${radio}
|
||||||
|
done
|
||||||
|
uci commit wireless
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
uci commit wizard
|
uci commit wizard
|
||||||
uci commit dhcp
|
uci commit dhcp
|
||||||
uci commit firewall
|
uci commit firewall
|
||||||
|
|
Loading…
Reference in New Issue