📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Added getMonitorOverallStats method
Blue Mouseb4bf3b4215d4
diff --git a/app/api/index.ts b/app/api/index.tsindex b75831ed1..d46d73cbf 100644--- a/app/api/index.ts+++ b/app/api/index.ts@@ -19,7 +19,7 @@ import { IAlerts } from 'redux/models/IAlerts'import { ISharedProject } from 'redux/models/ISharedProject'import { ISubscribers } from 'redux/models/ISubscribers'import { IFilter, IProjectViewCustomEvent } from 'pages/Project/View/interfaces/traffic'-import { Monitor } from 'redux/models/Uptime'+import { Monitor, MonitorOverall } from 'redux/models/Uptime'const debug = Debug('swetrix:api')@@ -1004,6 +1004,32 @@ export const getAllMonitors = (take: number = DEFAULT_MONITORS_TAKE, skip: numbethrow _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})+export const getMonitorOverallStats = (+ pid: string,+ monitorIds: string[],+ period: string,+ from = '',+ to = '',+ timezone = 'Etc/GMT',+ password?: string,+) =>+ api+ .get(+ `log/monitor-data/birdseye?pid=${pid}&monitorIds=[${_map(monitorIds, (pid) => `"${pid}"`).join(+ ',',+ )}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}`,+ {+ headers: {+ 'x-password': password,+ },+ },+ )+ .then((response): MonitorOverall => response.data)+ .catch((error) => {+ debug('%s', error)+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message+ })+export const createMonitor = (pid: string, data: ICreateMonitor) =>api.post(`project/${pid}/monitor`, data)