fix: implement 9 production enhancements and security fixes
- Password Complexity: Added 4-level complexity selector (Simple/Moderate/Strong/Very Strong) in admin security settings with dynamic backend validation - Gallery Security: Removed event date from login page (security risk), replaced with event type badge - Analytics Config: Fixed "Not Configured" detection logic to check both admin settings and env variables - Analytics Accuracy: Aligned calculation logic between dashboard and analytics endpoints, added totals verification - Translations: Added missing activity keys (analytics_settings_updated, cms_page_updated, security_settings_updated, password_reset, admin_logout, system_activity) - UI Fixes: Fixed German text overflow in CMS page selector with proper CSS truncation - Date Format: Event creation now respects admin-configured date format instead of browser locale - Chrome Compatibility: Replaced emoji flags with SVG components for Windows Chrome support All changes maintain backward compatibility and production stability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
@@ -78,25 +78,36 @@ export const AnalyticsPage: React.FC = () => {
|
||||
const response = await fetch(`${import.meta.env.VITE_API_URL}/api/public/settings`);
|
||||
const settings = await response.json();
|
||||
|
||||
if (settings.umami_enabled) {
|
||||
// Check if Umami is enabled in admin settings
|
||||
if (settings.umami_enabled && settings.umami_url && settings.umami_website_id) {
|
||||
setUmamiConfig({
|
||||
url: settings.umami_url,
|
||||
shareUrl: settings.umami_share_url
|
||||
});
|
||||
} else {
|
||||
// Fall back to environment variables
|
||||
setUmamiConfig({
|
||||
url: import.meta.env.VITE_UMAMI_URL,
|
||||
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL
|
||||
});
|
||||
// Fall back to environment variables if they exist
|
||||
const envUrl = import.meta.env.VITE_UMAMI_URL;
|
||||
const envWebsiteId = import.meta.env.VITE_UMAMI_WEBSITE_ID;
|
||||
|
||||
if (envUrl && envWebsiteId) {
|
||||
setUmamiConfig({
|
||||
url: envUrl,
|
||||
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch Umami config:', error);
|
||||
// Fall back to environment variables
|
||||
setUmamiConfig({
|
||||
url: import.meta.env.VITE_UMAMI_URL,
|
||||
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL
|
||||
});
|
||||
// Fall back to environment variables if they exist
|
||||
const envUrl = import.meta.env.VITE_UMAMI_URL;
|
||||
const envWebsiteId = import.meta.env.VITE_UMAMI_WEBSITE_ID;
|
||||
|
||||
if (envUrl && envWebsiteId) {
|
||||
setUmamiConfig({
|
||||
url: envUrl,
|
||||
shareUrl: import.meta.env.VITE_UMAMI_SHARE_URL
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user