mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 12:26:39 -06:00
chore: resolve eslint/svelte-check lints/warnings
This commit is contained in:
@@ -29,7 +29,7 @@ export async function apiFetch<T>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Remove custom fetch property from options
|
// Remove custom fetch property from options
|
||||||
delete (fetchOptions as any).fetch;
|
delete (fetchOptions as Record<string, unknown>).fetch;
|
||||||
|
|
||||||
if (isUnixSocket) {
|
if (isUnixSocket) {
|
||||||
fetchOptions.unix = upstreamUrl;
|
fetchOptions.unix = upstreamUrl;
|
||||||
|
|||||||
+2
-5
@@ -118,12 +118,9 @@ export async function deleteAdminTag(id: string): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Admin Events API (currently mocked - no backend implementation yet)
|
// Admin Events API (currently mocked - no backend implementation yet)
|
||||||
export async function getAdminEvents(filters?: {
|
export async function getAdminEvents(): Promise<AdminEvent[]> {
|
||||||
level?: string;
|
|
||||||
target?: string;
|
|
||||||
limit?: number;
|
|
||||||
}): Promise<AdminEvent[]> {
|
|
||||||
// TODO: Implement when events table is added to backend
|
// TODO: Implement when events table is added to backend
|
||||||
|
// filters parameter will be added when backend implementation is complete
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,11 @@
|
|||||||
|
|
||||||
let { project, class: className }: Props = $props();
|
let { project, class: className }: Props = $props();
|
||||||
|
|
||||||
// Prefer demo URL, fallback to GitHub repo
|
// Prefer demo URL, fallback to GitHub repo (use $derived to react to project changes)
|
||||||
const projectUrl =
|
const projectUrl = $derived(
|
||||||
project.demoUrl ||
|
project.demoUrl ||
|
||||||
(project.githubRepo ? `https://github.com/${project.githubRepo}` : null);
|
(project.githubRepo ? `https://github.com/${project.githubRepo}` : null),
|
||||||
|
);
|
||||||
|
|
||||||
function formatDate(dateString: string): string {
|
function formatDate(dateString: string): string {
|
||||||
const date = new Date(dateString);
|
const date = new Date(dateString);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
<div class={cn("space-y-3", className)}>
|
<div class={cn("space-y-3", className)}>
|
||||||
{#if label}
|
{#if label}
|
||||||
<label class="block text-sm font-medium text-admin-text">{label}</label>
|
<div class="block text-sm font-medium text-admin-text">{label}</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- Preset Palette -->
|
<!-- Preset Palette -->
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
style="background-color: #{preset.value}"
|
style="background-color: #{preset.value}"
|
||||||
title={preset.name}
|
title={preset.name}
|
||||||
onclick={() => selectPreset(preset.value)}
|
onclick={() => selectPreset(preset.value)}
|
||||||
/>
|
></button>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
<!-- Clear button -->
|
<!-- Clear button -->
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
class="size-10 shrink-0 rounded-md border-2 border-admin-border"
|
class="size-10 shrink-0 rounded-md border-2 border-admin-border"
|
||||||
style="background-color: #{selectedColor}"
|
style="background-color: #{selectedColor}"
|
||||||
title="#{selectedColor}"
|
title="#{selectedColor}"
|
||||||
/>
|
></div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+21
-10
@@ -3,16 +3,24 @@
|
|||||||
import ProjectCard from "$lib/components/ProjectCard.svelte";
|
import ProjectCard from "$lib/components/ProjectCard.svelte";
|
||||||
import PgpKeyModal from "$lib/components/PgpKeyModal.svelte";
|
import PgpKeyModal from "$lib/components/PgpKeyModal.svelte";
|
||||||
import type { PageData } from "./$types";
|
import type { PageData } from "./$types";
|
||||||
import type { SiteSettings } from "$lib/admin-types";
|
|
||||||
import MaterialSymbolsVpnKey from "~icons/material-symbols/vpn-key";
|
import MaterialSymbolsVpnKey from "~icons/material-symbols/vpn-key";
|
||||||
|
|
||||||
let { data }: { data: PageData } = $props();
|
interface ExtendedPageData extends PageData {
|
||||||
const projects = data.projects;
|
socialLinksWithIcons: Array<{
|
||||||
// Type assertion needed until types are regenerated
|
id: string;
|
||||||
const socialLinksWithIcons = (data as any).socialLinksWithIcons;
|
platform: string;
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
icon: string;
|
||||||
|
iconSvg: string;
|
||||||
|
visible: boolean;
|
||||||
|
displayOrder: number;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
// Get settings from parent layout
|
let { data }: { data: ExtendedPageData } = $props();
|
||||||
const settings = (data as any).settings as SiteSettings;
|
const projects = $derived(data.projects);
|
||||||
|
const socialLinksWithIcons = $derived(data.socialLinksWithIcons);
|
||||||
|
|
||||||
// Filter visible social links
|
// Filter visible social links
|
||||||
const visibleSocialLinks = $derived(
|
const visibleSocialLinks = $derived(
|
||||||
@@ -36,18 +44,18 @@
|
|||||||
<div class="flex flex-col pb-4">
|
<div class="flex flex-col pb-4">
|
||||||
<span
|
<span
|
||||||
class="text-2xl font-bold text-zinc-900 dark:text-white sm:text-3xl"
|
class="text-2xl font-bold text-zinc-900 dark:text-white sm:text-3xl"
|
||||||
>{settings.identity.displayName},</span
|
>{data.settings.identity.displayName},</span
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="text-xl font-normal text-zinc-600 dark:text-zinc-400 sm:text-2xl"
|
class="text-xl font-normal text-zinc-600 dark:text-zinc-400 sm:text-2xl"
|
||||||
>
|
>
|
||||||
{settings.identity.occupation}
|
{data.settings.identity.occupation}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="py-4 text-zinc-700 dark:text-zinc-200">
|
<div class="py-4 text-zinc-700 dark:text-zinc-200">
|
||||||
<p class="sm:text-[0.95em] whitespace-pre-line">
|
<p class="sm:text-[0.95em] whitespace-pre-line">
|
||||||
{settings.identity.bio}
|
{data.settings.identity.bio}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -62,6 +70,7 @@
|
|||||||
class="flex items-center gap-x-1.5 px-1.5 py-1 rounded-sm bg-zinc-100 dark:bg-zinc-900 shadow-sm hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors"
|
class="flex items-center gap-x-1.5 px-1.5 py-1 rounded-sm bg-zinc-100 dark:bg-zinc-900 shadow-sm hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors"
|
||||||
>
|
>
|
||||||
<span class="size-4 text-zinc-600 dark:text-zinc-300">
|
<span class="size-4 text-zinc-600 dark:text-zinc-300">
|
||||||
|
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||||
{@html link.iconSvg}
|
{@html link.iconSvg}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@@ -77,6 +86,7 @@
|
|||||||
onclick={() => handleDiscordClick(link.value)}
|
onclick={() => handleDiscordClick(link.value)}
|
||||||
>
|
>
|
||||||
<span class="size-4 text-zinc-600 dark:text-zinc-300">
|
<span class="size-4 text-zinc-600 dark:text-zinc-300">
|
||||||
|
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||||
{@html link.iconSvg}
|
{@html link.iconSvg}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
@@ -91,6 +101,7 @@
|
|||||||
class="flex items-center gap-x-1.5 px-1.5 py-1 rounded-sm bg-zinc-100 dark:bg-zinc-900 shadow-sm hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors"
|
class="flex items-center gap-x-1.5 px-1.5 py-1 rounded-sm bg-zinc-100 dark:bg-zinc-900 shadow-sm hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors"
|
||||||
>
|
>
|
||||||
<span class="size-4.5 text-zinc-600 dark:text-zinc-300">
|
<span class="size-4.5 text-zinc-600 dark:text-zinc-300">
|
||||||
|
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||||
{@html link.iconSvg}
|
{@html link.iconSvg}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
async function loadDashboard() {
|
async function loadDashboard() {
|
||||||
try {
|
try {
|
||||||
const eventsData = await getAdminEvents({ limit: 10 });
|
const eventsData = await getAdminEvents();
|
||||||
recentEvents = eventsData;
|
recentEvents = eventsData;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to load dashboard:", error);
|
console.error("Failed to load dashboard:", error);
|
||||||
|
|||||||
@@ -19,11 +19,8 @@
|
|||||||
async function loadEvents() {
|
async function loadEvents() {
|
||||||
loading = true;
|
loading = true;
|
||||||
try {
|
try {
|
||||||
const filters: { level?: string; target?: string } = {};
|
// TODO: Pass filters when backend implementation is complete
|
||||||
if (filterLevel) filters.level = filterLevel;
|
events = await getAdminEvents();
|
||||||
if (filterTarget) filters.target = filterTarget;
|
|
||||||
|
|
||||||
events = await getAdminEvents(filters);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to load events:", error);
|
console.error("Failed to load events:", error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -283,7 +283,7 @@
|
|||||||
<div
|
<div
|
||||||
class="size-6 rounded border border-admin-border"
|
class="size-6 rounded border border-admin-border"
|
||||||
style="background-color: #{editColor}"
|
style="background-color: #{editColor}"
|
||||||
/>
|
></div>
|
||||||
<span class="text-xs text-admin-text-muted"
|
<span class="text-xs text-admin-text-muted"
|
||||||
>#{editColor}</span
|
>#{editColor}</span
|
||||||
>
|
>
|
||||||
@@ -329,7 +329,7 @@
|
|||||||
<div
|
<div
|
||||||
class="size-6 rounded border border-admin-border"
|
class="size-6 rounded border border-admin-border"
|
||||||
style="background-color: #{tag.color}"
|
style="background-color: #{tag.color}"
|
||||||
/>
|
></div>
|
||||||
<span class="text-xs text-admin-text-muted"
|
<span class="text-xs text-admin-text-muted"
|
||||||
>#{tag.color}</span
|
>#{tag.color}</span
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { RequestHandler } from "./$types";
|
|||||||
import type { OGImageSpec } from "$lib/og-types";
|
import type { OGImageSpec } from "$lib/og-types";
|
||||||
import { loadOGFonts } from "$lib/og-fonts";
|
import { loadOGFonts } from "$lib/og-fonts";
|
||||||
import { apiFetch } from "$lib/api.server";
|
import { apiFetch } from "$lib/api.server";
|
||||||
import type { Project } from "../../../projects/+page.server";
|
import type { AdminProject } from "$lib/admin-types";
|
||||||
import { getLogger } from "@logtape/logtape";
|
import { getLogger } from "@logtape/logtape";
|
||||||
import satori from "satori";
|
import satori from "satori";
|
||||||
import { Resvg } from "@resvg/resvg-js";
|
import { Resvg } from "@resvg/resvg-js";
|
||||||
@@ -154,7 +154,7 @@ async function getTemplateData(spec: OGImageSpec): Promise<{
|
|||||||
};
|
};
|
||||||
case "project":
|
case "project":
|
||||||
try {
|
try {
|
||||||
const projects = await apiFetch<Project[]>("/api/projects");
|
const projects = await apiFetch<AdminProject[]>("/api/projects");
|
||||||
const project = projects.find((p) => p.id === spec.id);
|
const project = projects.find((p) => p.id === spec.id);
|
||||||
if (project) {
|
if (project) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user