🚧 disable description field

This commit is contained in:
rubn
2026-02-16 23:26:51 +01:00
parent 9ebfeab85c
commit 0924c28f25
3 changed files with 17 additions and 22 deletions
+2 -2
View File
@@ -319,8 +319,8 @@ function get_jail_infos() {
} }
// Get description // Get description
$r['description'] = exec("/usr/local/bin/bastille config {$item} get description"); // $r['description'] = exec("/usr/local/bin/bastille config {$item} get description");
if (!$r['description']) $r['description'] = "-"; // if (!$r['description']) $r['description'] = "-";
// Set defaults for empty values // Set defaults for empty values
if (!$r['id']) $r['id'] = "-"; if (!$r['id']) $r['id'] = "-";
+12 -17
View File
@@ -60,8 +60,6 @@ if (isset($_GET['action']) && $_GET['action'] === 'refresh_table') {
ob_start(); ob_start();
// Fetch fresh data // Fetch fresh data
// Note: We rely on the internal caching of get_jail_infos() (5 seconds)
// to avoid overloading the system with 'bastille list' commands if multiple requests occur.
$jls_list = []; $jls_list = [];
if (function_exists('get_jail_infos')) { if (function_exists('get_jail_infos')) {
$jls_list = get_jail_infos(); $jls_list = get_jail_infos();
@@ -450,8 +448,7 @@ $(window).on("load", function() {
$("#refresh-interval").val(savedInterval); $("#refresh-interval").val(savedInterval);
autoRefresh.interval = parseInt(savedInterval); autoRefresh.interval = parseInt(savedInterval);
} }
// --- REFRESH INIT --- // --- REFRESH INIT
// Solo iniciar si el botón está visible (habilitado en configuración)
if (localStorage.getItem('bastille_show_refresh_button') === 'true') { if (localStorage.getItem('bastille_show_refresh_button') === 'true') {
$("#refresh-controls").show(); $("#refresh-controls").show();
startAutoRefresh(); startAutoRefresh();
@@ -472,7 +469,7 @@ $(window).on("load", function() {
} }
}); });
// --- INICIALIZAR EL RESIZE MANUAL --- // --- INITIALIZE MANUAL RESIZE ---
initSimpleResize(); initSimpleResize();
}); });
@@ -541,10 +538,8 @@ function updateJailTable() {
// 2. Data Columns // 2. Data Columns
row.append($('<td class="lcell">').text(jail.id || '-')); row.append($('<td class="lcell">').text(jail.id || '-'));
row.append($('<td class="lcell">').text(jail.name || '-')); row.append($('<td class="lcell">').text(jail.name || '-'));
// Description Column // Description Column
// row.append($('<td class="lcell">').text(jail.description || '-')); // row.append($('<td class="lcell">').text(jail.description || '-'));
row.append($('<td class="lcell">').text(jail.boot || '-')); row.append($('<td class="lcell">').text(jail.boot || '-'));
row.append($('<td class="lcell">').text(jail.prio || '-')); row.append($('<td class="lcell">').text(jail.prio || '-'));
row.append($('<td class="lcell">').text(jail.state || '-')); row.append($('<td class="lcell">').text(jail.state || '-'));
@@ -571,7 +566,7 @@ function updateJailTable() {
$("#refresh-status").text('Last update: just now'); $("#refresh-status").text('Last update: just now');
controlactionbuttons(null, '<?=$checkbox_member_name;?>[]'); controlactionbuttons(null, '<?=$checkbox_member_name;?>[]');
// Re-aplicar anchos de columna guardados después de actualizar la tabla // Reapply saved column widths after updating the table
applySavedColumnWidths(); applySavedColumnWidths();
} }
}) })
@@ -594,23 +589,23 @@ function stopAutoRefresh() {
if (autoRefresh.timerId) clearInterval(autoRefresh.timerId); if (autoRefresh.timerId) clearInterval(autoRefresh.timerId);
} }
// --- FUNCIÓN DE REDIMENSIONADO ESTABLE (Sin %) --- // --- STABLE REDIMENSIONING FUNCTION (without %) ---
function initSimpleResize() { function initSimpleResize() {
var $table = $("table.area_data_selection"); var $table = $("table.area_data_selection");
var $cols = $table.find('colgroup col'); var $cols = $table.find('colgroup col');
var $headers = $table.find('thead th'); var $headers = $table.find('thead th');
// 1. Aplicar anchos guardados al inicio // 1. Apply saved widths at the beginning
applySavedColumnWidths(); applySavedColumnWidths();
// 2. AÑADIR TIRADORES // 2. ADD HANDLES
$headers.each(function(i) { $headers.each(function(i) {
if (i >= $headers.length - 1) return; // Ignorar la última columna if (i >= $headers.length - 1) return; // Ignore the last column
var $resizer = $('<div class="resizer"></div>'); var $resizer = $('<div class="resizer"></div>');
$(this).append($resizer); $(this).append($resizer);
}); });
// 3. LÓGICA DE ARRASTRE // 3. DRAG LOGIC
var isResizing = false; var isResizing = false;
var startX = 0; var startX = 0;
var $currentCol = null; var $currentCol = null;
@@ -620,7 +615,7 @@ function initSimpleResize() {
e.preventDefault(); e.stopPropagation(); e.preventDefault(); e.stopPropagation();
stopAutoRefresh(); stopAutoRefresh();
// Convertir todas las columnas a píxeles fijos al iniciar el arrastre // Convert all columns to fixed pixels when starting to drag
$cols.each(function() { $cols.each(function() {
var w = $(this).width(); var w = $(this).width();
$(this).css('width', w + 'px'); $(this).css('width', w + 'px');
@@ -652,11 +647,11 @@ function initSimpleResize() {
$('.resizer').removeClass('resizing'); $('.resizer').removeClass('resizing');
$(document).off('mousemove.rsz mouseup.rsz'); $(document).off('mousemove.rsz mouseup.rsz');
// Guardar anchos al terminar de redimensionar // Save widths after resizing
saveColumnWidths(); saveColumnWidths();
setTimeout(function() { setTimeout(function() {
// Solo reanudar si estaba habilitado // Only resume if enabled
if (localStorage.getItem('bastille_show_refresh_button') === 'true') { if (localStorage.getItem('bastille_show_refresh_button') === 'true') {
startAutoRefresh(); startAutoRefresh();
} }
@@ -669,7 +664,7 @@ function saveColumnWidths() {
var widths = {}; var widths = {};
var $cols = $("table.area_data_selection colgroup col"); var $cols = $("table.area_data_selection colgroup col");
$cols.each(function(index) { $cols.each(function(index) {
// Guardamos el ancho en píxeles // We save the width in pixels.
widths[index] = $(this).css('width'); widths[index] = $(this).css('width');
}); });
localStorage.setItem('bastille_col_widths', JSON.stringify(widths)); localStorage.setItem('bastille_col_widths', JSON.stringify(widths));
+3 -3
View File
@@ -87,7 +87,7 @@ $pconfig['enforce_statfs'] = exec("/usr/bin/grep '.*enforce_statfs.*=' $jail_con
$pconfig['osrelease'] = exec("/usr/local/bin/bastille config {$item} get osrelease | cut -d '=' -f2 | tr -d ' ;'"); $pconfig['osrelease'] = exec("/usr/local/bin/bastille config {$item} get osrelease | cut -d '=' -f2 | tr -d ' ;'");
$pconfig['vnet_interface'] = exec("/usr/bin/grep '.*vnet.interface.*=' $jail_config | cut -d '=' -f2 | tr -d ' ;'"); $pconfig['vnet_interface'] = exec("/usr/bin/grep '.*vnet.interface.*=' $jail_config | cut -d '=' -f2 | tr -d ' ;'");
$pconfig['boot_prio'] = exec("/usr/local/bin/bastille config {$item} get priority"); $pconfig['boot_prio'] = exec("/usr/local/bin/bastille config {$item} get priority");
$pconfig['description'] = exec("/usr/local/bin/bastille config {$item} get description"); // $pconfig['description'] = exec("/usr/local/bin/bastille config {$item} get description");
// Set the jail config default parameters. // Set the jail config default parameters.
$jail_name_def = $pconfig['jname']; $jail_name_def = $pconfig['jname'];
@@ -101,7 +101,7 @@ $jail_enforce_statfs_def = $pconfig['enforce_statfs'];
$jail_osrelease_def = $pconfig['osrelease']; $jail_osrelease_def = $pconfig['osrelease'];
$jail_vnet_interface_def = $pconfig['vnet_interface']; $jail_vnet_interface_def = $pconfig['vnet_interface'];
$jail_boot_prio_def = $pconfig['boot_prio']; $jail_boot_prio_def = $pconfig['boot_prio'];
$jail_description_def = $pconfig['description']; // $jail_description_def = $pconfig['description'];
// Check if is a Linux jail. // Check if is a Linux jail.
$is_linux_jail = exec("/usr/bin/grep linsysfs {$jail_dir}/{$jail_name_def}/fstab"); $is_linux_jail = exec("/usr/bin/grep linsysfs {$jail_dir}/{$jail_name_def}/fstab");
@@ -515,7 +515,7 @@ endif;
html_titleline2(gtext("Misc Configuration")); html_titleline2(gtext("Misc Configuration"));
html_checkbox2('autostart',gtext('Autoboot'),!empty($pconfig['autostart']) ? true : false,gtext('Autoboot this jail after system reboot.'),'',false); html_checkbox2('autostart',gtext('Autoboot'),!empty($pconfig['autostart']) ? true : false,gtext('Autoboot this jail after system reboot.'),'',false);
html_inputbox("boot_prio", gtext("Priority"), $pconfig['boot_prio'], gtext("Set the priority value of the jail. Affects the boot order behaviour."), false, 20); html_inputbox("boot_prio", gtext("Priority"), $pconfig['boot_prio'], gtext("Set the priority value of the jail. Affects the boot order behaviour."), false, 20);
html_inputbox("description", gtext("Description"), $pconfig['description'], gtext("Set a description for the jail."), false, 40); // html_inputbox("description", gtext("Description"), $pconfig['description'], gtext("Set a description for the jail."), false, 40);
//html_checkbox2('force_edit',gtext('Force edit'),!empty($pconfig['force_edit']) ? true : false,gtext('Automatically stop and start this jail if is already running.'),'',false); //html_checkbox2('force_edit',gtext('Force edit'),!empty($pconfig['force_edit']) ? true : false,gtext('Automatically stop and start this jail if is already running.'),'',false);
?> ?>
</table> </table>