From 9f15be43c0b7acd04ca9c4ee33aadbaa11aa58e4 Mon Sep 17 00:00:00 2001 From: Cooper Ransom Date: Mon, 1 Apr 2024 23:06:58 -0400 Subject: [PATCH] I broke the topflix page lol --- src/pages/TopFlix.tsx | 6 +++--- src/pages/TopSources.tsx | 2 +- src/pages/parts/admin/ConfigValuesPart.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/TopFlix.tsx b/src/pages/TopFlix.tsx index a51b97d3..337b5a2c 100644 --- a/src/pages/TopFlix.tsx +++ b/src/pages/TopFlix.tsx @@ -85,7 +85,7 @@ function ConfigValue(props: { } async function getRecentPlayedItems() { - const response = await fetch(BACKEND_URL); + const response = await fetch(`${BACKEND_URL}/metrics`); const text = await response.text(); const regex = @@ -119,7 +119,7 @@ async function getRecentPlayedItems() { } async function getTotalViews() { - const response = await fetch(BACKEND_URL); + const response = await fetch(`${BACKEND_URL}/metrics`); const text = await response.text(); // Add up all mw_media_watch_count entries @@ -139,7 +139,7 @@ async function getTotalViews() { } function getProcessStartTime(): Promise { - return fetch(BACKEND_URL) + return fetch(`${BACKEND_URL}/metrics`) .then((response) => response.text()) .then((text) => { const regex = /process_start_time_seconds (\d+)/; diff --git a/src/pages/TopSources.tsx b/src/pages/TopSources.tsx index c631c4a7..ee44e0f8 100644 --- a/src/pages/TopSources.tsx +++ b/src/pages/TopSources.tsx @@ -25,7 +25,7 @@ function ConfigValue(props: { name: string; children?: ReactNode }) { } async function getTopSources() { - const response = await fetch(BACKEND_URL); + const response = await fetch(`${BACKEND_URL}/metrics`); const text = await response.text(); const regex = diff --git a/src/pages/parts/admin/ConfigValuesPart.tsx b/src/pages/parts/admin/ConfigValuesPart.tsx index ca3cb6d1..74372361 100644 --- a/src/pages/parts/admin/ConfigValuesPart.tsx +++ b/src/pages/parts/admin/ConfigValuesPart.tsx @@ -6,7 +6,7 @@ import { conf } from "@/setup/config"; import { BACKEND_URL } from "@/setup/constants"; async function getAccountNumber() { - const response = await fetch(BACKEND_URL); + const response = await fetch(`${BACKEND_URL}/metrics`); const text = await response.text(); // Adjusted regex to match any hostname @@ -27,7 +27,7 @@ async function getAccountNumber() { } async function getAllAccounts() { - const response = await fetch(BACKEND_URL); + const response = await fetch(`${BACKEND_URL}/metrics`); const text = await response.text(); const regex = /mw_user_count{namespace="movie-web"} (\d+)/;