diff --git a/src/lib/server/pcd/queries/delayProfiles/list.ts b/src/lib/server/pcd/queries/delayProfiles/list.ts index f466cdb..f73b536 100644 --- a/src/lib/server/pcd/queries/delayProfiles/list.ts +++ b/src/lib/server/pcd/queries/delayProfiles/list.ts @@ -23,7 +23,9 @@ export async function list(cache: PCDCache): Promise { 'torrent_delay', 'bypass_if_highest_quality', 'bypass_if_above_custom_format_score', - 'minimum_custom_format_score' + 'minimum_custom_format_score', + 'created_at', + 'updated_at' ]) .orderBy('name') .execute(); @@ -70,6 +72,8 @@ export async function list(cache: PCDCache): Promise { bypass_if_highest_quality: profile.bypass_if_highest_quality === 1, bypass_if_above_custom_format_score: profile.bypass_if_above_custom_format_score === 1, minimum_custom_format_score: profile.minimum_custom_format_score, - tags: tagsMap.get(profile.id) || [] + tags: tagsMap.get(profile.id) || [], + created_at: profile.created_at, + updated_at: profile.updated_at })); } diff --git a/src/lib/server/pcd/queries/delayProfiles/types.ts b/src/lib/server/pcd/queries/delayProfiles/types.ts index a94a10e..9e4ada1 100644 --- a/src/lib/server/pcd/queries/delayProfiles/types.ts +++ b/src/lib/server/pcd/queries/delayProfiles/types.ts @@ -18,4 +18,6 @@ export interface DelayProfileTableRow { bypass_if_above_custom_format_score: boolean; minimum_custom_format_score: number | null; tags: Tag[]; + created_at: string; + updated_at: string; } diff --git a/src/lib/server/pcd/queries/regularExpressions/list.ts b/src/lib/server/pcd/queries/regularExpressions/list.ts index 156e0b2..e5a1868 100644 --- a/src/lib/server/pcd/queries/regularExpressions/list.ts +++ b/src/lib/server/pcd/queries/regularExpressions/list.ts @@ -15,7 +15,7 @@ export async function list(cache: PCDCache): Promise ({ html: `${formatProtocol(row.preferred_protocol)}` }) @@ -113,6 +125,28 @@ ` }; } + }, + { + key: 'updated_at', + header: 'Updated', + headerIcon: Calendar, + align: 'left', + width: 'w-44', + sortable: true, + cell: (row: DelayProfileTableRow) => ({ + html: `${formatDate(row.updated_at)}` + }) + }, + { + key: 'created_at', + header: 'Created', + headerIcon: Calendar, + align: 'left', + width: 'w-44', + sortable: true, + cell: (row: DelayProfileTableRow) => ({ + html: `${formatDate(row.created_at)}` + }) } ]; diff --git a/src/routes/regular-expressions/[databaseId]/views/TableView.svelte b/src/routes/regular-expressions/[databaseId]/views/TableView.svelte index 0b7699b..823c283 100644 --- a/src/routes/regular-expressions/[databaseId]/views/TableView.svelte +++ b/src/routes/regular-expressions/[databaseId]/views/TableView.svelte @@ -2,13 +2,25 @@ import Table from '$ui/table/Table.svelte'; import type { Column } from '$ui/table/types'; import type { RegularExpressionTableRow } from '$pcd/queries/regularExpressions'; - import { Tag, Code, FileText, Link } from 'lucide-svelte'; + import { Tag, Code, FileText, Link, Calendar } from 'lucide-svelte'; import { marked } from 'marked'; import { goto } from '$app/navigation'; import { page } from '$app/stores'; export let expressions: RegularExpressionTableRow[]; + function formatDate(dateString: string): string { + // SQLite stores timestamps without timezone info, treat as UTC + const date = new Date(dateString + 'Z'); + return date.toLocaleString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric', + hour: '2-digit', + minute: '2-digit' + }); + } + function handleRowClick(row: RegularExpressionTableRow) { const databaseId = $page.params.databaseId; goto(`/regular-expressions/${databaseId}/${row.id}`); @@ -92,6 +104,28 @@ ? `${escapeHtml(row.regex101_id)}` : `-` }) + }, + { + key: 'updated_at', + header: 'Updated', + headerIcon: Calendar, + align: 'left', + width: 'w-44', + sortable: true, + cell: (row: RegularExpressionTableRow) => ({ + html: `${formatDate(row.updated_at)}` + }) + }, + { + key: 'created_at', + header: 'Created', + headerIcon: Calendar, + align: 'left', + width: 'w-44', + sortable: true, + cell: (row: RegularExpressionTableRow) => ({ + html: `${formatDate(row.created_at)}` + }) } ];