This commit is contained in:
2023-09-14 10:18:54 +02:00
parent e4d1b83108
commit b2f2c2af44
5 changed files with 36 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import type { ServiceConfig } from '$lib/config';
import type { BrandConfig, ServiceConfig } from '$lib/config';
import { getServiceComponent } from '$lib/services/services';
import Brand from './Brand.svelte';
@@ -8,25 +8,32 @@
const component = getServiceComponent(service.type || '');
console.log(service);
function brand(): BrandConfig {
if (data?.logo != undefined && service.logo == undefined && service.icon == undefined) {
return { logo: data.logo, asmask: service.asmask || false };
}
return service;
}
</script>
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-left">
<figure class="image">
<Brand brand={service} />
</figure>
</div>
<div class="media-content">
<p class="title is-4">{service.title}</p>
{#if component != undefined}
<p class="subtitle is-6"><svelte:component this={component} {data} /></p>
{:else}
<p class="subtitle is-6">{service.subtitle}</p>
{/if}
<a href={service.url} target={service.target || ''}>
<div class="card">
<div class="card-content">
<div class="media">
<div class="media-left">
<figure class="image">
<Brand brand={brand()} />
</figure>
</div>
<div class="media-content">
<p class="title is-4">{service.title}</p>
{#if component != undefined}
<p class="subtitle is-6"><svelte:component this={component} {data} /></p>
{:else}
<p class="subtitle is-6">{service.subtitle}</p>
{/if}
</div>
</div>
</div>
</div>
</div>
</a>

View File

@@ -1,7 +1,9 @@
import { type ServiceComponentPath, type ServiceHandler } from '../service';
export const handle: ServiceHandler = () => {
return { piholedata: 'coucou' };
const res = { logo: 'https://cdn.rawgit.com/pi-hole/graphics/master/Vortex/Vortex.svg' };
return res;
};
export const path: ServiceComponentPath = 'pihole/PiHoleContent.svelte';