do not allow restart on windows

This commit is contained in:
Kevin Froman 2020-02-05 20:31:38 -06:00
parent 938e1bddd3
commit 7c7e5de091
10 changed files with 83 additions and 11 deletions

View file

@ -51,11 +51,6 @@
Shutdown
</a>
</p>
<p class="control">
<a class="button is-warning is-outlined" id='restartNode'>
Restart
</a>
</p>
</div>
</div>
</div>

View file

@ -17,6 +17,7 @@
<script defer src="/shared/eventsource.js"></script>
<script defer src="/shared/loadabout.js"></script>
<script defer src="/shared/misc.js"></script>
<script defer src="/shared/getos.js"></script>
<script defer src="/shared/main/stats.js"></script>
<script defer src="/shared/main/torstats.js"></script>
<script defer src="/shared/panel.js"></script>
@ -25,7 +26,8 @@
<script defer src="/shared/main/apicheck.js"></script>
<script defer src="/private/js/console.js"></script>
<script defer src="/private/js/motd.js"></script>
<script defer src='/shared/navbar.js'></script>
<script defer src="/shared/navbar.js"></script>
<script defer src="/private/js/windows.js"></script>
<script>alert("Content security policy appears to not be working. Your browser security is weak!")</script>
</head>

View file

@ -0,0 +1,26 @@
/*
Onionr - Private P2P Communication
Hide restart button if node OS is windows
since restart is broken on windows
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var hideRestartIfWindows = function(){
if (onionrNodeOS === 'windows'){
document.getElementById('restartNode').style.display = 'none'
}
}
setTimeout(function(){hideRestartIfWindows()}, 500)

View file

@ -0,0 +1,30 @@
/*
Onionr - Private P2P Communication
Get node OS version (not browser)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
onionrNodeOS = ""
fetch('/os', {
method: 'GET',
headers: {
"token": webpass
}})
.then((resp) => resp.text()) // Transform the data into text
.then(function(os) {
onionrNodeOS = os
})