feat: update favicon retrieval to use a centralized service URL for consistency across the application
This commit is contained in:
@@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|||||||
- **Organization context switch.** Switching away from a deleted organization now stores the session correctly instead of using an insecure fallback.
|
- **Organization context switch.** Switching away from a deleted organization now stores the session correctly instead of using an insecure fallback.
|
||||||
- **Removed debug logs.** Auth and organization-switching details no longer leak into the browser console in production. Error logs are now also suppressed in production and only appear during development.
|
- **Removed debug logs.** Auth and organization-switching details no longer leak into the browser console in production. Error logs are now also suppressed in production and only appear during development.
|
||||||
- **Dark mode uptime chart.** The response time chart on the uptime page now correctly follows your dark mode preference instead of always showing a white tooltip background.
|
- **Dark mode uptime chart.** The response time chart on the uptime page now correctly follows your dark mode preference instead of always showing a white tooltip background.
|
||||||
|
- **Onboarding form limits.** The welcome page now enforces the same character limits as the rest of the app.
|
||||||
|
|
||||||
## [0.10.0-alpha] - 2026-02-21
|
## [0.10.0-alpha] - 2026-02-21
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { Metadata } from 'next'
|
import type { Metadata } from 'next'
|
||||||
|
import { FAVICON_SERVICE_URL } from '@/lib/utils/icons'
|
||||||
|
|
||||||
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8082'
|
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8082'
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ export async function generateMetadata({ params }: SharePageParams): Promise<Met
|
|||||||
siteName: 'Pulse by Ciphera',
|
siteName: 'Pulse by Ciphera',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
images: [{
|
images: [{
|
||||||
url: `https://www.google.com/s2/favicons?domain=${domain}&sz=128`,
|
url: `${FAVICON_SERVICE_URL}?domain=${domain}&sz=128`,
|
||||||
width: 128,
|
width: 128,
|
||||||
height: 128,
|
height: 128,
|
||||||
alt: `${domain} favicon`,
|
alt: `${domain} favicon`,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import PerformanceStats from '@/components/dashboard/PerformanceStats'
|
|||||||
import { Select, DatePicker as DatePickerModal, Captcha, DownloadIcon, ZapIcon } from '@ciphera-net/ui'
|
import { Select, DatePicker as DatePickerModal, Captcha, DownloadIcon, ZapIcon } from '@ciphera-net/ui'
|
||||||
import { DashboardSkeleton, useMinimumLoading } from '@/components/skeletons'
|
import { DashboardSkeleton, useMinimumLoading } from '@/components/skeletons'
|
||||||
import ExportModal from '@/components/dashboard/ExportModal'
|
import ExportModal from '@/components/dashboard/ExportModal'
|
||||||
|
import { FAVICON_SERVICE_URL } from '@/lib/utils/icons'
|
||||||
|
|
||||||
// Helper to get date ranges
|
// Helper to get date ranges
|
||||||
const getDateRange = (days: number) => {
|
const getDateRange = (days: number) => {
|
||||||
@@ -286,7 +287,7 @@ export default function PublicDashboardPage() {
|
|||||||
</div>
|
</div>
|
||||||
<h1 className="text-2xl font-bold text-neutral-900 dark:text-white flex items-center gap-3">
|
<h1 className="text-2xl font-bold text-neutral-900 dark:text-white flex items-center gap-3">
|
||||||
<Image
|
<Image
|
||||||
src={`https://www.google.com/s2/favicons?domain=${site.domain}&sz=64`}
|
src={`${FAVICON_SERVICE_URL}?domain=${site.domain}&sz=64`}
|
||||||
alt={site.name}
|
alt={site.name}
|
||||||
width={32}
|
width={32}
|
||||||
height={32}
|
height={32}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import type { Stats } from '@/lib/api/stats'
|
|||||||
import { formatNumber } from '@ciphera-net/ui'
|
import { formatNumber } from '@ciphera-net/ui'
|
||||||
import { BarChartIcon, SettingsIcon, BookOpenIcon, ExternalLinkIcon, Button } from '@ciphera-net/ui'
|
import { BarChartIcon, SettingsIcon, BookOpenIcon, ExternalLinkIcon, Button } from '@ciphera-net/ui'
|
||||||
import { useAuth } from '@/lib/auth/context'
|
import { useAuth } from '@/lib/auth/context'
|
||||||
|
import { FAVICON_SERVICE_URL } from '@/lib/utils/icons'
|
||||||
|
|
||||||
export type SiteStatsMap = Record<string, { stats: Stats }>
|
export type SiteStatsMap = Record<string, { stats: Stats }>
|
||||||
|
|
||||||
@@ -36,7 +37,7 @@ function SiteCard({ site, stats, statsLoading, onDelete, canDelete }: SiteCardPr
|
|||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<div className="h-12 w-12 overflow-hidden rounded-lg border border-neutral-100 bg-neutral-50 p-1 dark:border-neutral-800 dark:bg-neutral-800">
|
<div className="h-12 w-12 overflow-hidden rounded-lg border border-neutral-100 bg-neutral-50 p-1 dark:border-neutral-800 dark:bg-neutral-800">
|
||||||
<Image
|
<Image
|
||||||
src={`https://www.google.com/s2/favicons?domain=${site.domain}&sz=64`}
|
src={`${FAVICON_SERVICE_URL}?domain=${site.domain}&sz=64`}
|
||||||
alt={site.name}
|
alt={site.name}
|
||||||
width={40}
|
width={40}
|
||||||
height={40}
|
height={40}
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Google's public favicon service base URL.
|
||||||
|
* Append `?domain=<host>&sz=<px>` to get a favicon.
|
||||||
|
*/
|
||||||
|
export const FAVICON_SERVICE_URL = 'https://www.google.com/s2/favicons'
|
||||||
import {
|
import {
|
||||||
FaChrome,
|
FaChrome,
|
||||||
FaFirefox,
|
FaFirefox,
|
||||||
@@ -197,7 +203,7 @@ export function getReferrerFavicon(referrer: string): string | null {
|
|||||||
try {
|
try {
|
||||||
const url = new URL(referrer.startsWith('http') ? referrer : `https://${referrer}`)
|
const url = new URL(referrer.startsWith('http') ? referrer : `https://${referrer}`)
|
||||||
if (REFERRER_USE_X_ICON.has(url.hostname.toLowerCase())) return null
|
if (REFERRER_USE_X_ICON.has(url.hostname.toLowerCase())) return null
|
||||||
return `https://www.google.com/s2/favicons?domain=${url.hostname}&sz=32`
|
return `${FAVICON_SERVICE_URL}?domain=${url.hostname}&sz=32`
|
||||||
} catch {
|
} catch {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user