mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 02:16:43 +00:00
feat(deployments): add log copying functionality to clipboard in dev
This commit is contained in:
1 parent
aadde3a83e
commit
d63802e03d
2 files changed
+25
No files matched your search
@@ -50,6 +50,28 @@ class DeploymentNavbar extends Component
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function copyLogsToClipboard(): string
|
||||||
|
{
|
||||||
|
$logs = json_decode($this->application_deployment_queue->logs, associative: true, flags: JSON_THROW_ON_ERROR);
|
||||||
|
|
||||||
|
if (! $logs) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$markdown = "# Deployment Logs\n\n";
|
||||||
|
$markdown .= "```\n";
|
||||||
|
|
||||||
|
foreach ($logs as $log) {
|
||||||
|
if (isset($log['output'])) {
|
||||||
|
$markdown .= $log['output']."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$markdown .= "```\n";
|
||||||
|
|
||||||
|
return $markdown;
|
||||||
|
}
|
||||||
|
|
||||||
public function cancel()
|
public function cancel()
|
||||||
{
|
{
|
||||||
$deployment_uuid = $this->application_deployment_queue->deployment_uuid;
|
$deployment_uuid = $this->application_deployment_queue->deployment_uuid;
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
@else
|
@else
|
||||||
<x-forms.button wire:click.prevent="show_debug">Show Debug Logs</x-forms.button>
|
<x-forms.button wire:click.prevent="show_debug">Show Debug Logs</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
|
@if (isDev())
|
||||||
|
<x-forms.button x-on:click="$wire.copyLogsToClipboard().then(text => navigator.clipboard.writeText(text))">Copy Logs</x-forms.button>
|
||||||
|
@endif
|
||||||
@if (data_get($application_deployment_queue, 'status') === 'queued')
|
@if (data_get($application_deployment_queue, 'status') === 'queued')
|
||||||
<x-forms.button wire:click.prevent="force_start">Force Start</x-forms.button>
|
<x-forms.button wire:click.prevent="force_start">Force Start</x-forms.button>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Reference in new issue
Block a user