feat: Add copy logs button to deployment and runtime logs

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 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-12-17 20:54:22 +01:00
parent 1b3be5bef6
commit 6f2a33f859
5 changed files with 85 additions and 21 deletions

View File

@@ -117,6 +117,19 @@ class Show extends Component
});
}
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');