Add action to set priority value from utilities
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
======================
|
======================
|
||||||
Version Description
|
Version Description
|
||||||
|
|
||||||
|
1.1.48......Add action to set priority value from utilities.
|
||||||
1.1.47......Cosmetic changes and improvements.
|
1.1.47......Cosmetic changes and improvements.
|
||||||
1.1.46......Display jail IP using bastille list buil-in command.
|
1.1.46......Display jail IP using bastille list buil-in command.
|
||||||
1.1.45......Code update for recent bastille boot settings changes.
|
1.1.45......Code update for recent bastille boot settings changes.
|
||||||
|
|||||||
@@ -318,6 +318,31 @@ if($_POST):
|
|||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'priority':
|
||||||
|
// Input validation required
|
||||||
|
if(empty($input_errors)):
|
||||||
|
$container = [];
|
||||||
|
$container['uuid'] = $_POST['uuid'];
|
||||||
|
$container['jailname'] = $_POST['jailname'];
|
||||||
|
$set_priority = $pconfig['prioritynumber'];
|
||||||
|
$item = $container['jailname'];
|
||||||
|
if(exec("/usr/sbin/sysrc -f {$jail_dir}/{$item}/{$jail_settings} -qn priority")):
|
||||||
|
if (is_numeric($set_priority)):
|
||||||
|
$cmd = ("/usr/local/bin/bastille config {$item} set priority {$set_priority}");
|
||||||
|
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
||||||
|
if($retval == 0):
|
||||||
|
header('Location: bastille_manager_gui.php');
|
||||||
|
exit;
|
||||||
|
else:
|
||||||
|
$input_errors[] = gtext("Failed to set priority.");
|
||||||
|
endif;
|
||||||
|
else:
|
||||||
|
$input_errors[] = gtext("Priority value must be a number.");
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'fstab':
|
case 'fstab':
|
||||||
// Input validation not required
|
// Input validation not required
|
||||||
if(empty($input_errors)):
|
if(empty($input_errors)):
|
||||||
@@ -458,33 +483,44 @@ function action_change() {
|
|||||||
showElementById('backup_tr', 'show');
|
showElementById('backup_tr', 'show');
|
||||||
showElementById('format_tr', 'show');
|
showElementById('format_tr', 'show');
|
||||||
showElementById('safemode_tr', 'show');
|
showElementById('safemode_tr', 'show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "clone":
|
case "clone":
|
||||||
showElementById('newname_tr','show');
|
showElementById('newname_tr','show');
|
||||||
showElementById('newipaddr_tr','show');
|
showElementById('newipaddr_tr','show');
|
||||||
showElementById('clonestop_tr','show');
|
showElementById('clonestop_tr','show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "update":
|
case "update":
|
||||||
showElementById('confirmname_tr','hide');
|
showElementById('confirmname_tr','hide');
|
||||||
showElementById('nowstop_tr','hide');
|
showElementById('nowstop_tr','hide');
|
||||||
showElementById('update_base_tr','show');
|
showElementById('update_base_tr','show');
|
||||||
showElementById('update_jail_tr','show');
|
showElementById('update_jail_tr','show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "base":
|
case "base":
|
||||||
showElementById('confirmname_tr','hide');
|
showElementById('confirmname_tr','hide');
|
||||||
showElementById('nowstop_tr','hide');
|
showElementById('nowstop_tr','hide');
|
||||||
showElementById('jail_release_tr', 'show');
|
showElementById('jail_release_tr', 'show');
|
||||||
showElementById('release_tr','show');
|
showElementById('release_tr','show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "autoboot":
|
case "autoboot":
|
||||||
showElementById('confirmname_tr','hide');
|
showElementById('confirmname_tr','hide');
|
||||||
showElementById('nowstop_tr','hide');
|
showElementById('nowstop_tr','hide');
|
||||||
showElementById('auto_boot_tr', 'show');
|
showElementById('auto_boot_tr', 'show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "noauto":
|
case "noauto":
|
||||||
showElementById('confirmname_tr','hide');
|
showElementById('confirmname_tr','hide');
|
||||||
showElementById('nowstop_tr','hide');
|
showElementById('nowstop_tr','hide');
|
||||||
showElementById('no_autoboot_tr', 'show');
|
showElementById('no_autoboot_tr', 'show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
|
break;
|
||||||
|
case "priority":
|
||||||
|
showElementById('confirmname_tr','hide');
|
||||||
|
showElementById('nowstop_tr','hide');
|
||||||
|
showElementById('prioritynumber_tr','show');
|
||||||
break;
|
break;
|
||||||
case "fstab":
|
case "fstab":
|
||||||
showElementById('confirmname_tr','hide');
|
showElementById('confirmname_tr','hide');
|
||||||
@@ -495,15 +531,18 @@ function action_change() {
|
|||||||
showElementById('readonly_tr','show');
|
showElementById('readonly_tr','show');
|
||||||
showElementById('createdir_tr','show');
|
showElementById('createdir_tr','show');
|
||||||
showElementById('automount_tr','show');
|
showElementById('automount_tr','show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "delete":
|
case "delete":
|
||||||
showElementById('confirmname_tr','show');
|
showElementById('confirmname_tr','show');
|
||||||
showElementById('nowstop_tr','show');
|
showElementById('nowstop_tr','show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
case "advanced":
|
case "advanced":
|
||||||
showElementById('confirmname_tr','hide');
|
showElementById('confirmname_tr','hide');
|
||||||
showElementById('nowstop_tr','hide');
|
showElementById('nowstop_tr','hide');
|
||||||
showElementById('advanced_tr','show');
|
showElementById('advanced_tr','show');
|
||||||
|
showElementById('prioritynumber_tr','hide');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -577,6 +616,7 @@ $document->render();
|
|||||||
'base' => gettext('Release'),
|
'base' => gettext('Release'),
|
||||||
'autoboot' => gettext('Autoboot'),
|
'autoboot' => gettext('Autoboot'),
|
||||||
'noauto' => gettext('Noauto'),
|
'noauto' => gettext('Noauto'),
|
||||||
|
'priority' => gettext('Priority'),
|
||||||
'fstab' => gettext('Fstab'),
|
'fstab' => gettext('Fstab'),
|
||||||
'delete' => gettext('Destroy'),
|
'delete' => gettext('Destroy'),
|
||||||
'advanced' => gettext('Advanced'),
|
'advanced' => gettext('Advanced'),
|
||||||
@@ -605,6 +645,7 @@ $document->render();
|
|||||||
html_checkbox2('safemode',gettext('Safe ZFS export'),!empty($pconfig['safemode']) ? true : false,gettext('Safely stop and start a ZFS jail before the exporting process, this has no effect on .TGZ/TXZ since the jail should be stopped regardless.'),'',false);
|
html_checkbox2('safemode',gettext('Safe ZFS export'),!empty($pconfig['safemode']) ? true : false,gettext('Safely stop and start a ZFS jail before the exporting process, this has no effect on .TGZ/TXZ since the jail should be stopped regardless.'),'',false);
|
||||||
endif;
|
endif;
|
||||||
html_inputbox2('confirmname',gettext('Enter name for confirmation'),!empty($pconfig['confirmname']),'',true,30);
|
html_inputbox2('confirmname',gettext('Enter name for confirmation'),!empty($pconfig['confirmname']),'',true,30);
|
||||||
|
html_inputbox2('prioritynumber',gettext('Enter priority value'),!empty($pconfig['prioritynumber']),'',true,30);
|
||||||
html_checkbox2('nowstop',gettext('Stop container'),!empty($pconfig['nowstop']) ? true : false,gettext('Stop the container if running before deletion.'),'',false);
|
html_checkbox2('nowstop',gettext('Stop container'),!empty($pconfig['nowstop']) ? true : false,gettext('Stop the container if running before deletion.'),'',false);
|
||||||
html_inputbox2('newname',gettext('Enter a name for the new container'),!empty($pconfig['newname']),'',true,30);
|
html_inputbox2('newname',gettext('Enter a name for the new container'),!empty($pconfig['newname']),'',true,30);
|
||||||
html_inputbox2('newipaddr',gettext('Enter a IP address for the new container'),!empty($pconfig['newipaddr']),'',true,30);
|
html_inputbox2('newipaddr',gettext('Enter a IP address for the new container'),!empty($pconfig['newipaddr']),'',true,30);
|
||||||
|
|||||||
Reference in New Issue
Block a user