📚Docs, QoL improvements

This commit is contained in:
jokob-sk
2024-06-21 16:44:03 +10:00
parent 3b7cbba32b
commit a52e315732
28 changed files with 207 additions and 216 deletions

View File

@@ -28,6 +28,10 @@ if(array_key_exists('settings', $_REQUEST) != FALSE)
// call functions based on requested params
switch ($FUNCTION) {
case 'restartBackend':
restartBackend();
break;
case 'savesettings':
saveSettings();
@@ -243,6 +247,28 @@ function addToExecutionQueue($action)
}
// ----------------------------------------------------------------------------------------
function restartBackend()
{
$command = 'pkill -f "python /app/server" && (python /app/server > /dev/null 2>&1 &) && echo "done" 2>&1';
// Execute the command
$output = [];
$output_str = "";
$return_var = 0;
exec($command, $output, $return_var);
// Format the output
foreach ($output as $line) {
$output_str .= $line . "\n";
}
echo "Command result: $return_var, $output_str";
}
// ----------------------------------------------------------------------------------------
function cleanLog($logFile)
{