fix: if service img not found, use github as a source
This commit is contained in:
parent
b0f3f5378f
commit
a77ed93695
2 changed files with 9 additions and 3 deletions
|
|
@ -91,9 +91,12 @@ public function loadServices()
|
|||
{
|
||||
$services = get_service_templates(true);
|
||||
$services = collect($services)->map(function ($service, $key) {
|
||||
$logo = data_get($service, 'logo', 'svgs/coolify.png');
|
||||
|
||||
return [
|
||||
'name' => str($key)->headline(),
|
||||
'logo' => asset(data_get($service, 'logo', 'svgs/coolify.png')),
|
||||
'logo' => asset($logo),
|
||||
'logo_github_url' => 'https://raw.githubusercontent.com/coollabsio/coolify/refs/heads/main/public/'.$logo,
|
||||
] + (array) $service;
|
||||
})->all();
|
||||
$gitBasedApplications = [
|
||||
|
|
|
|||
|
|
@ -101,7 +101,10 @@ class="grid justify-start grid-cols-1 gap-4 text-left xl:grid-cols-2">
|
|||
<x-slot:logo>
|
||||
<template x-if="service.logo">
|
||||
<img class="w-[4.5rem] aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
|
||||
:src='service.logo'>
|
||||
:src='service.logo'
|
||||
x-on:error.window="$event.target.src = service.logo_github_url"
|
||||
onerror="this.onerror=null; this.src=this.getAttribute('data-fallback');"
|
||||
:data-fallback='service.logo_github_url' />
|
||||
</template>
|
||||
</x-slot:logo>
|
||||
<x-slot:documentation>
|
||||
|
|
@ -205,7 +208,7 @@ function searchResources() {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
@if ($current_step === 'servers')
|
||||
<h2>Select a server</h2>
|
||||
|
|
|
|||
Loading…
Reference in a new issue