Skip to content

Commit

Permalink
4.16.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jan 27, 2025
1 parent ca73a59 commit 36e1c39
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 50 deletions.
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ARG DEBIAN_FRONTEND=noninteractive
ARG env
ARG fqdn
ARG max_upload_size
ARG php_memory_limit="256M"

# PACKAGES INSTALL

Expand Down Expand Up @@ -54,6 +55,7 @@ RUN cp /tmp/repomanager/docker/config/php/www.conf /etc/php/8.3/fpm/pool.d/www.c
RUN cp /tmp/repomanager/docker/config/php/opcache.ini /etc/php/8.3/mods-available/opcache.ini
RUN sed -i "s/^upload_max_filesize.*$/upload_max_filesize = $max_upload_size/g" /etc/php/8.3/fpm/php.ini
RUN sed -i "s/^post_max_size.*$/post_max_size = $max_upload_size/g" /etc/php/8.3/fpm/php.ini
RUN sed -i "s/^memory_limit.*$/memory_limit = $php_memory_limit/g" /etc/php/8.3/fpm/php.ini

# Configure SQLite
RUN echo ".headers on" > /root/.sqliterc
Expand Down
4 changes: 4 additions & 0 deletions docker/init
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ if [ ! -z "$MAX_UPLOAD_SIZE" ];then
sed -i "s/^post_max_size.*$/post_max_size = ${MAX_UPLOAD_SIZE}/g" /etc/php/8.3/fpm/php.ini
fi

if [ ! -z "$PHP_MEMORY_LIMIT" ];then
sed -i "s/^memory_limit.*$/memory_limit = ${PHP_MEMORY_LIMIT}/g" /etc/php/8.3/fpm/php.ini
fi

# Start services
if [ -f "/etc/init.d/syslog-ng" ];then
/usr/sbin/service syslog-ng start
Expand Down
91 changes: 44 additions & 47 deletions www/public/resources/js/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ function searchHost()
}

/**
* Rechercher les hôtes possédant un paquet
* Research hosts with a package
*/
var getHostsWithPackage_locked = false;

function getHostsWithPackage()
{
/**
* Si une recherche est déjà en cours, on sort
* If a search is already in progress, exit
*/
if (getHostsWithPackage_locked === true) {
return;
Expand All @@ -282,34 +282,33 @@ function getHostsWithPackage()
printLoading();

/**
* A chaque saisie on (ré)-affiche tous les éléments masquées
* et on supprime les éventuelles infos dans le 'host-additionnal-info'
* On every input, (re)-display all hidden elements and remove any info in 'host-additionnal-info'
*/
$('.hosts-group-container').show();
$('.host-line').show();
$('div.host-additionnal-info').html('');
$('div.host-additionnal-info').hide();

/**
* On utilise un setTimeout pour laisser le temps à l'utilisateur de terminer sa saisie avant de rechercher
* Use a setTimeout to give the user time to finish typing before searching
*/
setTimeout(function () {
/**
* Si l'input est vide, on quitte
*/
* If the input is empty, quit
*/
if (!$("#getHostsWithPackageInput").val()) {
getHostsWithPackage_locked = false;
return;
}

/**
* Récupération du terme recherché dans l'input
* Retrieve the search term from the input
*/
var package = $("#getHostsWithPackageInput").val();
var hosts = [];

/**
* Pour chaque id, on fait appel à la fonction getHostsWithPackage pour vérifier si le paquet existe sur l'hôte
* For each Id, call the getHostsWithPackageAjax function to check if the package exists on the host
*/
$('.hosts-table').find(".host-line").each(function () {
var hostid = $(this).attr('hostid');
Expand Down Expand Up @@ -974,54 +973,52 @@ $(document).on('mouseleave', '.event-packages-details', function () {
*/
function getHostsWithPackageAjax(hosts, package)
{
$.ajax({
type: "POST",
url: "/ajax/controller.php",
data: {
controller: "host",
action: "getHostsWithPackage",
ajaxRequest(
// Controller:
'host',
// Action:
'getHostsWithPackage',
// Data:
{
hostsIdArray: hosts,
package: package
},
dataType: "json",
success: function (data, textStatus, jqXHR) {
jsonValue = jQuery.parseJSON(jqXHR.responseText);
const hostsArray = jQuery.parseJSON(jsonValue.message);
// Print success alert:
false,
// Print error alert:
true
).then(() => {
const hostsArray = jQuery.parseJSON(jsonValue.message);

for (const [hostId, subArray] of Object.entries(hostsArray)) {
packagesFound = '';
for (const [hostId, subArray] of Object.entries(hostsArray)) {
packagesFound = '';

/**
* If package found
*/
if (Object.keys(subArray).length > 0) {
for (const [packageName, packageVersion] of Object.entries(subArray)) {
/**
* Build package list
*/
packagesFound += '<div class="flex align-item-center column-gap-5"><img src="/assets/icons/package.svg" class="icon-np"> <span>' + packageName + ' (' + packageVersion + ')</span></div>';
}

/**
* Show the host and print the package(s) found
*/
$('.host-line[hostid=' + hostId + ']').find('div.host-additionnal-info').html('<h6>RESULTS</h6>' + packagesFound);
$('.host-line[hostid=' + hostId + ']').find('div.host-additionnal-info').css('display', 'flex');
$('.host-line[hostid=' + hostId + ']').show();
} else {
/**
* If package found
*/
if (Object.keys(subArray).length > 0) {
for (const [packageName, packageVersion] of Object.entries(subArray)) {
/**
* Else hide the host
* Build package list
*/
$('.host-line[hostid=' + hostId + ']').hide();
packagesFound += '<div class="flex align-item-center column-gap-5"><img src="/assets/icons/package.svg" class="icon-np"> <span>' + packageName + ' (' + packageVersion + ')</span></div>';
}

/**
* Show the host and print the package(s) found
*/
$('.host-line[hostid=' + hostId + ']').find('div.host-additionnal-info').html('<h6>RESULTS</h6>' + packagesFound);
$('.host-line[hostid=' + hostId + ']').find('div.host-additionnal-info').css('display', 'flex');
$('.host-line[hostid=' + hostId + ']').show();
} else {
/**
* Else hide the host
*/
$('.host-line[hostid=' + hostId + ']').removeClass('flex').hide();
}
}

hideGroupDiv();
},
error: function (jqXHR, textStatus, thrownError) {
jsonValue = jQuery.parseJSON(jqXHR.responseText);
printAlert(jsonValue.message, 'error');
},
hideGroupDiv();
});
}

Expand Down
2 changes: 1 addition & 1 deletion www/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.16.3
4.16.4
5 changes: 3 additions & 2 deletions www/views/includes/containers/browse/actions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
<input type="hidden" name="snapId" value="<?= $snapId ?>" />

<h6 class="margin-top-0">SELECT PACKAGES TO UPLOAD</h6>
<p class="note">Valid MIME types: <code class="font-size-11">application/x-rpm</code> and <code class="font-size-11">application/vnd.debian.binary-package</code>
</p>
<p class="note">Max upload size: <?= ini_get('upload_max_filesize') ?></p>
<p class="note">Valid MIME types: <code class="font-size-11">application/x-rpm</code> and <code class="font-size-11">application/vnd.debian.binary-package</code></p>

<br>
<input type="file" name="packages[]" accept="application/vnd.debian.binary-package" multiple />

Expand Down

0 comments on commit 36e1c39

Please sign in to comment.