Skip to content

Commit

Permalink
Merge pull request #66 from lbr38/dev
Browse files Browse the repository at this point in the history
3.2.8
  • Loading branch information
lbr38 authored Sep 17, 2022
2 parents 93b89da + 7d1ea32 commit 243673d
Show file tree
Hide file tree
Showing 118 changed files with 7,665 additions and 3,972 deletions.
8 changes: 4 additions & 4 deletions www/controllers/Browse.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public static function printFile($file, $path)
* On affiche une checkbox permettant de supprimer le fichier seulement si il s'agit d'un fichier .rpm ou .deb
*/
if (substr($file, -4) == ".rpm" or substr($file, -4) == ".deb") {
echo '<li><span class="explorer-file-pkg"><input type="checkbox" class="packageName-checkbox" name="packageName[]" value="' . $path . '" /><img src="resources/icons/products/package.png" class="icon" />' . $file . '</span></li>';
echo '<li><span class="explorer-file-pkg"><input type="checkbox" class="packageName-checkbox" name="packageName[]" value="' . $path . '" /><img src="resources/icons/package.svg" class="icon" />' . $file . '</span></li>';
} else {
echo '<li><span class="explorer-file"><img src="resources/icons/file.png" class="icon" />' . $file . '</span></li>';
echo '<li><span class="explorer-file"><img src="resources/icons/file.svg" class="icon" />' . $file . '</span></li>';
}
}

Expand All @@ -92,9 +92,9 @@ public static function printFile($file, $path)
public static function printSubDir($dir, $path)
{
if ($dir == 'my_uploaded_packages') { // Si le nom du répertoire est 'my_uploaded_packages' alors on l'affiche en jaune
echo '<li><span class="explorer-toggle yellowtext"><img src="resources/icons/folder.png" class="icon" />' . $dir . '</span>';
echo '<li><span class="explorer-toggle yellowtext"><img src="resources/icons/folder.svg" class="icon" />' . $dir . '</span>';
} else {
echo '<li><span class="explorer-toggle"><img src="resources/icons/folder.png" class="icon" />' . $dir . '</span>';
echo '<li><span class="explorer-toggle"><img src="resources/icons/folder.svg" class="icon" />' . $dir . '</span>';
}

\Controllers\Browse::tree($path . '/' . $dir); // on rappelle la fonction principale afin d'afficher l'arbsorescence de ce sous-dossier
Expand Down
16 changes: 8 additions & 8 deletions www/controllers/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,35 +322,35 @@ public function getPackageTimeline(string $id, string $packageName)
*/
if ($event['State'] == "inventored") {
$content_color = 'gray';
$content_text = '<img src="../resources/icons/products/package.png" class="icon" /> Inventored';
$content_text = '<img src="../resources/icons/package.svg" class="icon" /> Inventored';
}
if ($event['State'] == "installed") {
$content_color = 'green';
$content_text = '<img src="../resources/icons/arrow-circle-down.png" class="icon" /> Installed';
$content_text = '<img src="../resources/icons/down.svg" class="icon" /> Installed';
}
if ($event['State'] == "dep-installed") {
$content_color = 'green';
$content_text = '<img src="../resources/icons/arrow-circle-down.png" class="icon" /> Installed (as depencency)';
$content_text = '<img src="../resources/icons/down.svg" class="icon" /> Installed (as depencency)';
}
if ($event['State'] == "upgraded") {
$content_color = 'yellow';
$content_text = '<img src="../resources/icons/update.png" class="icon" /> Updated';
$content_text = '<img src="../resources/icons/update.svg" class="icon" /> Updated';
}
if ($event['State'] == "removed") {
$content_color = 'red';
$content_text = '<img src="../resources/icons/bin.png" class="icon" /> Uninstalled';
$content_text = '<img src="../resources/icons/bin.svg" class="icon" /> Uninstalled';
}
if ($event['State'] == "downgraded") {
$content_color = 'yellow';
$content_text = '<img src="../resources/icons/arrow-back.png" class="icon" /> Downgraded';
$content_text = '<img src="../resources/icons/arrow-back.svg" class="icon" /> Downgraded';
}
if ($event['State'] == "reinstalled") {
$content_color = 'yellow';
$content_text = '<img src="../resources/icons/arrow-circle-down.png" class="icon" /> Reinstalled';
$content_text = '<img src="../resources/icons/down.svg" class="icon" /> Reinstalled';
}
if ($event['State'] == "purged") {
$content_color = 'red';
$content_text = '<img src="../resources/icons/bin.png" class="icon" /> Purged';
$content_text = '<img src="../resources/icons/bin.svg" class="icon" /> Purged';
}
$content_version = $event['Version'];

Expand Down
6 changes: 3 additions & 3 deletions www/controllers/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function steplogOK(string $stepId, string $duration, string $message = nu

echo '<style>';
echo ".${stepId}-loading-{$this->pid} { display: none; }";
echo ".${stepId}-maindiv-{$this->pid} { background-color: #489f4d; }";
echo ".${stepId}-maindiv-{$this->pid} { background-color: #15bf7f; }";
echo ".${stepId}-time:before { content: '" . $duration . "' }";
echo '</style>';

Expand All @@ -203,7 +203,7 @@ public function steplogError(string $stepId, string $duration, string $error)

echo '<style>';
echo ".${stepId}-loading-{$this->pid} { display: none; }";
echo ".${stepId}-maindiv-{$this->pid} { background-color: #d9534f; }";
echo ".${stepId}-maindiv-{$this->pid} { background-color: #ff0044; }";
echo ".${stepId}-time:before { content: '" . $duration . "' }";
echo '</style>';

Expand All @@ -224,7 +224,7 @@ public function steplogDuration(string $stepId, string $duration)

echo '<style>';
echo ".${stepId}-loading-{$this->pid} { display: none; }";
echo ".${stepId}-maindiv-{$this->pid} { background-color: #93939373; }";
echo ".${stepId}-maindiv-{$this->pid} { background-color: #182b3e; }";
echo '</style>';

$this->steplogWrite();
Expand Down
17 changes: 8 additions & 9 deletions www/controllers/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -805,22 +805,22 @@ public function printOperation(string $id, bool $startedByPlan = false)
<td class="td-fit">
<?php
if ($action == "new") {
echo '<img class="icon" src="resources/icons/plus.png" title="New repo" />';
echo '<img class="icon" src="resources/icons/plus.svg" title="New repo" />';
}
if ($action == "update") {
echo '<img class="icon" src="resources/icons/update.png" title="Update repo" />';
echo '<img class="icon" src="resources/icons/update.svg" title="Update repo" />';
}
if ($action == "reconstruct") {
echo '<img class="icon" src="resources/icons/update.png" title="Rebuild metadata" />';
echo '<img class="icon" src="resources/icons/update.svg" title="Rebuild metadata" />';
}
if ($action == "env" or strpos(htmlspecialchars_decode($action), '->') !== false) {
echo '<img class="icon" src="resources/icons/link.png" title="Point an environment" />';
echo '<img class="icon" src="resources/icons/link.svg" title="Point an environment" />';
}
if ($action == "duplicate") {
echo '<img class="icon" src="resources/icons/duplicate.png" title="Duplicate" />';
echo '<img class="icon" src="resources/icons/duplicate.svg" title="Duplicate" />';
}
if ($action == "delete" or $action == "removeEnv") {
echo '<img class="icon" src="resources/icons/bin.png" title="Delete" />';
echo '<img class="icon" src="resources/icons/bin.svg" title="Delete" />';
} ?>
</td>
<td class="td-small">
Expand All @@ -839,7 +839,7 @@ public function printOperation(string $id, bool $startedByPlan = false)
* Print relaunch button if pool Id JSON file still exists
*/
if ($status != 'running' and file_exists(POOL . '/' . $poolId . '.json')) {
echo '<img class="icon-lowopacity relaunch-operation-btn" src="resources/icons/update.png" pool-id="' . $poolId . '" title="Relaunch this operation with the same parameters." />';
echo '<img class="icon-lowopacity relaunch-operation-btn" src="resources/icons/update.svg" pool-id="' . $poolId . '" title="Relaunch this operation with the same parameters." />';
}

/**
Expand Down Expand Up @@ -956,7 +956,6 @@ public function getForm(string $action, array $repos_array)
*/
ob_start();

//echo '<div class="operation-form" repo-id="' . $repoId . '" snap-id="' . $snapId . '" env-id="' . $envId . '" action="' . $action . '">';
echo '<div class="operation-form" snap-id="' . $snapId . '" env-id="' . $envId . '" action="' . $action . '">';
echo '<table>';

Expand Down Expand Up @@ -996,7 +995,7 @@ public function getForm(string $action, array $repos_array)
$content .= ob_get_clean();
}

$content .= '<br><button class="btn-large-red">Confirm and execute<img src="resources/icons/rocket.png" class="icon" /></button></form>';
$content .= '<br><button class="btn-large-red">Confirm and execute<img src="resources/icons/rocket.svg" class="icon" /></button></form><br><br>';

return $content;
}
Expand Down
38 changes: 23 additions & 15 deletions www/controllers/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,11 @@ private function getPackages()
$yumUtilsVersion = exec("rpm -qi yum-utils | grep 'Version' | awk '{print $3}'");
}
if (empty($yumUtilsVersion)) {
throw new Exception('Cannot determine yum-utils installed version.');
/**
* Closing getPackagesDiv before exiting
*/
$this->op->stepWriteToLog('</div>');
throw new Exception('Cannot determine yum-utils version.');
}

/**
Expand All @@ -2163,6 +2167,10 @@ private function getPackages()
$reposyncGpgParam = '';
}
} else {
/**
* Closing getPackagesDiv before exiting
*/
$this->op->stepWriteToLog('</div>');
throw new Exception('yum-utils version is not compatible or invalid.');
}

Expand Down Expand Up @@ -3537,7 +3545,7 @@ private function printRepoLine()
*/
echo '<div class="item-repo">';
if ($printRepoName == "yes") {
echo $this->name . '<span class="item-pkgtype lowopacity" title="This repository contains ' . $this->packageType . ' packages"><img src="resources/icons/products/package.png" class="icon-small" /> ' . $this->packageType . '</span>';
echo $this->name . '<span class="item-pkgtype-' . $this->packageType . '" title="This repository contains ' . $this->packageType . ' packages"><img src="resources/icons/package.svg" class="icon-small" /> ' . $this->packageType . '</span>';
}
echo '</div>';

Expand Down Expand Up @@ -3617,33 +3625,33 @@ private function printRepoLine()
*/
if (PRINT_REPO_TYPE == 'yes') {
if ($this->type == "mirror") {
echo '<img class="icon lowopacity" src="resources/icons/world.png" title="Type: mirror (source : ' . $this->source . ')" />';
echo '<img class="icon lowopacity" src="resources/icons/internet.svg" title="Type: mirror (source : ' . $this->source . ')" />';
} elseif ($this->type == "local") {
echo '<img class="icon lowopacity" src="resources/icons/pin.png" title="Type: local" />';
echo '<img class="icon lowopacity" src="resources/icons/pin.svg" title="Type: local" />';
} else {
echo '<img class="icon lowopacity" src="resources/icons/unknow.png" title="Type: unknow" />';
echo '<img class="icon lowopacity" src="resources/icons/unknow.svg" title="Type: unknow" />';
}
}
/**
* Affichage de l'icone de signature GPG du repo
*/
if (PRINT_REPO_SIGNATURE == 'yes') {
if ($this->signed == "yes") {
echo '<img class="icon lowopacity" src="resources/icons/key.png" title="Signed with GPG" />';
echo '<img class="icon lowopacity" src="resources/icons/key.svg" title="Signed with GPG" />';
} elseif ($this->signed == "no") {
echo '<img class="icon lowopacity" src="resources/icons/key2.png" title="Not signed with GPG" />';
echo '<img class="icon lowopacity" src="resources/icons/key2.svg" title="Not signed with GPG" />';
} else {
echo '<img class="icon lowopacity" src="resources/icons/unknow.png" title="GPG signature: unknow" />';
echo '<img class="icon lowopacity" src="resources/icons/unknow.svg" title="GPG signature: unknow" />';
}
}
/**
* Affichage de l'icone "explorer"
*/
if ($this->packageType == "rpm") {
echo "<a href=\"browse.php?id={$this->snapId}\"><img class=\"icon lowopacity\" src=\"resources/icons/search.png\" title=\"Browse $this->name ($this->dateFormatted) snapshot\" /></a>";
echo "<a href=\"browse.php?id={$this->snapId}\"><img class=\"icon lowopacity\" src=\"resources/icons/search.svg\" title=\"Browse $this->name ($this->dateFormatted) snapshot\" /></a>";
}
if ($this->packageType == "deb") {
echo "<a href=\"browse.php?id={$this->snapId}\"><img class=\"icon lowopacity\" src=\"resources/icons/search.png\" title=\"Browse $this->section ($this->dateFormatted) snapshot\" /></a>";
echo "<a href=\"browse.php?id={$this->snapId}\"><img class=\"icon lowopacity\" src=\"resources/icons/search.svg\" title=\"Browse $this->section ($this->dateFormatted) snapshot\" /></a>";
}
if (!empty($this->reconstruct)) {
if ($this->reconstruct == 'needed') {
Expand Down Expand Up @@ -3685,21 +3693,21 @@ private function printRepoLine()
* Affichage de l'icone "terminal" pour afficher la conf repo à mettre en place sur les serveurs
*/
if ($this->packageType == "rpm") {
echo '<img class="client-configuration-btn icon-lowopacity" package-type="rpm" repo="' . $this->name . '" env="' . $this->env . '" repo-dir-url="' . WWW_REPOS_DIR_URL . '" repo-conf-files-prefix="' . REPO_CONF_FILES_PREFIX . '" www-hostname="' . WWW_HOSTNAME . '" src="resources/icons/code.png" title="Print client configuration." />';
echo '<img class="client-configuration-btn icon-lowopacity" package-type="rpm" repo="' . $this->name . '" env="' . $this->env . '" repo-dir-url="' . WWW_REPOS_DIR_URL . '" repo-conf-files-prefix="' . REPO_CONF_FILES_PREFIX . '" www-hostname="' . WWW_HOSTNAME . '" src="resources/icons/download.svg" title="Show repo installation commands." />';
}
if ($this->packageType == "deb") {
echo '<img class="client-configuration-btn icon-lowopacity" package-type="deb" repo="' . $this->name . '" dist="' . $this->dist . '" section="' . $this->section . '" env="' . $this->env . '" repo-dir-url="' . WWW_REPOS_DIR_URL . '" repo-conf-files-prefix="' . REPO_CONF_FILES_PREFIX . '" www-hostname="' . WWW_HOSTNAME . '" src="resources/icons/code.png" title="Print client configuration." />';
echo '<img class="client-configuration-btn icon-lowopacity" package-type="deb" repo="' . $this->name . '" dist="' . $this->dist . '" section="' . $this->section . '" env="' . $this->env . '" repo-dir-url="' . WWW_REPOS_DIR_URL . '" repo-conf-files-prefix="' . REPO_CONF_FILES_PREFIX . '" www-hostname="' . WWW_HOSTNAME . '" src="resources/icons/download.svg" title="Show repo installation commands." />';
}

/**
* Affichage de l'icone "statistiques"
*/
if (STATS_ENABLED == "yes") {
if ($this->packageType == "rpm") {
echo "<a href=\"stats.php?id={$this->envId}\"><img class=\"icon-lowopacity\" src=\"resources/icons/stats.png\" title=\"Visualize stats and metrics of $this->name ($this->env)\" /></a>";
echo "<a href=\"stats.php?id={$this->envId}\"><img class=\"icon-lowopacity\" src=\"resources/icons/stats.svg\" title=\"Visualize stats and metrics of $this->name ($this->env)\" /></a>";
}
if ($this->packageType == "deb") {
echo "<a href=\"stats.php?id={$this->envId}\"><img class=\"icon-lowopacity\" src=\"resources/icons/stats.png\" title=\"Visualize stats and metrics of $this->section ($this->env)\" /></a>";
echo "<a href=\"stats.php?id={$this->envId}\"><img class=\"icon-lowopacity\" src=\"resources/icons/stats.svg\" title=\"Visualize stats and metrics of $this->section ($this->env)\" /></a>";
}
}

Expand All @@ -3722,7 +3730,7 @@ private function printRepoLine()
* Icone suppression de l'environnement
*/
if (!empty($this->env) and \Controllers\Common::isadmin()) {
echo '<img src="resources/icons/bin.png" class="delete-env-btn icon-lowopacity" title="Remove ' . $this->env . ' environment" repo-id="' . $this->repoId . '" snap-id="' . $this->snapId . '" env-id="' . $this->envId . '" env-name="' . $this->env . '" />';
echo '<img src="resources/icons/bin.svg" class="delete-env-btn icon-lowopacity" title="Remove ' . $this->env . ' environment" repo-id="' . $this->repoId . '" snap-id="' . $this->snapId . '" env-id="' . $this->envId . '" env-name="' . $this->env . '" />';
}

echo '</div>';
Expand Down
Loading

0 comments on commit 243673d

Please sign in to comment.