Adding nonet feature

This commit is contained in:
Félix Aime 2021-02-15 16:35:10 +01:00
parent 579ad72071
commit f4d361488c
3 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ export default {
var saved_ssid = this.saved_ssid var saved_ssid = this.saved_ssid
var list_ssids = this.list_ssids var list_ssids = this.list_ssids
var internet = this.internet var internet = this.internet
if (window.config.iface_out.charAt(0) == "e"){ if (window.config.iface_out.charAt(0) == 'e' || window.config.iface_out.charAt(0) == 'n'){
router.push({ name: 'generate-ap' }); router.push({ name: 'generate-ap' });
} else { } else {
router.push({ name: 'wifi-select', router.push({ name: 'wifi-select',

View File

@ -23,7 +23,7 @@
axios.get('/api/network/status', { timeout: 10000 }) axios.get('/api/network/status', { timeout: 10000 })
.then(response => { .then(response => {
if (response.data.internet) this.internet = true if (response.data.internet) this.internet = true
if (window.config.iface_out.charAt(0) == 'e') { if (window.config.iface_out.charAt(0) == 'e' || window.config.iface_out.charAt(0) == 'n') {
setTimeout(function () { this.goto_home(); }.bind(this), 1000); setTimeout(function () { this.goto_home(); }.bind(this), 1000);
} else { } else {
this.get_wifi_networks(); this.get_wifi_networks();

View File

@ -62,7 +62,7 @@ class Config(object):
config[cat][key] = value config[cat][key] = value
if key == "out": if key == "out":
config[cat][key] = value config[cat][key] = value
elif re.match("^(eth[0-9]|en[a-z0-9]{20})$", value) and key == "out": elif re.match("^(nonet|eth[0-9]|en[a-z0-9]{20})$", value) and key == "out":
config[cat][key] = value config[cat][key] = value
else: else:
return {"status": False, return {"status": False,
@ -137,7 +137,7 @@ class Config(object):
:return: list of the interfaces :return: list of the interfaces
""" """
try: try:
return [i for i in os.listdir("/sys/class/net/") if i.startswith(("wl", "et"))] return [i for i in os.listdir("/sys/class/net/") if i.startswith(("wl", "et"))]+["nonet"]
except: except:
return ["No network interfaces"] return ["No network interfaces"]