Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed8352d857 | ||
|
|
41f64ca9fe | ||
|
|
738e49dc92 | ||
|
|
68a16257c6 | ||
|
|
5dcbae55f4 | ||
|
|
e0d963256c | ||
|
|
2bff4bbd15 | ||
|
|
a0eba89f34 | ||
|
|
4e78de9da2 | ||
|
|
06f49e24c2 | ||
|
|
e598ae45f7 | ||
|
|
ad7f469e06 | ||
|
|
27d613b594 |
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
import { Box, Stack, Tooltip, Typography } from "@mui/material";
|
||||||
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
import { formatDateWithTz } from "../../../Utils/timeUtils";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState, forwardRef } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
@@ -17,23 +17,29 @@ import PropTypes from "prop-types";
|
|||||||
* @returns {JSX.Element} The Bar component.
|
* @returns {JSX.Element} The Bar component.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const Bar = ({ width, height, backgroundColor, borderRadius, children }) => {
|
const Bar = forwardRef(
|
||||||
const theme = useTheme();
|
({ width, height, backgroundColor, borderRadius, children, ...otherProps }, ref) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
width={width}
|
ref={ref}
|
||||||
position="relative"
|
position="relative"
|
||||||
height={height}
|
width={width}
|
||||||
backgroundColor={backgroundColor}
|
height={height}
|
||||||
sx={{
|
backgroundColor={backgroundColor}
|
||||||
borderRadius: borderRadius || theme.spacing(1.5),
|
sx={{
|
||||||
}}
|
borderRadius: borderRadius || theme.spacing(1.5),
|
||||||
>
|
}}
|
||||||
{children}
|
{...otherProps}
|
||||||
</Box>
|
>
|
||||||
);
|
{children}
|
||||||
};
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Bar.displayName = "Bar";
|
||||||
|
|
||||||
Bar.propTypes = {
|
Bar.propTypes = {
|
||||||
width: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
||||||
|
|||||||
@@ -11,7 +11,12 @@ import PropTypes from "prop-types";
|
|||||||
|
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
|
|
||||||
const MonitorsList = ({ isLoading = false, shouldRender = true, monitors = [] }) => {
|
const MonitorsList = ({
|
||||||
|
isLoading = false,
|
||||||
|
shouldRender = true,
|
||||||
|
monitors = [],
|
||||||
|
statusPage = {},
|
||||||
|
}) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { determineState } = useMonitorUtils();
|
const { determineState } = useMonitorUtils();
|
||||||
|
|
||||||
@@ -40,10 +45,12 @@ const MonitorsList = ({ isLoading = false, shouldRender = true, monitors = [] })
|
|||||||
alignItems="center"
|
alignItems="center"
|
||||||
gap={theme.spacing(20)}
|
gap={theme.spacing(20)}
|
||||||
>
|
>
|
||||||
<Box flex={9}>
|
{statusPage.showCharts !== false && (
|
||||||
<StatusPageBarChart checks={monitor?.checks?.slice().reverse()} />
|
<Box flex={9}>
|
||||||
</Box>
|
<StatusPageBarChart checks={monitor?.checks?.slice().reverse()} />
|
||||||
<Box flex={1}>
|
</Box>
|
||||||
|
)}
|
||||||
|
<Box flex={statusPage.showCharts !== false ? 1 : 10}>
|
||||||
<StatusLabel
|
<StatusLabel
|
||||||
status={status}
|
status={status}
|
||||||
text={status}
|
text={status}
|
||||||
@@ -60,6 +67,7 @@ const MonitorsList = ({ isLoading = false, shouldRender = true, monitors = [] })
|
|||||||
|
|
||||||
MonitorsList.propTypes = {
|
MonitorsList.propTypes = {
|
||||||
monitors: PropTypes.array.isRequired,
|
monitors: PropTypes.array.isRequired,
|
||||||
|
statusPage: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default MonitorsList;
|
export default MonitorsList;
|
||||||
@@ -154,7 +154,10 @@ const PublicStatus = () => {
|
|||||||
/>
|
/>
|
||||||
<Typography variant="h2">{t("statusPageStatusServiceStatus")}</Typography>
|
<Typography variant="h2">{t("statusPageStatusServiceStatus")}</Typography>
|
||||||
<StatusBar monitors={monitors} />
|
<StatusBar monitors={monitors} />
|
||||||
<MonitorsList monitors={monitors} />
|
<MonitorsList
|
||||||
|
monitors={monitors}
|
||||||
|
statusPage={statusPage}
|
||||||
|
/>
|
||||||
{link}
|
{link}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { execSync } from "child_process";
|
|||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd(), "");
|
const env = loadEnv(mode, process.cwd(), "");
|
||||||
let version = "3.1.5";
|
let version = "3.1.7";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: "/",
|
base: "/",
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
FROM node:20-slim
|
FROM node:20-slim
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ../../package*.json ./
|
COPY ../../package*.json ./
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
FROM node:20-slim
|
FROM node:20-slim
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
COPY ./server/package*.json ./
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
# ---------------------
|
# ---------------------
|
||||||
FROM node:24-slim AS frontend-build
|
FROM node:24-slim AS frontend-build
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app/client
|
WORKDIR /app/client
|
||||||
|
|
||||||
COPY client/package.json ./
|
COPY client/package.json ./
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
FROM node:20-slim AS frontend-build
|
FROM node:20-slim AS frontend-build
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app/client
|
WORKDIR /app/client
|
||||||
|
|
||||||
COPY client/package*.json ./
|
COPY client/package*.json ./
|
||||||
|
|||||||
Vendored
+5
@@ -1,5 +1,10 @@
|
|||||||
FROM node:20-slim
|
FROM node:20-slim
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
COPY ./server/package*.json ./
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
FROM node:20-slim
|
FROM node:20-slim
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
FROM node:20-slim
|
FROM node:20-slim
|
||||||
|
|
||||||
|
# Install ping
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y iputils-ping \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -162,6 +162,14 @@ class StatusPageModule {
|
|||||||
as: "monitors.checks",
|
as: "monitors.checks",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
$lookup: {
|
||||||
|
from: "monitorstats",
|
||||||
|
localField: "monitors._id",
|
||||||
|
foreignField: "monitorId",
|
||||||
|
as: "monitors.stats",
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
$addFields: {
|
$addFields: {
|
||||||
"monitors.orderIndex": {
|
"monitors.orderIndex": {
|
||||||
@@ -181,6 +189,9 @@ class StatusPageModule {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"monitors.uptimePercentage": {
|
||||||
|
$arrayElemAt: ["$monitors.stats.uptimePercentage", 0],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ $match: { "monitors.orderIndex": { $ne: -1 } } },
|
{ $match: { "monitors.orderIndex": { $ne: -1 } } },
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ class NetworkService {
|
|||||||
const { response, responseTime, error } = await this.timeRequest(() => this.ping.promise.probe(monitor.url));
|
const { response, responseTime, error } = await this.timeRequest(() => this.ping.promise.probe(monitor.url));
|
||||||
|
|
||||||
if (!response) {
|
if (!response) {
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
throw new Error("Ping failed - no result returned");
|
throw new Error("Ping failed - no result returned");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user