From 6b070b7b2090879b5e440c14e9a1cae9bccef19d Mon Sep 17 00:00:00 2001 From: mario4tier Date: Wed, 4 Sep 2024 17:12:10 -0400 Subject: [PATCH] Minor rewording on generated blob view webpage. --- backend/cache/dist/controllers/view.js | 15 +++++++++------ backend/cache/src/controllers/view.ts | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/backend/cache/dist/controllers/view.js b/backend/cache/dist/controllers/view.js index 5cc1a19..b5518ed 100644 --- a/backend/cache/dist/controllers/view.js +++ b/backend/cache/dist/controllers/view.js @@ -122,13 +122,13 @@ export const getView = async (req, res) => { const today = new Date(); const last30Days = Array.from({ length: 30 }, (_, i) => format(subDays(today, i + 1), 'yyyy-MM-dd')).reverse(); // Calculate CDN Hits Percentage - const blobHits = []; + const blobViews = []; const blobVisitors = []; const blobCdnHitsPercentage = []; last30Days.forEach(date => { // If the date is not in the metrics, use a placeholder const dayMetrics = (isValidMetrics && metrics.daily[date]?.blob) || { hits: 0, hitsEdge: 0, visitors: 0 }; - blobHits.push(dayMetrics.hits); + blobViews.push(dayMetrics.hits); blobVisitors.push(dayMetrics.visitors); const cdnHitsPercentage = dayMetrics.hits === 0 ? 0 : (dayMetrics.hitsEdge / dayMetrics.hits) * 100; blobCdnHitsPercentage.push(cdnHitsPercentage); @@ -156,7 +156,7 @@ export const getView = async (req, res) => { -

Dashboard for ${id}

+

Metrics for ${id}

@@ -168,7 +168,7 @@ export const getView = async (req, res) => { +
+ JSON Metrics +
`; diff --git a/backend/cache/src/controllers/view.ts b/backend/cache/src/controllers/view.ts index bd56f93..39f122c 100644 --- a/backend/cache/src/controllers/view.ts +++ b/backend/cache/src/controllers/view.ts @@ -132,14 +132,14 @@ export const getView = async (req: Request, res: Response) => { const last30Days = Array.from({ length: 30 }, (_, i) => format(subDays(today, i + 1), 'yyyy-MM-dd')).reverse(); // Calculate CDN Hits Percentage - const blobHits: number[] = []; + const blobViews: number[] = []; const blobVisitors: number[] = []; const blobCdnHitsPercentage: number[] = []; last30Days.forEach(date => { // If the date is not in the metrics, use a placeholder const dayMetrics = (isValidMetrics && metrics.daily[date]?.blob) || { hits: 0, hitsEdge: 0, visitors: 0 }; - blobHits.push(dayMetrics.hits); + blobViews.push(dayMetrics.hits); blobVisitors.push(dayMetrics.visitors); const cdnHitsPercentage = dayMetrics.hits === 0 ? 0 : (dayMetrics.hitsEdge / dayMetrics.hits) * 100; blobCdnHitsPercentage.push(cdnHitsPercentage); @@ -169,7 +169,7 @@ export const getView = async (req: Request, res: Response) => { -

Dashboard for ${id}

+

Metrics for ${id}

@@ -181,7 +181,7 @@ export const getView = async (req: Request, res: Response) => { +
+ JSON Metrics +
`;