First maintenance button in web-interface.

This commit is contained in:
Pecusx
2017-10-10 21:27:05 +02:00
committed by GitHub
parent 1ff6e59c89
commit 03263d9617
2 changed files with 13 additions and 0 deletions
+10
View File
@@ -33,6 +33,16 @@ if (isset($msg)) {
echo " window.location.href = 'index.html';\r\n";
echo "}, 30000);\r\n";
echo "</script>\r\n";
} elseif ($msg == "clear_caches") {
$end = shell_exec('sudo ./scripts/clear_caches.sh');
echo "Clear logs and caches.<br>\r\n";
echo "Wait!<br>\r\n";
echo "<script>\r\n";
echo "// redirect to main after 5 seconds\r\n";
echo "window.setTimeout(function() {\r\n";
echo " window.location.href = 'index.html';\r\n";
echo "}, 5000);\r\n";
echo "</script>\r\n";
} elseif ($msg == "audio") {
$selected = $_POST['output'];
$hda = $_POST['hda'];
+3
View File
@@ -91,6 +91,9 @@ for ($i = 0; $i < count($remoteconfigs); $i++) {
Update to last build from github
<a href="update.php"><button>PiRadio update</button></a>
<hr>
Maintenance<br>
<a href="changeconf.php?file=clear_caches"><button>Clear logs and caches</button></a>
<hr>
<a href="changeconf.php?file=restart"><button>PiRadio restart</button></a>
<a href="changeconf.php?file=reboot"><button>System reboot</button></a>
</body>