fix: resolve production UI and API issues
- Fixed backend version endpoint by adding retry logic import - Gallery login page improvements: * Increased title size from text-xl to text-2xl (responsive scaling) * Title now uses event's custom primary color (var(--color-primary)) * Removed event category badge from login page - Fixed Umami analytics configuration check: * Added proper enabled state tracking * Warning now only shows when Umami is explicitly not configured * Checks both admin settings and environment variables properly These changes improve user experience and fix false warnings in production. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const { db } = require('../database/db');
|
const { db, withRetry } = require('../database/db');
|
||||||
const { adminAuth } = require('../middleware/auth-enhanced-v2');
|
const { adminAuth } = require('../middleware/auth-enhanced-v2');
|
||||||
const fs = require('fs').promises;
|
const fs = require('fs').promises;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|||||||
@@ -289,18 +289,9 @@ export const GalleryPage: React.FC = () => {
|
|||||||
alt={settingsData?.branding_company_name || 'PicPeak'}
|
alt={settingsData?.branding_company_name || 'PicPeak'}
|
||||||
className="h-12 sm:h-16 lg:h-20 w-auto object-contain mx-auto mb-3 sm:mb-4"
|
className="h-12 sm:h-16 lg:h-20 w-auto object-contain mx-auto mb-3 sm:mb-4"
|
||||||
/>
|
/>
|
||||||
<h1 className="text-xl sm:text-2xl lg:text-3xl font-bold mb-2 px-2" style={{ color: 'var(--color-text, #171717)' }}>
|
<h1 className="text-2xl sm:text-3xl lg:text-4xl font-bold mb-2 px-2" style={{ color: 'var(--color-primary, #5C8762)' }}>
|
||||||
{galleryInfo?.event_name}
|
{galleryInfo?.event_name}
|
||||||
</h1>
|
</h1>
|
||||||
{galleryInfo?.event_type && (
|
|
||||||
<div className="flex items-center justify-center text-xs sm:text-sm" style={{ color: 'var(--color-text, #171717)', opacity: 0.7 }}>
|
|
||||||
<span className="px-3 py-1 rounded-full" style={{ backgroundColor: 'var(--color-primary, #5C8762)', opacity: 0.1 }}>
|
|
||||||
<span style={{ color: 'var(--color-primary, #5C8762)' }}>
|
|
||||||
{t(`events.types.${galleryInfo.event_type}`)}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Expiration Warning */}
|
{/* Expiration Warning */}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export const AnalyticsPage: React.FC = () => {
|
|||||||
const [isEmbedMode, setIsEmbedMode] = useState(false);
|
const [isEmbedMode, setIsEmbedMode] = useState(false);
|
||||||
|
|
||||||
// Check if Umami is configured from settings or environment
|
// Check if Umami is configured from settings or environment
|
||||||
const [umamiConfig, setUmamiConfig] = useState<{ url?: string; shareUrl?: string }>({});
|
const [umamiConfig, setUmamiConfig] = useState<{ url?: string; shareUrl?: string; enabled?: boolean }>({});
|
||||||
|
|
||||||
// Fetch analytics data from backend
|
// Fetch analytics data from backend
|
||||||
const { data: apiData, isLoading, refetch } = useQuery({
|
const { data: apiData, isLoading, refetch } = useQuery({
|
||||||
@@ -82,7 +82,8 @@ export const AnalyticsPage: React.FC = () => {
|
|||||||
if (settings.umami_enabled && settings.umami_url && settings.umami_website_id) {
|
if (settings.umami_enabled && settings.umami_url && settings.umami_website_id) {
|
||||||
setUmamiConfig({
|
setUmamiConfig({
|
||||||
url: settings.umami_url,
|
url: settings.umami_url,
|
||||||
shareUrl: settings.umami_share_url
|
shareUrl: settings.umami_share_url,
|
||||||
|
enabled: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Fall back to environment variables if they exist
|
// Fall back to environment variables if they exist
|
||||||
@@ -92,8 +93,11 @@ export const AnalyticsPage: React.FC = () => {
|
|||||||
if (envUrl && envWebsiteId) {
|
if (envUrl && envWebsiteId) {
|
||||||
setUmamiConfig({
|
setUmamiConfig({
|
||||||
url: envUrl,
|
url: envUrl,
|
||||||
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL
|
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL,
|
||||||
|
enabled: true
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
setUmamiConfig({ enabled: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -105,8 +109,11 @@ export const AnalyticsPage: React.FC = () => {
|
|||||||
if (envUrl && envWebsiteId) {
|
if (envUrl && envWebsiteId) {
|
||||||
setUmamiConfig({
|
setUmamiConfig({
|
||||||
url: envUrl,
|
url: envUrl,
|
||||||
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL
|
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL,
|
||||||
|
enabled: true
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
setUmamiConfig({ enabled: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -450,7 +457,7 @@ export const AnalyticsPage: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Configuration Notice */}
|
{/* Configuration Notice */}
|
||||||
{!umamiConfig.url && (
|
{umamiConfig.enabled === false && (
|
||||||
<Card padding="md" className="mt-6 bg-amber-50 border-amber-200">
|
<Card padding="md" className="mt-6 bg-amber-50 border-amber-200">
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<Activity className="w-5 h-5 text-amber-600 flex-shrink-0" />
|
<Activity className="w-5 h-5 text-amber-600 flex-shrink-0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user