Consolidate code in remaining pages, setting page updates

The Config and Advanced setting pages received changes to use the new setSetting() function which looks after creating or updated the setting in the required config files.
Optionally it also specification of a command to run after saving the settings.
Some variables like models, audio formats and frequency shift tools were also moved into common.php

Service Controls page received changes with the replacement of the actual command to execute with a sort of shorthand human friendly version e.g. service <action> <service_name> -- service restart livestream.service

These commands map to the original commands in serviceMaintenance() so this could be called through the API without needing the full-blown commend.
views.php was updated to accommodate this also

System Controls page received a small change to make the process checking for new git updates or getting the last commit hash a single function call.

Include and Exclude species updated to use getFilePath() to generate a path to the required file instead of the hard coded path

Views.php also received similar treatment with replacing some hard coded paths with generated paths, but logic changes to handle the change in running service commands
This commit is contained in:
jaredb7
2023-05-08 23:24:15 +10:00
parent bf0131cf27
commit ac9a0e4cbe
9 changed files with 916 additions and 659 deletions
+2 -5
View File
@@ -3,10 +3,7 @@
</style>
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
$filename = './scripts/labels.txt';
$filename = getFilePath('labels.txt');
$eachlines = file($filename, FILE_IGNORE_NEW_LINES);
?>
@@ -47,7 +44,7 @@ $eachlines = file($filename, FILE_IGNORE_NEW_LINES);
<select name="species[]" id="value2" multiple size="30">
<option selected value="base">Please Select</option>
<?php
$filename = './scripts/include_species_list.txt';
$filename = getFilePath('include_species_list');
$eachlines = file($filename, FILE_IGNORE_NEW_LINES);
foreach($eachlines as $lines){echo
"<option value=\"".$lines."\">$lines</option>";}