From 0924c28f2518d4c8cf21a98118ad427ae93868d2 Mon Sep 17 00:00:00 2001 From: rubn Date: Mon, 16 Feb 2026 23:26:51 +0100 Subject: [PATCH] :construction: disable description field --- gui/bastille_manager-lib.inc | 4 ++-- gui/bastille_manager_gui.php | 29 ++++++++++++----------------- gui/bastille_manager_jconf.php | 6 +++--- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index 807910c..b15870d 100644 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -319,8 +319,8 @@ function get_jail_infos() { } // Get description - $r['description'] = exec("/usr/local/bin/bastille config {$item} get description"); - if (!$r['description']) $r['description'] = "-"; + // $r['description'] = exec("/usr/local/bin/bastille config {$item} get description"); + // if (!$r['description']) $r['description'] = "-"; // Set defaults for empty values if (!$r['id']) $r['id'] = "-"; diff --git a/gui/bastille_manager_gui.php b/gui/bastille_manager_gui.php index 7053158..8a2b42f 100644 --- a/gui/bastille_manager_gui.php +++ b/gui/bastille_manager_gui.php @@ -60,8 +60,6 @@ if (isset($_GET['action']) && $_GET['action'] === 'refresh_table') { ob_start(); // 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 = []; if (function_exists('get_jail_infos')) { $jls_list = get_jail_infos(); @@ -450,8 +448,7 @@ $(window).on("load", function() { $("#refresh-interval").val(savedInterval); autoRefresh.interval = parseInt(savedInterval); } - // --- REFRESH INIT --- - // Solo iniciar si el botón está visible (habilitado en configuración) + // --- REFRESH INIT if (localStorage.getItem('bastille_show_refresh_button') === 'true') { $("#refresh-controls").show(); startAutoRefresh(); @@ -472,7 +469,7 @@ $(window).on("load", function() { } }); - // --- INICIALIZAR EL RESIZE MANUAL --- + // --- INITIALIZE MANUAL RESIZE --- initSimpleResize(); }); @@ -541,10 +538,8 @@ function updateJailTable() { // 2. Data Columns row.append($('').text(jail.id || '-')); row.append($('').text(jail.name || '-')); - // Description Column // row.append($('').text(jail.description || '-')); - row.append($('').text(jail.boot || '-')); row.append($('').text(jail.prio || '-')); row.append($('').text(jail.state || '-')); @@ -571,7 +566,7 @@ function updateJailTable() { $("#refresh-status").text('Last update: just now'); controlactionbuttons(null, '[]'); - // Re-aplicar anchos de columna guardados después de actualizar la tabla + // Reapply saved column widths after updating the table applySavedColumnWidths(); } }) @@ -594,23 +589,23 @@ function stopAutoRefresh() { if (autoRefresh.timerId) clearInterval(autoRefresh.timerId); } -// --- FUNCIÓN DE REDIMENSIONADO ESTABLE (Sin %) --- +// --- STABLE REDIMENSIONING FUNCTION (without %) --- function initSimpleResize() { var $table = $("table.area_data_selection"); var $cols = $table.find('colgroup col'); var $headers = $table.find('thead th'); - // 1. Aplicar anchos guardados al inicio + // 1. Apply saved widths at the beginning applySavedColumnWidths(); - // 2. AÑADIR TIRADORES + // 2. ADD HANDLES $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 = $('
'); $(this).append($resizer); }); - // 3. LÓGICA DE ARRASTRE + // 3. DRAG LOGIC var isResizing = false; var startX = 0; var $currentCol = null; @@ -620,7 +615,7 @@ function initSimpleResize() { e.preventDefault(); e.stopPropagation(); 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() { var w = $(this).width(); $(this).css('width', w + 'px'); @@ -652,11 +647,11 @@ function initSimpleResize() { $('.resizer').removeClass('resizing'); $(document).off('mousemove.rsz mouseup.rsz'); - // Guardar anchos al terminar de redimensionar + // Save widths after resizing saveColumnWidths(); setTimeout(function() { - // Solo reanudar si estaba habilitado + // Only resume if enabled if (localStorage.getItem('bastille_show_refresh_button') === 'true') { startAutoRefresh(); } @@ -669,7 +664,7 @@ function saveColumnWidths() { var widths = {}; var $cols = $("table.area_data_selection colgroup col"); $cols.each(function(index) { - // Guardamos el ancho en píxeles + // We save the width in pixels. widths[index] = $(this).css('width'); }); localStorage.setItem('bastille_col_widths', JSON.stringify(widths)); diff --git a/gui/bastille_manager_jconf.php b/gui/bastille_manager_jconf.php index 20b1f6d..fd5b04a 100644 --- a/gui/bastille_manager_jconf.php +++ b/gui/bastille_manager_jconf.php @@ -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['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['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. $jail_name_def = $pconfig['jname']; @@ -101,7 +101,7 @@ $jail_enforce_statfs_def = $pconfig['enforce_statfs']; $jail_osrelease_def = $pconfig['osrelease']; $jail_vnet_interface_def = $pconfig['vnet_interface']; $jail_boot_prio_def = $pconfig['boot_prio']; -$jail_description_def = $pconfig['description']; +// $jail_description_def = $pconfig['description']; // Check if is a Linux jail. $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_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("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); ?>