Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Should not check updates in cloud mode. Minor updates.

Mike Cao56ab09949918
diff --git a/components/common/UpdateNotice.js b/components/common/UpdateNotice.js
index 2cdbcb43f..bef6be982 100644
--- a/components/common/UpdateNotice.js
+++ b/components/common/UpdateNotice.js
@@ -13,7 +13,11 @@ export function UpdateNotice({ user, config }) {
const { pathname } = useRouter();
const [dismissed, setDismissed] = useState(checked);
const allowUpdate =
- user?.isAdmin && !config?.updatesDisabled && !pathname.includes('/share/') && !dismissed;
+ user?.isAdmin &&
+ !config?.updatesDisabled &&
+ !config?.cloudMode &&
+ !pathname.includes('/share/') &&
+ !dismissed;
const updateCheck = useCallback(() => {
setItem(VERSION_CHECK, { version: latest, time: Date.now() });
diff --git a/components/metrics/PageviewsChart.js b/components/metrics/PageviewsChart.js
index 362c616e2..1b481c481 100644
--- a/components/metrics/PageviewsChart.js
+++ b/components/metrics/PageviewsChart.js
@@ -3,7 +3,7 @@ import BarChart from './BarChart';
import { useLocale, useTheme, useMessages } from 'hooks';
import { renderDateLabels, renderStatusTooltipPopup } from 'lib/charts';
-export function PageviewsChart({ websiteId, data, unit, className, loading, ...props }) {
+export function PageviewsChart({ websiteId, data, unit, loading, ...props }) {
const { formatMessage, labels } = useMessages();
const { colors } = useTheme();
const { locale } = useLocale();
@@ -31,7 +31,6 @@ export function PageviewsChart({ websiteId, data, unit, className, loading, ...p
<BarChart
{...props}
key={websiteId}
- className={className}
datasets={datasets}
unit={unit}
loading={loading}
diff --git a/components/pages/realtime/RealtimePage.js b/components/pages/realtime/RealtimePage.js
index dea89f58e..507c123c7 100644
--- a/components/pages/realtime/RealtimePage.js
+++ b/components/pages/realtime/RealtimePage.js
@@ -93,9 +93,7 @@ export function RealtimePage({ websiteId }) {
<Page loading={isLoading} error={error}>
<WebsiteHeader websiteId={websiteId} />
<RealtimeHeader websiteId={websiteId} data={currentData} />
- <div className={styles.chart}>
- <RealtimeChart data={realtimeData} unit="minute" />
- </div>
+ <RealtimeChart className={styles.chart} data={realtimeData} unit="minute" />
<GridRow>
<GridColumn xs={12} sm={12} md={12} lg={4} xl={4}>
<RealtimeUrls websiteId={websiteId} websiteDomain={website?.domain} data={realtimeData} />
diff --git a/pages/api/websites/[id]/stats.ts b/pages/api/websites/[id]/stats.ts
index 3e2b96a8b..3164913d9 100644
--- a/pages/api/websites/[id]/stats.ts
+++ b/pages/api/websites/[id]/stats.ts
@@ -1,4 +1,4 @@
-import { addMinutes, differenceInMinutes } from 'date-fns';
+import { subMinutes, differenceInMinutes } from 'date-fns';
import { NextApiResponse } from 'next';
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
import { canViewWebsite } from 'lib/auth';
@@ -53,8 +53,8 @@ export default async (
const { startDate, endDate } = await parseDateRangeQuery(req);
const diff = differenceInMinutes(endDate, startDate);
- const prevStartDate = addMinutes(startDate, -diff);
- const prevEndDate = addMinutes(endDate, -diff);
+ const prevStartDate = subMinutes(startDate, diff);
+ const prevEndDate = subMinutes(endDate, diff);
const metrics = await getWebsiteStats(websiteId, {
startDate,