Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jan 7, 2025
1 parent aa07d92 commit 0b2b1c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions www/controllers/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ public function __construct()
*/
public static function getEnvColor(string $name)
{
// Default color
$color = '#ffffff';

// Retrieve color from ENVS array
if (defined('ENVS')) {
foreach (ENVS as $env) {
if ($env['Name'] == $name and !empty($env['Color'])) {
$color = $env['Color'];
return $env['Color'];
}
}
}

return $color;
return '#ffffff';
}

/**
Expand Down
3 changes: 1 addition & 2 deletions www/views/includes/containers/hosts/overview.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@

$envNameList .= "'" . $envName . "',";
$envCountList .= "'" . $env['Env_count'] . "',";

$envBackgroundColor .= '"' . \Controllers\Environment::getEnvColor($envNameList) . '",';
$envBackgroundColor .= '"' . \Controllers\Environment::getEnvColor($envName) . '",';
}

$labels = rtrim($envNameList, ',');
Expand Down

0 comments on commit 0b2b1c3

Please sign in to comment.