Commit 28b058c8 authored by Tikimotel's avatar Tikimotel Committed by Franco Fichtner

Update system_advanced_misc.php (#1288)

This adds the "normal" power state to the powerd - system_advanced_misc options.
If the powerd utillity can not determine the system power options (ac or battery) it will use the "normal" setting rendering the "ac" and "battery" settings useless for these systems.
parent 9a15a68f
...@@ -82,10 +82,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -82,10 +82,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
/* if the old use_mfs_tmpvar is found, set these flags, too */ /* if the old use_mfs_tmpvar is found, set these flags, too */
$pconfig['use_mfs_var'] = isset($config['system']['use_mfs_tmpvar']) || isset($config['system']['use_mfs_var']); $pconfig['use_mfs_var'] = isset($config['system']['use_mfs_tmpvar']) || isset($config['system']['use_mfs_var']);
$pconfig['use_mfs_tmp'] = isset($config['system']['use_mfs_tmpvar']) || isset($config['system']['use_mfs_tmp']); $pconfig['use_mfs_tmp'] = isset($config['system']['use_mfs_tmpvar']) || isset($config['system']['use_mfs_tmp']);
$pconfig['powerd_ac_mode'] = "hadp";
$pconfig['rrdbackup'] = !empty($config['system']['rrdbackup']) ? $config['system']['rrdbackup'] : null; $pconfig['rrdbackup'] = !empty($config['system']['rrdbackup']) ? $config['system']['rrdbackup'] : null;
$pconfig['dhcpbackup'] = !empty($config['system']['dhcpbackup']) ? $config['system']['dhcpbackup'] : null; $pconfig['dhcpbackup'] = !empty($config['system']['dhcpbackup']) ? $config['system']['dhcpbackup'] : null;
$pconfig['netflowbackup'] = !empty($config['system']['netflowbackup']) ? $config['system']['netflowbackup'] : null; $pconfig['netflowbackup'] = !empty($config['system']['netflowbackup']) ? $config['system']['netflowbackup'] : null;
$pconfig['powerd_ac_mode'] = "hadp";
if (!empty($config['system']['powerd_ac_mode'])) { if (!empty($config['system']['powerd_ac_mode'])) {
$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode']; $pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
} }
...@@ -93,6 +93,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -93,6 +93,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (!empty($config['system']['powerd_battery_mode'])) { if (!empty($config['system']['powerd_battery_mode'])) {
$pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode']; $pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
} }
$pconfig['powerd_normal_mode'] = "hadp";
if (!empty($config['system']['powerd_normal_mode'])) {
$pconfig['powerd_normal_mode'] = $config['system']['powerd_normal_mode'];
}
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
// //
$input_errors = array(); $input_errors = array();
...@@ -115,6 +119,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -115,6 +119,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['system']['powerd_ac_mode'] = $pconfig['powerd_ac_mode']; $config['system']['powerd_ac_mode'] = $pconfig['powerd_ac_mode'];
$config['system']['powerd_battery_mode'] = $pconfig['powerd_battery_mode']; $config['system']['powerd_battery_mode'] = $pconfig['powerd_battery_mode'];
$config['system']['powerd_normal_mode'] = $pconfig['powerd_normal_mode'];
if ($pconfig['crypto_hardware']) { if ($pconfig['crypto_hardware']) {
$config['system']['crypto_hardware'] = $pconfig['crypto_hardware']; $config['system']['crypto_hardware'] = $pconfig['crypto_hardware'];
...@@ -396,6 +401,28 @@ include("head.inc"); ...@@ -396,6 +401,28 @@ include("head.inc");
</select> </select>
</td> </td>
</tr> </tr>
<tr>
<td><a id="help_for_powerd_normal_mode" href="#" class="showhelp"><i class="fa fa-info-circle text-circle"></i></a> <?=gettext('On Normal Power Mode'); ?></td>
<td>
<select name="powerd_normal_mode" class="selectpicker" data-style="btn-default" data-width="auto">
<option value="hadp"<?=$pconfig['powerd_normal_mode']=="hadp" ? "selected=\"selected\"" : "";?>>
<?=gettext("Hiadaptive");?>
</option>
<option value="adp" <?=$pconfig['powerd_normal_mode']=="adp" ? "selected=\"selected\"" : "";?>>
<?=gettext("Adaptive");?>
</option>
<option value="min" <?=$pconfig['powerd_normal_mode']=="min" ? "selected=\"selected\"" :"";?>>
<?=gettext("Minimum");?>
</option>
<option value="max" <?=$pconfig['powerd_normal_mode']=="max" ? "selected=\"selected\"" : "";?>>
<?=gettext("Maximum");?>
</option>
</select>
<div class="hidden" for="help_for_powerd_normal_mode">
<?=gettext("If the powerd utility can not determine the power state it uses \"normal\" for control."); ?>
</div>
</td>
</tr>
<tr> <tr>
<th colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></th> <th colspan="2" valign="top" class="listtopic"><?=gettext("RAM Disk Settings (Reboot to Apply Changes)"); ?></th>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment