Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jan 4, 2025
1 parent 553039d commit 908ea6d
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 33 deletions.
37 changes: 17 additions & 20 deletions www/controllers/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -670,27 +670,24 @@ public static function sizeFormat($bytes, $returnFormat = true)
/**
* Print OS icon image
*/
public static function printOsIcon(string $os = null, string $osFamily = null)
public static function printOsIcon(string $os)
{
if (!empty($os)) {
if (preg_match('/centos/i', $os)) {
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/debian|armbian/i', $os)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/ubuntu|kubuntu|xubuntu|mint/i', $os)) {
return '<img src="/assets/icons/products/ubuntu.png" class="icon-np" title="' . $os . '" />';
}
}

/**
* If OS could not be found and OS family is specified
*/
if (!empty($osFamily)) {
if (preg_match('/debian|ubuntu|kubuntu|xubuntu|armbian|mint/i', $osFamily)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/rhel|centos|fedora/i', $osFamily)) {
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' . $os . '" />';
}
if (preg_match('/centos/i', $os)) {
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/rocky/i', $os)) {
return '<img src="/assets/icons/products/rockylinux.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/alma/i', $os)) {
return '<img src="/assets/icons/products/almalinux.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/oracle/i', $os)) {
return '<img src="/assets/icons/products/oracle.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/fedora/i', $os)) {
return '<img src="/assets/icons/products/fedora.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/redhat/i', $os)) {
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/debian|armbian/i', $os)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' . $os . '" />';
} elseif (preg_match('/ubuntu|kubuntu|xubuntu|mint/i', $os)) {
return '<img src="/assets/icons/products/ubuntu.png" class="icon-np" title="' . $os . '" />';
}

/**
Expand Down
Binary file added www/public/assets/icons/products/almalinux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified www/public/assets/icons/products/centos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/public/assets/icons/products/fedora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/public/assets/icons/products/oracle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/public/assets/icons/products/rockylinux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions www/public/resources/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,17 @@ function printOsIcon(os = '', os_family = '')
if (os != '') {
if (os.toLowerCase() == 'centos') {
return '<img src="/assets/icons/products/centos.png" class="icon-np" title="' + os + '">';

} else if (os.toLowerCase().match(/rocky/i)) {
return '<img src="/assets/icons/products/rockylinux.png" class="icon-np" title="' + os + '">';
} else if (os.toLowerCase().match(/alma/i)) {
return '<img src="/assets/icons/products/almalinux.png" class="icon-np" title="' + os + '">';
} else if (os.toLowerCase().match(/oracle/i)) {
return '<img src="/assets/icons/products/oracle.png" class="icon-np" title="' + os + '">';
} else if (os.toLowerCase().match(/fedora/i)) {
return '<img src="/assets/icons/products/fedora.png" class="icon-np" title="' + os + '">';
} else if (os.toLowerCase().match(/redhat/i)) {
return '<img src="/assets/icons/products/redhat.png" class="icon-np" title="' + os + '">';
} else if (os.toLowerCase().match(/debian|armbian/i)) {
return '<img src="/assets/icons/products/debian.png" class="icon-np" title="' + os + '">';
} else if (os.toLowerCase().match(/ubuntu|kubuntu|xubuntu|mint/i)) {
Expand Down
9 changes: 6 additions & 3 deletions www/public/resources/styles/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -688,16 +688,19 @@ textarea {

.label-icon-tr {
display: grid;
grid-template-columns: 20px auto;
grid-template-columns: 30px 1fr;
align-items: center;
column-gap: 5px;
justify-items: center;
justify-content: space-between;
column-gap: 10px;
font-size: 12px;
padding: 6px;
padding: 4px;
min-width: 12px;
min-height: 12px;
border-radius: 60px;
border: 1px solid #24405c;
color: white;
text-align: left;
box-shadow: rgb(12 18 20 / 67%) 0px 0px 0px 1px;
}

Expand Down
4 changes: 4 additions & 0 deletions www/public/resources/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ body {
font-size: 13px;
}

.font-family-archivo {
font-family: 'archivo';
}

header {
width: 100%;
margin-bottom: 20px;
Expand Down
2 changes: 1 addition & 1 deletion www/public/resources/styles/stats-hosts.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}

.hosts-compact-view2 {
grid-template-columns: 40% 20%;
grid-template-columns: 40% 18%;
justify-content: space-evenly;
}

Expand Down
15 changes: 6 additions & 9 deletions www/views/includes/containers/hosts/list.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,12 @@
</div>

<div class="grid hosts-compact-view2 column-gap-20 align-item-center">
<div class="flex flex-direction-column row-gap-10">
<div class="label-icon-tr" title="OS">
<?= \Controllers\Common::printOsIcon($os); ?>
<p class="font-size-13"><?= ucfirst($os) . ' ' . $osVersion ?> </p>
</div>
<div class="label-icon-tr" title="OS">
<?= \Controllers\Common::printOsIcon($os); ?>

<div class="label-icon-tr" title="Type">
<?= \Controllers\Common::printTypeIcon($type); ?>
<p class="font-size-13"><?= ucfirst($type) ?></p>
<div class="flex flex-direction-column row-gap-2 width-100">
<p class="font-size-13"><?= ucfirst($os) . ' ' . $osVersion ?></p>
<p class="font-size-10 font-family-archivo mediumopacity-cst"><b><?= strtoupper($type) ?></b></p>
</div>
</div>

Expand Down Expand Up @@ -389,7 +386,7 @@
<div>
<h6 class="margin-top-0"><?= $layoutPackagesTitle ?> INSTALLED</h6>
<p title="<?= $packagesInstalledTotal . ' package(s) installed on this host' ?>">
<span class="label-white"><?= $packagesInstalledTotal ?></span>
<?= $packagesInstalledTotal ?>
</p>
</div>

Expand Down

0 comments on commit 908ea6d

Please sign in to comment.