0.3.2: register boot integration in config.xml (loaderconf + rc postinit); stop editing generated files
This commit is contained in:
1 parent
29365ce649
commit
5bdd3c82c6
5 files changed
+157
-18
No files matched your search
@@ -4,6 +4,16 @@
|
||||
*/
|
||||
|
||||
require_once 'vmmngr-boot.inc';
|
||||
require_once 'vmmngr-config-lib.inc';
|
||||
|
||||
if (strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? '')) === 'POST' && ($_POST['act'] ?? '') === 'register') {
|
||||
$added = vmm_register_boot();
|
||||
$_SESSION['vmmngr_error'] = $added === []
|
||||
? gettext('Boot integration was already complete - nothing changed.')
|
||||
: sprintf(gettext('Added to config.xml: %s. Modules take effect at the next boot.'), implode(', ', $added));
|
||||
header('Location: vmmngr_config.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$pgtitle = [gettext('Extensions'), gettext('VM Manager'), gettext('Configuration')];
|
||||
$sc = vmm_selfcheck();
|
||||
@@ -16,6 +26,35 @@ vmm_nav('config'); ?>
|
||||
|
||||
<form action="vmmngr_config.php" method="post" name="iform" id="iform"><table id="area_data"><tbody><tr><td id="area_data_frame">
|
||||
|
||||
<?php if (!empty($_SESSION['vmmngr_error'])): ?>
|
||||
<?php print_info_box(vmm_h((string)$_SESSION['vmmngr_error'])); unset($_SESSION['vmmngr_error']); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $bs = vmm_boot_state(); ?>
|
||||
<table class="area_data_settings" style="width:100%;border-collapse:collapse;">
|
||||
<colgroup><col class="area_data_settings_col_tag"><col class="area_data_settings_col_data"></colgroup>
|
||||
<thead>
|
||||
<?php html_separator2(); html_titleline2(gettext('Boot integration (config.xml)'), 2); ?>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td class="celltag">vmm_load</td><td class="celldata">
|
||||
<span class="<?=$bs['vmm_load'] !== '' ? 'vmm-ok' : 'vmm-miss';?>"><?=$bs['vmm_load'] !== '' ? vmm_h($bs['vmm_load']) : gettext('missing');?></span>
|
||||
</td></tr>
|
||||
<tr><td class="celltag">nmdm_load</td><td class="celldata">
|
||||
<span class="<?=$bs['nmdm_load'] !== '' ? 'vmm-ok' : 'vmm-miss';?>"><?=$bs['nmdm_load'] !== '' ? vmm_h($bs['nmdm_load']) : gettext('missing');?></span>
|
||||
</td></tr>
|
||||
<tr><td class="celltag"><?=gettext('Postinit hook');?></td><td class="celldata">
|
||||
<span class="<?=$bs['rc_postinit'] ? 'vmm-ok' : 'vmm-miss';?>"><?=$bs['rc_postinit'] ? gettext('registered') : gettext('missing');?></span>
|
||||
</td></tr>
|
||||
<tr><td class="celltag"><?=gettext('Action');?></td><td class="celldata">
|
||||
<button type="submit" class="formbtn" name="act" value="register"><?=gettext('Register in config.xml');?></button>
|
||||
<span style="opacity:.75;margin-left:8px;"><?=gettext('XigmaNAS regenerates loader.conf.local and rc.conf from config.xml at boot; direct file edits do not survive.');?></span>
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<table class="area_data_settings" style="width:100%;border-collapse:collapse;">
|
||||
<colgroup>
|
||||
<col class="area_data_settings_col_tag">
|
||||
|
||||
Reference in new issue
Block a user