Prohibit CPU isolation in safe mode

This commit is contained in:
bergware
2018-09-06 17:30:42 +02:00
parent 63aee618da
commit 7deead9d61
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -22,7 +22,11 @@ Tag="leaf"
</table>
<input type="button" value="Apply" onclick="apply(this.form)" disabled><input type="button" value="Done" onclick="done()"><span id="wait-is" class="red-text" style="display:none"><i class="fa fa-spinner fa-spin"></i> Please wait...</span>
</form>
<?if (!$safemode):?>
<div class="notice isol" style="display:none">System must be rebooted for changes to take effect!</div>
<?else:?>
<div class="notice">CPU isolation is prohibited while system is running in SAFE MODE!</div>
<?endif;?>
> CPU isolation allows the user to specify CPU cores that are to be explicitly reserved for assignment (to VMs or Docker containers).
>
+5 -1
View File
@@ -16,7 +16,8 @@ Tag="map-marker"
?>
<?
$libvirtd = pgrep('libvirtd')!==false;
$dockerd = pgrep('dockerd')!==false;
$dockerd = pgrep('dockerd')!==false;
$safemode = strpos(file_get_contents('/proc/cmdline'),'unraidsafemode')!==false;
$cpus = cpu_list();
$total = count($cpus);
@@ -132,6 +133,9 @@ function is() {
$.post('/webGui/include/CPUset.php',{id:'is',cpus:'<?=$cpuset?>'},function(d){
$('#table-is').html(d);
buttons(document.is);
<?if ($safemode):?>
$('#table-is').find('input[type=checkbox]').prop('disabled',true);
<?endif;?>
});
}
function notice() {