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