From 6f2a33f859ea6ce73e284c8b06c7b699a41ff8f5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 17 Dec 2025 20:54:22 +0100 Subject: [PATCH] feat: Add copy logs button to deployment and runtime logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add copy-to-clipboard functionality for both deployment logs and runtime container logs with success notification. Fixed event dispatch to use Livewire.dispatch() for proper toast notification handling. Reorganized copy and download buttons to appear consecutively in runtime logs toolbar. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- .../Project/Application/Deployment/Show.php | 13 ++++++++ .../application/deployment/show.blade.php | 15 ++++++++++ .../project/shared/get-logs.blade.php | 30 +++++++++---------- templates/service-templates-latest.json | 24 +++++++++++++-- templates/service-templates.json | 24 +++++++++++++-- 5 files changed, 85 insertions(+), 21 deletions(-) diff --git a/app/Livewire/Project/Application/Deployment/Show.php b/app/Livewire/Project/Application/Deployment/Show.php index 8c0ee1a3f..b0f5df0c8 100644 --- a/app/Livewire/Project/Application/Deployment/Show.php +++ b/app/Livewire/Project/Application/Deployment/Show.php @@ -117,6 +117,19 @@ public function getLogLinesProperty() }); } + public function copyLogs(): string + { + $logs = decode_remote_command_output($this->application_deployment_queue) + ->map(function ($line) { + return $line['timestamp'].' '. + (isset($line['command']) && $line['command'] ? '[CMD]: ' : ''). + trim($line['line']); + }) + ->join("\n"); + + return sanitizeLogsForExport($logs); + } + public function render() { return view('livewire.project.application.deployment.show'); diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php index 5f37786f5..7379dbbe8 100644 --- a/resources/views/livewire/project/application/deployment/show.blade.php +++ b/resources/views/livewire/project/application/deployment/show.blade.php @@ -222,6 +222,21 @@ class="absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-6 + - +