Check window location host value to show the close button.

The close button was available even if the interface is requested remotely. Now the script hides the close button if the value of window.location.host is equal to 127.0.0.1 or localhost.
This commit is contained in:
Félix Aimé authored and GitHub committed 2021-06-04 14:40:16 +02:00
1 parent fd66d2274e
commit 1d8c2387ca
1 file changed
+2 -2
+2 -2
View File
@@ -53,7 +53,7 @@ export default {
load_config: function() {
axios.get(`/api/misc/config`, { timeout: 60000 })
.then(response => {
this.quit_available = response.data.quit_option
this.quit_available = (response.data.quit_option && (["localhost", "127.0.0.1"].some(h => window.location.host.includes(h) )))
this.off_available = response.data.shutdown_option
})
.catch(error => { console.log(error) });
@@ -73,4 +73,4 @@ export default {
this.check_update();
}
}
</script>
</script>