web: confirm using Butterfly Terminal on a local machine

This commit is contained in:
Oleg Kalachev
2021-08-18 21:15:31 +03:00
parent c0677f6aa3
commit dae9599d64

View File

@@ -18,6 +18,14 @@
document.querySelector("#wvs").href = location.protocol + '//' + location.hostname + ':8080';
document.querySelector("#butterfly").href = location.protocol + '//' + location.hostname + ':57575';
document.querySelector("#butterfly").addEventListener('click', function(e) {
if (location.hostname == 'localhost' || location.hostname == '127.0.0.1') {
if (!confirm('Please use regular Terminal app on a local machine.\nClick OK to proceed to Butterfly anyway.')) {
e.preventDefault();
}
}
});
// Determine image version
fetch('clover_version').then(function(response) {
if (response.status !== 200) return;