WIP lost
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user