mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
Merge remote-tracking branch 'origin/next' into s3-restore
Resolve merge conflicts in: - bootstrap/helpers/shared.php (kept both formatBytes, isSafeTmpPath, and formatContainerStatus functions) - database/migrations/2025_10_10_120002_create_cloud_init_scripts_table.php (added Schema::hasTable check) - database/migrations/2025_10_10_120002_create_webhook_notification_settings_table.php (added Schema::hasTable check) - resources/views/livewire/project/application/general.blade.php (formatting/whitespace) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3267,3 +3267,46 @@ function isSafeTmpPath(?string $path): bool
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform colon-delimited status format to human-readable parentheses format.
|
||||
*
|
||||
* Handles Docker container status formats with optional health check status and exclusion modifiers.
|
||||
*
|
||||
* Examples:
|
||||
* - running:healthy → Running (healthy)
|
||||
* - running:unhealthy:excluded → Running (unhealthy, excluded)
|
||||
* - exited:excluded → Exited (excluded)
|
||||
* - Proxy:running → Proxy:running (preserved as-is for headline formatting)
|
||||
* - running → Running
|
||||
*
|
||||
* @param string $status The status string to format
|
||||
* @return string The formatted status string
|
||||
*/
|
||||
function formatContainerStatus(string $status): string
|
||||
{
|
||||
// Preserve Proxy statuses as-is (they follow different format)
|
||||
if (str($status)->startsWith('Proxy')) {
|
||||
return str($status)->headline()->value();
|
||||
}
|
||||
|
||||
// Check for :excluded suffix
|
||||
$isExcluded = str($status)->endsWith(':excluded');
|
||||
$parts = explode(':', $status);
|
||||
|
||||
if ($isExcluded) {
|
||||
if (count($parts) === 3) {
|
||||
// Has health status: running:unhealthy:excluded → Running (unhealthy, excluded)
|
||||
return str($parts[0])->headline().' ('.$parts[1].', excluded)';
|
||||
} else {
|
||||
// No health status: exited:excluded → Exited (excluded)
|
||||
return str($parts[0])->headline().' (excluded)';
|
||||
}
|
||||
} elseif (count($parts) >= 2) {
|
||||
// Regular colon format: running:healthy → Running (healthy)
|
||||
return str($parts[0])->headline().' ('.$parts[1].')';
|
||||
} else {
|
||||
// Simple status: running → Running
|
||||
return str($status)->headline()->value();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user