An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat: remove ansi color from log
Vann7b60d76b770f
diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.phpindex 56be2fe7dd..784a43100b 100644--- a/app/Http/Controllers/Api/ApplicationsController.php+++ b/app/Http/Controllers/Api/ApplicationsController.php@@ -1438,8 +1438,6 @@ class ApplicationsController extends Controller)]public function logs_by_uuid(Request $request){- // TODO: Implement logs_by_uuid() method.-$teamId = getTeamIdFromToken();if (is_null($teamId)) {return invalidTokenResponse();@@ -1453,23 +1451,27 @@ class ApplicationsController extends Controllerreturn response()->json(['message' => 'Application not found.'], 404);}- $container = getCurrentApplicationContainerStatus($application->destination->server, $application->id)->firstOrFail();- // TODO: fix error when getting status- $status = getContainerStatus($application->destination->server, $container['name']);- // return response()->json([- // 'logs' => $status,- // ]);+ $containers = getCurrentApplicationContainerStatus($application->destination->server, $application->id);+ if ($containers->count() == 0) {+ return response()->json([+ 'message' => 'Application is not running.',+ ], 400);+ }++ $container = $containers->first();++ $status = getContainerStatus($application->destination->server, $container['Names']);if ($status !== 'running') {return response()->json(['message' => 'Application is not running.',], 400);}- $logs = getContainerLogs($application->destination->server, $container['Id']);+ $logs = getContainerLogs($application->destination->server, $container['ID']);return response()->json([- 'logs' => 'yey',+ 'logs' => $logs,]);}diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.phpindex fbad04e64d..696f6a8c45 100644--- a/bootstrap/helpers/docker.php+++ b/bootstrap/helpers/docker.php@@ -864,6 +864,8 @@ function getContainerLogs(Server $server, string $container_id, int $lines = 100], $server);}+ $output .= removeAnsiColors($output);+return $output;}