fix: add missing i18n translation key and admin debug logs
- Added common.all translation key to de.ts and en.ts - Added debug logging to admin page for troubleshooting access issues
This commit is contained in:
@@ -9,15 +9,23 @@ export default async function AdminPage() {
|
||||
const supabase = createServerComponentClient({ cookies });
|
||||
const { data: { user } } = await supabase.auth.getUser();
|
||||
|
||||
console.log('[Admin Page] User:', user?.id, user?.email);
|
||||
|
||||
if (!user) {
|
||||
console.log('[Admin Page] No user found, redirecting to home');
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
const isAdmin = await checkIsAdmin(user.id);
|
||||
console.log('[Admin Page] Is admin check result:', isAdmin);
|
||||
|
||||
if (!isAdmin) {
|
||||
console.log('[Admin Page] User is not admin, redirecting to home');
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
console.log('[Admin Page] Access granted, loading dashboard');
|
||||
|
||||
// Fetch global API stats
|
||||
const stats = await getGlobalApiStats();
|
||||
|
||||
@@ -185,16 +193,16 @@ export default async function AdminPage() {
|
||||
</td>
|
||||
<td className="py-3 px-4">
|
||||
<span className={`text-xs font-black uppercase px-2 py-1 rounded ${item.api_type === 'google_search'
|
||||
? 'bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-500'
|
||||
: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-500'
|
||||
? 'bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-500'
|
||||
: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-500'
|
||||
}`}>
|
||||
{item.api_type === 'google_search' ? 'Search' : 'AI'}
|
||||
</span>
|
||||
</td>
|
||||
<td className="py-3 px-4">
|
||||
<span className={`text-xs font-black uppercase px-2 py-1 rounded ${item.success
|
||||
? 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-500'
|
||||
: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-500'
|
||||
? 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-500'
|
||||
: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-500'
|
||||
}`}>
|
||||
{item.success ? 'Success' : 'Failed'}
|
||||
</span>
|
||||
|
||||
@@ -15,6 +15,7 @@ export const de: TranslationKeys = {
|
||||
check: 'Prüfen',
|
||||
link: 'Verknüpfen',
|
||||
none: 'Keine',
|
||||
all: 'Alle',
|
||||
},
|
||||
home: {
|
||||
title: 'Whisky Vault',
|
||||
|
||||
@@ -15,6 +15,7 @@ export const en: TranslationKeys = {
|
||||
check: 'Check',
|
||||
link: 'Link',
|
||||
none: 'None',
|
||||
all: 'All',
|
||||
},
|
||||
home: {
|
||||
title: 'Whisky Vault',
|
||||
|
||||
@@ -13,6 +13,7 @@ export type TranslationKeys = {
|
||||
check: string;
|
||||
link: string;
|
||||
none: string;
|
||||
all: string;
|
||||
};
|
||||
home: {
|
||||
title: string;
|
||||
|
||||
Reference in New Issue
Block a user