This commit is contained in:
Alex Holliday committed 2025-10-06 13:59:31 -07:00
1 parent cfb1830b55
commit abadc99bf1
16 files changed
+368 -17

No files matched your search

+6
View File
@@ -18,4 +18,10 @@ export const post = <T>(
config: AxiosRequestConfig = {}
): Promise<AxiosResponse<T>> => api.post<T>(url, data, config);
export const patch = <T>(
url: string,
data: any,
config: AxiosRequestConfig = {}
): Promise<AxiosResponse<T>> => api.patch<T>(url, data, config);
export default api;
+19
View File
@@ -0,0 +1,19 @@
import type { MonitorStatus } from "@/Types/Monitor";
export const getStatusColor = (status: MonitorStatus, theme: any): string => {
const statusColors: Record<MonitorStatus, string> = {
up: theme.palette.success.lowContrast,
down: theme.palette.error.lowContrast,
initializing: theme.palette.warning.lowContrast,
};
return statusColors[status];
};
export const formatUrl = (url: string, maxLength: number = 55) => {
if (!url) return "";
const strippedUrl = url.replace(/^https?:\/\//, "");
return strippedUrl.length > maxLength
? `${strippedUrl.slice(0, maxLength)}…`
: strippedUrl;
};