From d8573be7ac135fcfd8072a59df4c727a92c3b0aa Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 20 Jun 2025 14:27:22 +0800 Subject: [PATCH] add util methods --- client/src/Utils/NetworkService.js | 12 ++++++++++++ client/src/Utils/monitorUtils.js | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/client/src/Utils/NetworkService.js b/client/src/Utils/NetworkService.js index eee795268..85feafbe6 100644 --- a/client/src/Utils/NetworkService.js +++ b/client/src/Utils/NetworkService.js @@ -1022,6 +1022,18 @@ class NetworkService { const { id, notification } = config; return this.axiosInstance.put(`/notifications/${id}`, notification); } + + async getQueueData() { + return this.axiosInstance.get(`/queue/all-metrics`, { + headers: { + "Content-Type": "application/json", + }, + }); + } + + async flushQueue() { + return this.axiosInstance.post(`/queue/flush`); + } } export default NetworkService; diff --git a/client/src/Utils/monitorUtils.js b/client/src/Utils/monitorUtils.js index cc92a86ae..e3645b0d0 100644 --- a/client/src/Utils/monitorUtils.js +++ b/client/src/Utils/monitorUtils.js @@ -36,3 +36,12 @@ export const parseDomainName = (url) => { return url; }; + +export const TypeToPathMap = { + http: "uptime", + port: "uptime", + docker: "uptime", + ping: "uptime", + hardware: "infrastructure", + pagespeed: "pagespeed", +};