mirror of
https://github.com/cupcakearmy/coolify.git
synced 2024-10-22 16:14:22 +02:00
Merge pull request #891 from TetrisIQ/moveIconsInComunityRepo
Move icons in comunity repo
This commit is contained in:
commit
d122af9fed
@ -1,25 +1,14 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let type: string;
|
export let type: string;
|
||||||
export let isAbsolute = false;
|
export let isAbsolute = false;
|
||||||
|
let githubRawIconUrl =
|
||||||
|
'https://raw.githubusercontent.com/coollabsio/coolify-community-templates/main/services/icons';
|
||||||
|
|
||||||
let fallback = '/icons/default.png';
|
let fallback = '/icons/default.png';
|
||||||
const handleError = (ev: { target: { src: string } }) => (ev.target.src = fallback);
|
|
||||||
let extension = 'png';
|
const handleError = (ev: { target: { src: string } }) => {
|
||||||
let svgs = [
|
ev.target.src = fallback;
|
||||||
'mattermost',
|
};
|
||||||
'directus',
|
|
||||||
'pocketbase',
|
|
||||||
'gitea',
|
|
||||||
'languagetool',
|
|
||||||
'meilisearch',
|
|
||||||
'n8n',
|
|
||||||
'glitchtip',
|
|
||||||
'searxng',
|
|
||||||
'umami',
|
|
||||||
'uptimekuma',
|
|
||||||
'vaultwarden',
|
|
||||||
'weblate',
|
|
||||||
'wordpress'
|
|
||||||
];
|
|
||||||
|
|
||||||
const name: any =
|
const name: any =
|
||||||
type &&
|
type &&
|
||||||
@ -29,32 +18,15 @@
|
|||||||
.split('-')[0]
|
.split('-')[0]
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|
||||||
if (svgs.includes(name)) {
|
|
||||||
extension = 'svg';
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateClass() {
|
function generateClass() {
|
||||||
switch (name) {
|
return isAbsolute ? 'w-10 h-10 absolute -m-4 -mt-9 left-0' : 'w-10 h-10';
|
||||||
case 'n8n':
|
|
||||||
if (isAbsolute) {
|
|
||||||
return 'w-12 h-12 absolute -m-9 -mt-12';
|
|
||||||
}
|
|
||||||
return 'w-12 h-12 -mt-3';
|
|
||||||
case 'weblate':
|
|
||||||
if (isAbsolute) {
|
|
||||||
return 'w-12 h-12 absolute -m-9 -mt-12';
|
|
||||||
}
|
|
||||||
return 'w-12 h-12 -mt-3';
|
|
||||||
default:
|
|
||||||
return isAbsolute ? 'w-10 h-10 absolute -m-4 -mt-9 left-0' : 'w-10 h-10';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if name}
|
{#if name}
|
||||||
<img
|
<img
|
||||||
class={generateClass()}
|
class={generateClass()}
|
||||||
src={`/icons/${name}.${extension}`}
|
src={`${githubRawIconUrl}/${name}.png`}
|
||||||
on:error={handleError}
|
on:error={handleError}
|
||||||
alt={`Icon of ${name}`}
|
alt={`Icon of ${name}`}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user