mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 10:15:40 +00:00
feat(ui): show reicon fallback for services without a logo
This commit is contained in:
2 files changed
+11
-5
No files matched your search
@@ -121,7 +121,11 @@ class Select extends Component
|
||||
}
|
||||
}
|
||||
|
||||
if (! is_string($logo) || ! file_exists(public_path($logo))) {
|
||||
$hasLogo = is_string($logo)
|
||||
&& basename($logo) !== basename($default_logo)
|
||||
&& file_exists(public_path($logo));
|
||||
|
||||
if (! $hasLogo) {
|
||||
$logo = $default_logo;
|
||||
}
|
||||
|
||||
@@ -132,6 +136,7 @@ class Select extends Component
|
||||
'id' => $serviceKey,
|
||||
'name' => str($serviceKey)->headline(),
|
||||
'docsSlug' => str($serviceKey)->lower()->value(),
|
||||
'has_logo' => $hasLogo,
|
||||
'logo' => asset($logo),
|
||||
'logo_github_url' => file_exists($local_logo_path)
|
||||
? 'https://raw.githubusercontent.com/coollabsio/coolify/refs/heads/main/public/'.$logo
|
||||
|
||||
@@ -266,13 +266,14 @@
|
||||
<div class="flex min-w-0 items-start gap-3">
|
||||
<div
|
||||
class="flex size-11 shrink-0 items-center justify-center overflow-hidden rounded-xl border border-neutral-200 bg-neutral-50 dark:border-white/[0.08] dark:bg-white/[0.04]">
|
||||
<template x-if="service.logo">
|
||||
<template x-if="service.has_logo">
|
||||
<img class="h-full w-full object-contain p-2" :src="service.logo"
|
||||
onerror="this.onerror=null; this.src=this.getAttribute('data-fallback');"
|
||||
:data-fallback="service.logo_github_url || '/coolify-logo.svg'" />
|
||||
:data-fallback="service.logo_github_url" />
|
||||
</template>
|
||||
<template x-if="!service.logo">
|
||||
<img class="size-6 object-contain" src="/coolify-logo.svg" alt="" />
|
||||
<template x-if="!service.has_logo">
|
||||
<x-reicon name="layers"
|
||||
class="size-6 text-neutral-400 dark:text-fg-faint" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
|
||||
Reference in new issue
Block a user