mirror of
https://github.com/umami-software/umami.git
synced 2026-05-30 06:47:25 +00:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
@@ -10,6 +10,7 @@ import styles from './Heatmap.module.css';
|
||||
|
||||
const CLICK_EDGE_PERCENT = 1.5;
|
||||
const SCROLL_BUCKET_SIZE = 10;
|
||||
const SNAPSHOT_UNAVAILABLE_ERROR = 'Page screenshot unavailable.';
|
||||
|
||||
interface ViewportBucket {
|
||||
width: number;
|
||||
@@ -299,7 +300,7 @@ function ClickHeatmapView({
|
||||
|
||||
{showPage && snapshot?.status === 'failed' && (
|
||||
<Text color="muted" className={styles.snapshotMessage}>
|
||||
{snapshot.error || 'Page screenshot unavailable.'}
|
||||
{SNAPSHOT_UNAVAILABLE_ERROR}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
@@ -447,7 +448,7 @@ function ScrollHeatmapView({
|
||||
|
||||
{showPage && snapshot?.status === 'failed' && (
|
||||
<Text color="muted" className={styles.snapshotMessage}>
|
||||
{snapshot.error || 'Page screenshot unavailable.'}
|
||||
{SNAPSHOT_UNAVAILABLE_ERROR}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ const SNAPSHOT_STATUS = {
|
||||
const SNAPSHOT_RETRY_DELAY_MS = 15 * 60 * 1000;
|
||||
const SNAPSHOT_PENDING_WINDOW_MS = 30 * 1000;
|
||||
const SNAPSHOT_DEVICE_SCALE_FACTOR = 1;
|
||||
const SNAPSHOT_UNAVAILABLE_ERROR = 'Page screenshot unavailable.';
|
||||
export type HeatmapSnapshotStatus = (typeof SNAPSHOT_STATUS)[keyof typeof SNAPSHOT_STATUS];
|
||||
|
||||
export interface HeatmapSnapshotImage {
|
||||
@@ -682,7 +683,7 @@ export async function ensureHeatmapSnapshot({
|
||||
status: SNAPSHOT_STATUS.failed,
|
||||
mimeType: null,
|
||||
imageData: null,
|
||||
error: 'Website domain is not configured for screenshot capture.',
|
||||
error: SNAPSHOT_UNAVAILABLE_ERROR,
|
||||
});
|
||||
|
||||
const failed = await findSnapshot(websiteId, urlPath, viewportW, viewportH);
|
||||
@@ -741,7 +742,7 @@ export async function ensureHeatmapSnapshot({
|
||||
status: SNAPSHOT_STATUS.failed,
|
||||
mimeType: null,
|
||||
imageData: null,
|
||||
error: error instanceof Error ? error.message.slice(0, 500) : 'Screenshot capture failed.',
|
||||
error: SNAPSHOT_UNAVAILABLE_ERROR,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user