Adding users controls on the frontend quit/shutdown/reboot
This commit is contained in:
@@ -27,12 +27,11 @@
|
||||
</div>
|
||||
<div v-else>
|
||||
<p>
|
||||
<strong>Unfortunately, we got some issues.</strong>
|
||||
<strong>Unfortunately, we got some issues <br />during the AP creation.</strong>
|
||||
<br /><br />
|
||||
Please verify that you've two Wifi interfaces on your device<br />
|
||||
and restart it by clicking on the button below.<br />
|
||||
Please verify that you've two WiFi interfaces on your device<br /> and try again by restarting it.<br /><br />
|
||||
</p>
|
||||
<button class="btn" v-on:click="reboot()">Reboot the device</button>
|
||||
<button v-if="reboot_option" class="btn" v-on:click="reboot()">Restart the device</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -53,14 +52,15 @@ export default {
|
||||
capture_token: false,
|
||||
capture_start: false,
|
||||
interval: false,
|
||||
error: false
|
||||
error: false,
|
||||
reboot_option: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generate_ap: function() {
|
||||
clearInterval(this.interval)
|
||||
this.ssid_name = false
|
||||
axios.get(`/api/network/ap/start`, { timeout: 70000 })
|
||||
axios.get(`/api/network/ap/start`, { timeout: 30000 })
|
||||
.then(response => (this.show_ap(response.data)))
|
||||
},
|
||||
show_ap: function(data) {
|
||||
@@ -109,9 +109,19 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
load_config: function() {
|
||||
axios.get(`/api/misc/config`, { timeout: 60000 })
|
||||
.then(response => {
|
||||
this.reboot_option = response.data.reboot_option
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error)
|
||||
});
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
this.load_config()
|
||||
this.generate_ap();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user