char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
f1357e499
char/aliceai-t5-moe
1< script lang ="ts "> 2import { goto } from '$app/navigation' ; 3import { page } from '$app/stores' ; 4import { ServerErrorSplash } from '$lib/components/app' ; 5import { APP_NAME , ROUTES } from '$lib/constants' ; 6 7let error = $derived ( $page . error ); 8let status = $derived ( $page . status ); 9 10// Check if this is an API key related error 11let isApiKeyError = $derived ( 12status === 401 || 13status === 403 || 14error ?. message ?. toLowerCase (). includes ( 'access denied' ) || 15error ?. message ?. toLowerCase (). includes ( 'unauthorized' ) || 16error ?. message ?. toLowerCase (). includes ( 'invalid api key' ) 17); 18 19function handleRetry () { 20// Navigate back to home page after successful API key validation 21goto ( ROUTES . START ); 22} 23</ script > 24 25< svelte:head > 26< title > Error{ status } -{ APP_NAME }</ title > 27</ svelte:head > 28 29{ # if isApiKeyError } 30< ServerErrorSplash 31error ={ error ?. message || 'Access denied - check server permissions' } 32onRetry ={ handleRetry } 33showRetry ={ false } 34showTroubleshooting ={ false } 35/> 36{ : else } 37<!-- Generic error page for non-API key errors --> 38< div class ="flex h-full items-center justify-center "> 39< div class ="w-full max-w-md px-4 text-center "> 40< div class ="mb-6 "> 41< div 42class ="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10 " 43> 44< svg 45class ="h-8 w-8 text-destructive " 46fill ="none " 47stroke ="currentColor " 48viewBox ="0 0 24 24 " 49> 50< path 51d ="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z " 52stroke-linecap ="round " 53stroke-linejoin ="round " 54stroke-width ="2 " 55/> 56</ svg > 57</ div > 58 59< h1 class ="mb-2 text-2xl font-bold "> Error{ status }</ h1 > 60 61< p class ="text-muted-foreground "> 62{ error ?. message || 'Something went wrong' } 63</ p > 64</ div > 65 66< button 67class ="rounded-md bg-primary px-4 py-2 text-primary-foreground hover:bg-primary/90 " 68onclick ={() => goto ( ROUTES . START )} 69> 70 Go Home 71</ button > 72</ div > 73</ div > 74{ / if }