More work on making the loading process better
This commit is contained in:
@@ -26,12 +26,14 @@ const modalRegistry: Record<string, ModalComponent> = {
|
||||
// ...
|
||||
};
|
||||
import {
|
||||
ArrowBigRight,
|
||||
CircleX,
|
||||
Eye, EyeOff,
|
||||
Key,
|
||||
LogIn, LogOut, LockKeyhole,
|
||||
Mail, MailCheck,
|
||||
Menu,
|
||||
RefreshCw, RefreshCcwDot,
|
||||
ShieldEllipsis, ShieldMinus, ShieldPlus, ShieldUser,
|
||||
User, UserCheck
|
||||
} from '@lucide/svelte';
|
||||
@@ -694,9 +696,10 @@ $effect(() => {
|
||||
<!-- regionFooter="flex justify-end space-x-2" -->
|
||||
|
||||
{#if (browser && flag_new_ver)}
|
||||
<div class="flex flex-col items-center justify-center h-full max-w-lg mx-auto space-y-4">
|
||||
<h1 class="text-4xl text-center font-bold text-red-600 dark:text-red-400">New Version Available</h1>
|
||||
<div class="flex flex-col items-center justify-center max-w-lg mx-auto space-y-6 border border-red-500 rounded-lg p-4 bg-green-50 dark:bg-green-900 m-8">
|
||||
<h1 class="text-4xl text-center font-bold text-green-600 dark:text-green-400">New Version Available</h1>
|
||||
<p class="text-lg text-center text-gray-800 dark:text-gray-200">A new version of the site is available. Please use the Clear Cache and Reload button below to update.</p>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
@@ -712,11 +715,14 @@ $effect(() => {
|
||||
|
||||
window.location.reload();
|
||||
}}
|
||||
class="btn btn-lg m-1 variant-filled-warning hover:variant-filled-success text-error-1000 hover:text-error-800 transition-all text-wrap"
|
||||
class="btn btn-lg m-1 variant-ghost-error hover:variant-filled-success text-error-1000 hover:text-error-800 transition-all text-wrap"
|
||||
title="Reload and clear the page cache to update"
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
<!-- <span class="fas fa-sync mx-1"></span> -->
|
||||
<RefreshCcwDot class="mx-1" />
|
||||
<span>
|
||||
Clear Cache and<br/> Reload to Update
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<!-- This is mainly for IDAA using iframes in the Novi site. -->
|
||||
@@ -728,21 +734,28 @@ $effect(() => {
|
||||
<p>This sometimes happens with new versions of the app or when in an iframe.</p>
|
||||
</div>
|
||||
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Æther:</span>
|
||||
<span class=""> {$ae_loc?.ver} <ArrowBigRight class="inline-block" /> {$ae_sess?.ver}</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
window.location.reload();
|
||||
}}
|
||||
class="btn btn-sm"
|
||||
class="btn btn-sm m-1 variant-ghost-surface hover:variant-ghost-warning hover:variant-outline-warning text-warning-800 hover:text-warning-900 transition-all"
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
<!-- <span class="fas fa-sync mx-1"></span> -->
|
||||
<RefreshCw class="mx-1" />
|
||||
Reload
|
||||
</button>
|
||||
</div>
|
||||
{:else if browser && $ae_loc?.cache_expired}
|
||||
<div class="flex flex-col items-center justify-center h-full max-w-lg mx-auto space-y-4">
|
||||
<h1 class="text-4xl text-center font-bold text-red-600 dark:text-red-400">Expired Cache</h1>
|
||||
<div class="flex flex-col items-center justify-center max-w-lg mx-auto space-y-6 border border-red-500 rounded-lg p-4 bg-orange-50 dark:bg-orange-900 m-8">
|
||||
<h1 class="text-4xl text-center font-bold text-red-500 dark:text-red-400">Expired Cache</h1>
|
||||
<p class="text-lg text-center text-gray-800 dark:text-gray-200">The cache for this site has expired. Please reload the page.</p>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
@@ -756,11 +769,14 @@ $effect(() => {
|
||||
|
||||
window.location.reload();
|
||||
}}
|
||||
class="btn btn-lg m-1 variant-filled-warning hover:variant-filled-success text-error-1000 hover:text-error-800 transition-all text-wrap"
|
||||
class="btn btn-lg m-1 variant-ghost-warning hover:variant-filled-success text-error-1000 hover:text-error-800 transition-all text-wrap"
|
||||
title="Reload and clear the page cache"
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
<!-- <span class="fas fa-sync mx-1"></span> -->
|
||||
<RefreshCcwDot class="mx-1" />
|
||||
<span>
|
||||
Clear Cache and Reload
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<!-- This is mainly for IDAA using iframes in the Novi site. -->
|
||||
@@ -772,14 +788,35 @@ $effect(() => {
|
||||
<p>This sometimes happens with new versions of the app or when in an iframe.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Expired:</span>
|
||||
<span class=""> {Math.floor((Date.now() - $ae_loc.last_cache_refresh) / 60000)} minutes ago</span>
|
||||
</div>
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Last Refresh:</span>
|
||||
<span class=""> {new Date($ae_loc.last_cache_refresh).toLocaleString()}</span>
|
||||
</div>
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Access Level:</span>
|
||||
<span class=""> {$ae_loc.access_level ?? '-- not set --'}</span>
|
||||
</div>
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Username:</span>
|
||||
<span class=""> {$ae_loc.user?.username ?? '-- not set --'}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
window.location.reload();
|
||||
}}
|
||||
class="btn btn-sm"
|
||||
class="btn btn-sm m-1 variant-ghost-surface hover:variant-ghost-warning hover:variant-outline-warning text-warning-800 hover:text-warning-900 transition-all"
|
||||
title="Reload page to clear some caches and check for updates"
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
<!-- <span class="fas fa-sync mx-1"></span> -->
|
||||
<RefreshCw class="mx-1" />
|
||||
Reload
|
||||
</button>
|
||||
</div>
|
||||
@@ -789,11 +826,26 @@ $effect(() => {
|
||||
<!-- !$ae_loc?.allow_access -->
|
||||
<div
|
||||
data-sveltekit-preload-data="false"
|
||||
class="flex flex-col items-center justify-center h-full max-w-lg mx-auto space-y-4"
|
||||
class="flex flex-col items-center justify-center max-w-lg mx-auto space-y-6 border border-red-500 rounded-lg p-4 bg-red-50 dark:bg-red-900 m-8"
|
||||
>
|
||||
<h1 class="text-4xl text-center font-bold text-red-600 dark:text-red-400">Access Denied</h1>
|
||||
<h1 class="text-4xl text-center font-bold text-red-500 dark:text-red-400">Access Denied</h1>
|
||||
<p class="text-lg text-center text-gray-800 dark:text-gray-200">You do not have access to this site. You may need a <strong>passcode</strong>, <strong>sign in link</strong>, and or <strong>URL site key</strong>.</p>
|
||||
<!-- xx {JSON.stringify(data.route)} xx -->
|
||||
|
||||
<div>
|
||||
<!-- access level/type -->
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Access Level:</span>
|
||||
<span class=""> {$ae_loc.access_level ?? '-- not set --'}</span>
|
||||
</div>
|
||||
|
||||
<!-- username and email -->
|
||||
<div class="text-sm text-center text-gray-500 dark:text-gray-200">
|
||||
<span class="">Username:</span>
|
||||
<span class=""> {$ae_loc.user?.username ?? '-- not set --'}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
@@ -809,11 +861,14 @@ $effect(() => {
|
||||
|
||||
window.location.reload();
|
||||
}}
|
||||
class="btn btn-sm m-1 variant-ghost-surface hover:variant-ghost-warning hover:variant-outline-warning text-error-600 hover:text-error-900 transition-all text-wrap"
|
||||
class="btn btn-sm m-1 variant-ghost-secondary hover:variant-ghost-warning hover:variant-outline-warning text-error-700 hover:text-error-900 transition-all text-wrap"
|
||||
title="Reload and clear the page cache"
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
<!-- <span class="fas fa-sync mx-1"></span> -->
|
||||
<RefreshCcwDot class="mx-1" />
|
||||
<span>
|
||||
Clear Cache and Reload
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<!-- This is mainly for IDAA using iframes in the Novi site. -->
|
||||
@@ -830,10 +885,14 @@ $effect(() => {
|
||||
onclick={() => {
|
||||
window.location.reload();
|
||||
}}
|
||||
class="btn btn-sm"
|
||||
class="btn btn-sm m-1 variant-ghost-secondary hover:variant-ghost-warning hover:variant-outline-warning text-warning-800 hover:text-warning-900 transition-all"
|
||||
title="Reload page to clear some caches and check for updates"
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
<!-- <span class="fas fa-sync mx-1"></span> -->
|
||||
<RefreshCw class="mx-1" />
|
||||
<span>
|
||||
Reload
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -934,6 +993,7 @@ max-w-max -->
|
||||
{#if $ae_loc.access_type && $ae_loc.access_type != 'anonymous'}
|
||||
<span
|
||||
class="*:hover:inline"
|
||||
title={`Current access type/level: ${$ae_loc.access_type}`}
|
||||
>
|
||||
<!-- <span class="fas fa-unlock mx-1"></span> -->
|
||||
<ShieldPlus class="inline-block" />
|
||||
@@ -983,7 +1043,7 @@ max-w-max -->
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm variant-outline-surface hover:variant-ghost-warning transition-all *:hover:inline"
|
||||
title="Access mode is currently enabled/unlocked. Click to exit and lock."
|
||||
title={`Current user access level: "${$ae_loc.user_access_type}". Click use passcode for a different access level.`}
|
||||
>
|
||||
<!-- <span class="fas fa-lock mx-1"></span> -->
|
||||
<!-- <ShieldMinus /> -->
|
||||
@@ -1014,7 +1074,7 @@ max-w-max -->
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm variant-outline-surface hover:variant-ghost-warning transition-all hidden"
|
||||
title="Access mode is currently enabled/unlocked. Click to exit and lock."
|
||||
title={`Current access level: "${$ae_loc.access_type}". Click to clear the temporary access level.`}
|
||||
>
|
||||
<!-- <span class="fas fa-lock mx-1"></span> Lock? -->
|
||||
<ShieldMinus class="inline-block" />
|
||||
@@ -1045,7 +1105,7 @@ max-w-max -->
|
||||
btn btn-sm variant-outline-surface hover:variant-ghost-success transition-all
|
||||
*:hover:inline
|
||||
"
|
||||
title="Anonymous public access is currently set. Access mode is disabled/locked."
|
||||
title="Anonymous public access is currently set. You must Sign In or use a passcode to change your access level."
|
||||
>
|
||||
<!-- <span class="fas fa-lock mx-1 lock_icon"></span> -->
|
||||
<!-- <span class="">Unlock?</span> -->
|
||||
|
||||
Reference in New Issue
Block a user