First realish round of updates by Gemini...
This commit is contained in:
23
src/lib/ae_core/core__account.ts
Normal file
23
src/lib/ae_core/core__account.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
export interface Account {
|
||||
id: string;
|
||||
// id_random: string;
|
||||
account_id: string;
|
||||
account_id_random: string;
|
||||
|
||||
code?: string;
|
||||
name: string;
|
||||
short_name?: null|string;
|
||||
description?: null|string;
|
||||
|
||||
enable: null|boolean;
|
||||
enable_from?: null|Date;
|
||||
enable_to?: null|Date;
|
||||
|
||||
hide?: null|boolean;
|
||||
priority?: null|boolean
|
||||
sort?: null|number;
|
||||
group?: null|string;
|
||||
notes?: null|string;
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
}
|
||||
50
src/lib/ae_core/core__site.ts
Normal file
50
src/lib/ae_core/core__site.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
export interface Site {
|
||||
id: string;
|
||||
// id_random: string;
|
||||
site_id: string;
|
||||
site_id_random?: string;
|
||||
|
||||
code?: string;
|
||||
|
||||
account_id: string;
|
||||
account_id_random?: string;
|
||||
|
||||
name: string;
|
||||
description?: null|string;
|
||||
|
||||
restrict_access?: null|boolean;
|
||||
access_key?: null|string;
|
||||
access_code_kv_json?: null|string;
|
||||
|
||||
logo_path?: null|string;
|
||||
logo_bg_color?: null|string; // Not really used currently.
|
||||
// background_image_path?: null|string; // Legacy field
|
||||
// background_bg_color?: null|string; // Legacy field
|
||||
title?: null|string;
|
||||
|
||||
// header_html?: null|string; // Legacy field
|
||||
// header_css?: null|string; // Legacy field
|
||||
// header_image_path?: null|string; // Legacy field
|
||||
// header_image_bg_color?: null|string; // Legacy field
|
||||
// body_html?: null|string; // Legacy field
|
||||
tagline?: null|string;
|
||||
// site_header_h1?: null|string; // Legacy field
|
||||
// site_header_h2?: null|string; // Legacy field
|
||||
style_href?: null|string; // Legacy field
|
||||
// script_src?: null|string; // Legacy field
|
||||
google_tracking_id?: null|string;
|
||||
|
||||
cfg_json?: null|string; // key value config json
|
||||
|
||||
enable: null|boolean;
|
||||
enable_from?: null|Date;
|
||||
enable_to?: null|Date;
|
||||
|
||||
hide?: null|boolean;
|
||||
priority?: null|boolean
|
||||
sort?: null|number;
|
||||
group?: null|string;
|
||||
notes?: null|string;
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
}
|
||||
20
src/lib/ae_core/core__site_domain.ts
Normal file
20
src/lib/ae_core/core__site_domain.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export interface Site_Domain {
|
||||
id: string;
|
||||
// id_random: string;
|
||||
site_id: string;
|
||||
site_id_random?: string;
|
||||
|
||||
fqdn: string;
|
||||
access_key?: null|string;
|
||||
required_referrer?: null|string;
|
||||
valid_for?: null|number; // In hours
|
||||
|
||||
enable: null|boolean;
|
||||
hide?: null|boolean;
|
||||
priority?: null|boolean
|
||||
sort?: null|number;
|
||||
group?: null|string;
|
||||
notes?: null|string;
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
}
|
||||
@@ -28,6 +28,29 @@ let lq__event_obj_li = $derived(liveQuery(async () => {
|
||||
return results;
|
||||
}));
|
||||
|
||||
let items_per_page = 10;
|
||||
let current_page = $state(1);
|
||||
|
||||
let paginated_events = $derived(() => {
|
||||
const start = (current_page - 1) * items_per_page;
|
||||
const end = start + items_per_page;
|
||||
return $lq__event_obj_li?.slice(start, end) ?? [];
|
||||
});
|
||||
|
||||
let total_events = $derived($lq__event_obj_li?.length ?? 0);
|
||||
let total_pages = $derived(Math.ceil(total_events / items_per_page));
|
||||
|
||||
function next_page() {
|
||||
if (current_page < total_pages) {
|
||||
current_page++;
|
||||
}
|
||||
}
|
||||
|
||||
function prev_page() {
|
||||
if (current_page > 1) {
|
||||
current_page--;
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
// console.log('Events - Presentation Management: +page.svelte');
|
||||
@@ -85,7 +108,7 @@ onMount(() => {
|
||||
<ul
|
||||
class="space-y-2"
|
||||
>
|
||||
{#each $lq__event_obj_li as event_obj}
|
||||
{#each paginated_events as event_obj}
|
||||
<li
|
||||
class:dim={event_obj?.hide}
|
||||
>
|
||||
@@ -128,6 +151,11 @@ onMount(() => {
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
<div class="flex justify-center items-center space-x-4 mt-4">
|
||||
<button class="btn btn-sm" onclick={prev_page} disabled={current_page === 1}>Previous</button>
|
||||
<span>Page {current_page} of {total_pages}</span>
|
||||
<button class="btn btn-sm" onclick={next_page} disabled={current_page === total_pages}>Next</button>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="flex flex-row items-center justify-center">
|
||||
<span class="fas fa-exclamation-triangle text-red-500 mx-1"></span>
|
||||
@@ -157,3 +185,4 @@ onMount(() => {
|
||||
|
||||
<style lang="postcss">
|
||||
</style>
|
||||
|
||||
|
||||
@@ -145,10 +145,20 @@ function add_activity_log(
|
||||
>
|
||||
</Help_tech>
|
||||
|
||||
{#if $lq__archive_obj_li && $lq__archive_obj_li?.length}
|
||||
<Comp__archive_obj_li
|
||||
lq__archive_obj_li={lq__archive_obj_li}
|
||||
/>
|
||||
{:else}
|
||||
<p>No archives available to show.</p>
|
||||
{/if}
|
||||
{#await lq__archive_obj_li}
|
||||
<div class="flex flex-col items-center justify-center p-8">
|
||||
<span class="fas fa-spinner fa-spin text-4xl text-primary-500 mb-4"></span>
|
||||
<span class="text-lg text-gray-600 dark:text-gray-400">Loading archives...</span>
|
||||
</div>
|
||||
{:then}
|
||||
{#if $lq__archive_obj_li && $lq__archive_obj_li?.length}
|
||||
<Comp__archive_obj_li
|
||||
lq__archive_obj_li={lq__archive_obj_li}
|
||||
/>
|
||||
{:else}
|
||||
<div class="flex flex-col items-center justify-center p-4 text-center">
|
||||
<p class="text-lg text-gray-600 dark:text-gray-400 mb-4">No archives found.</p>
|
||||
<p class="text-md text-gray-500 dark:text-gray-300">Archives will appear here once created.</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/await}
|
||||
|
||||
@@ -253,9 +253,9 @@ async function create_journal() {
|
||||
{#await ae_acct.slct.journal_obj_li}
|
||||
|
||||
|
||||
<div class="flex flex-row items-center justify-center">
|
||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
||||
<span>Loading data...</span>
|
||||
<div class="flex flex-col items-center justify-center p-8">
|
||||
<span class="fas fa-spinner fa-spin text-4xl text-primary-500 mb-4"></span>
|
||||
<span class="text-lg text-gray-600 dark:text-gray-400">Loading journals...</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -272,7 +272,10 @@ async function create_journal() {
|
||||
lq__journal_obj_li={lq__journal_obj_li}
|
||||
/>
|
||||
{:else}
|
||||
<p>No journals available to show.</p>
|
||||
<div class="flex flex-col items-center justify-center p-4 text-center">
|
||||
<p class="text-lg text-gray-600 dark:text-gray-400 mb-4">No journals found.</p>
|
||||
<p class="text-md text-gray-500 dark:text-gray-300">Click the "New Journal" button above to create your first journal.</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user