Resolved merge conflict in App.jsx
This commit is contained in:
commit
8d62da1b88
50 files changed
+1739
-360
No files matched your search
@@ -10,6 +10,7 @@
|
||||
font-size: var(--env-var-font-size-large);
|
||||
}
|
||||
.create-monitor-form p.MuiTypography-root,
|
||||
.create-monitor-form button.MuiButtonBase-root,
|
||||
#monitor-frequencies {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import { createMonitorValidation } from "../../Validation/validation";
|
||||
import { createMonitor } from "../../Features/Monitors/monitorsSlice";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useTheme } from "@emotion/react";
|
||||
import WestRoundedIcon from "@mui/icons-material/WestRounded";
|
||||
|
||||
const CreateNewMonitor = () => {
|
||||
const MS_PER_MINUTE = 60000;
|
||||
@@ -133,6 +134,20 @@ const CreateNewMonitor = () => {
|
||||
padding: `${theme.content.pY} ${theme.content.pX}`,
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
level="tertiary"
|
||||
label="Back"
|
||||
img={<WestRoundedIcon />}
|
||||
onClick={() => navigate("/monitors")}
|
||||
sx={{
|
||||
backgroundColor: "#f4f4f4",
|
||||
mb: theme.gap.medium,
|
||||
px: theme.gap.ml,
|
||||
"& svg.MuiSvgIcon-root": {
|
||||
pr: theme.gap.small,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Typography component="h1">Create new monitor</Typography>
|
||||
<div className="monitors-gaps-medium"></div>
|
||||
<ConfigBox
|
||||
@@ -326,7 +341,7 @@ const CreateNewMonitor = () => {
|
||||
MenuProps={{
|
||||
PaperProps: {
|
||||
style: {
|
||||
marginTop: "10px"
|
||||
marginTop: "10px",
|
||||
},
|
||||
},
|
||||
}}
|
||||
|
||||
@@ -7,11 +7,9 @@ import Button from "../../Components/Button";
|
||||
import LeftArrow from "../../assets/Images/arrow-left.png";
|
||||
import { useState, useEffect } from "react";
|
||||
import { recoveryValidation } from "../../Validation/validation";
|
||||
import axios from "axios";
|
||||
import axiosInstance from "../../Utils/axiosConfig";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL;
|
||||
|
||||
const ForgotPassword = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -50,7 +48,7 @@ const ForgotPassword = () => {
|
||||
if (error !== undefined) {
|
||||
throw error;
|
||||
}
|
||||
await axios.post(`${BASE_URL}/auth/recovery/request`, form);
|
||||
await axiosInstance.post(`/auth/recovery/request`, form);
|
||||
navigate("/check-email");
|
||||
} catch (error) {
|
||||
//TODO display error (Toast?)
|
||||
|
||||
@@ -9,12 +9,10 @@ import CheckBox from "../../Components/Checkbox/Checkbox";
|
||||
import Button from "../../Components/Button";
|
||||
import Google from "../../assets/Images/Google.png";
|
||||
import PasswordTextField from "../../Components/TextFields/Password/PasswordTextField";
|
||||
|
||||
import axiosInstance from "../../Utils/axiosConfig";
|
||||
import { loginValidation } from "../../Validation/validation";
|
||||
import { login } from "../../Features/Auth/authSlice";
|
||||
import { useDispatch } from "react-redux";
|
||||
import axios from "axios";
|
||||
const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL;
|
||||
|
||||
const Login = () => {
|
||||
const dispatch = useDispatch();
|
||||
@@ -33,8 +31,8 @@ const Login = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
axios
|
||||
.get(BASE_URL + "/auth/users/admin")
|
||||
axiosInstance
|
||||
.get("/auth/users/admin")
|
||||
.then((response) => {
|
||||
if (response.data.data === false) {
|
||||
navigate("/register");
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
.maintenance-checklist-main {
|
||||
max-width: 350px;
|
||||
min-height: 390px;
|
||||
margin: auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.maintenance-image {
|
||||
width: 280px;
|
||||
height: 150px;
|
||||
background-color: whitesmoke;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.maintenance-title {
|
||||
color: var(--env-var-color-2);
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.checklist-item {
|
||||
font-size: 13px;
|
||||
color: var(--env-var-color-2);
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.checklist-item-text {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.maintenance-checklist-main .maintenance-checklist-button {
|
||||
margin-top: 30px;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import React from "react";
|
||||
import "./index.css";
|
||||
import WindowFrame from "./../../assets/Images/maintenance_window_frame.svg";
|
||||
import { Button } from "@mui/material";
|
||||
import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
|
||||
|
||||
const Maintenance = () => {
|
||||
const maintenanceItems = [
|
||||
{ id: 1, text: "Mark your maintenance periods" },
|
||||
{ id: 2, text: "Eliminate any misunderstandings" },
|
||||
{ id: 3, text: "Stop sending alerts in maintenance windows" },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="maintenance-checklist-main">
|
||||
<img className="maintenance-image" src={WindowFrame} alt="WindowFrame" />
|
||||
<div className="maintenance-title">Create a maintenance window to</div>
|
||||
<div>
|
||||
{maintenanceItems.map((item) => (
|
||||
<div key={item.id} className="checklist-item">
|
||||
<CheckCircleOutlineIcon color="primary" />
|
||||
<div className="checklist-item-text">{item.text}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
className="maintenance-checklist-button"
|
||||
sx={{ textTransform: "none" }}
|
||||
>
|
||||
Let's create your maintenance window
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Maintenance;
|
||||
@@ -1,7 +1,6 @@
|
||||
.monitors,
|
||||
.new-monitor {
|
||||
width: 70vw;
|
||||
padding: 4vw;
|
||||
}
|
||||
|
||||
.monitors {
|
||||
@@ -9,13 +8,13 @@
|
||||
}
|
||||
|
||||
.monitors-bar {
|
||||
margin-top: calc(2 * var(--env-var-spacing-2));
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.monitors-bar-title {
|
||||
color: var(--env-var-color-1);
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@ import { useNavigate } from "react-router-dom";
|
||||
import Button from "../../Components/Button";
|
||||
import ServerStatus from "../../Components/Charts/Servers/ServerStatus";
|
||||
import SearchTextField from "../../Components/TextFields/Search/SearchTextField";
|
||||
import HostsTable from "../../Components/HostsTable";
|
||||
import Pagination from "../../Components/Pagination";
|
||||
import MonitorTable from "../../Components/MonitorTable";
|
||||
import { useTheme } from "@emotion/react";
|
||||
|
||||
const Monitors = () => {
|
||||
const theme = useTheme();
|
||||
const navigate = useNavigate();
|
||||
const monitorState = useSelector((state) => state.monitors);
|
||||
const authState = useSelector((state) => state.auth);
|
||||
@@ -25,9 +26,13 @@ const Monitors = () => {
|
||||
}, 0);
|
||||
|
||||
const down = monitorState.monitors.length - up;
|
||||
|
||||
return (
|
||||
<div className="monitors">
|
||||
<div
|
||||
className="monitors"
|
||||
style={{
|
||||
padding: `${theme.content.pY} ${theme.content.pX}`,
|
||||
}}
|
||||
>
|
||||
<div className="monitors-bar">
|
||||
<div className="monitors-bar-title">
|
||||
Hello, {authState.user.firstname}
|
||||
@@ -38,7 +43,7 @@ const Monitors = () => {
|
||||
onClick={() => {
|
||||
navigate("/monitors/create");
|
||||
}}
|
||||
sx={{ padding: "10px 20px", fontSize: "13px" }}
|
||||
sx={{ padding: "6px 25px", fontSize: "13px" }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -60,10 +65,8 @@ const Monitors = () => {
|
||||
<SearchTextField />
|
||||
</div>
|
||||
</div>
|
||||
<div className="monitors-v-gaping"></div>
|
||||
<HostsTable monitors={monitorState.monitors} />
|
||||
<div className="monitors-v-gaping"></div>
|
||||
<Pagination />
|
||||
<div className="monitors-v-gaping" />
|
||||
<MonitorTable monitors={monitorState.monitors} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
.current-monitors-title-holder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.current-monitors-bar {
|
||||
@@ -18,16 +19,22 @@
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
margin-right: var(--env-var-spacing-1);
|
||||
color: var(--env-var-color-1);
|
||||
}
|
||||
|
||||
.current-monitors-counter {
|
||||
width: var(--env-var-spacing-2);
|
||||
height: var(--env-var-spacing-2);
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 2px;
|
||||
min-width: 22px;
|
||||
min-height: 22px;
|
||||
background-color: var(--env-var-color-15);
|
||||
border: 1px solid var(--env-var-color-6);
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
font-weight: 500;
|
||||
color: var(--env-var-color-5);
|
||||
}
|
||||
|
||||
.monitors-v-gaping {
|
||||
@@ -66,24 +73,6 @@
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
|
||||
.host-list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.host-list-item-open {
|
||||
width: var(--env-var-img-width-2);
|
||||
height: var(--env-var-img-width-2);
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.host-list-item-name {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
font-weight: bold;
|
||||
margin-right: var(--env-var-spacing-1);
|
||||
}
|
||||
|
||||
.host-list-item-precentage {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
@@ -101,13 +90,6 @@
|
||||
padding: calc(var(--env-var-spacing-1) / 2);
|
||||
}
|
||||
|
||||
.host-status-box-circle {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
margin-right: calc(var(--env-var-spacing-1) / 2);
|
||||
}
|
||||
|
||||
.host-actions {
|
||||
margin: auto;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -11,12 +11,9 @@ import Check from "../../Components/Check/Check";
|
||||
import Button from "../../Components/Button";
|
||||
import Google from "../../assets/Images/Google.png";
|
||||
import { registerValidation } from "../../Validation/validation";
|
||||
|
||||
import axiosInstance from "../../Utils/axiosConfig";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { register } from "../../Features/Auth/authSlice";
|
||||
import axios from "axios";
|
||||
|
||||
const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL;
|
||||
|
||||
const Register = () => {
|
||||
const dispatch = useDispatch();
|
||||
@@ -41,8 +38,8 @@ const Register = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
axios
|
||||
.get(BASE_URL + "/auth/users/admin")
|
||||
axiosInstance
|
||||
.get("/auth/users/admin")
|
||||
.then((response) => {
|
||||
if (response.data.data === true) {
|
||||
navigate("/login");
|
||||
|
||||
@@ -8,8 +8,7 @@ import LeftArrow from "../../assets/Images/arrow-left.png";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useState, useEffect } from "react";
|
||||
import { newPasswordValidation } from "../../Validation/validation";
|
||||
import axios from "axios";
|
||||
const BASE_URL = import.meta.env.VITE_APP_API_BASE_URL;
|
||||
import axiosInstance from "../../Utils/axiosConfig";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
const SetNewPassword = () => {
|
||||
@@ -33,10 +32,10 @@ const SetNewPassword = () => {
|
||||
// TODO show loading spinner
|
||||
setIsLoading(true);
|
||||
try {
|
||||
await axios.post(`${BASE_URL}/auth/recovery/validate`, {
|
||||
await axiosInstance.post("/auth/recovery/validate", {
|
||||
recoveryToken: token,
|
||||
});
|
||||
await axios.post(`${BASE_URL}/auth/recovery/reset`, {
|
||||
await axiosInstance.post("/auth/recovery/reset", {
|
||||
...form,
|
||||
recoveryToken: token,
|
||||
});
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import React from 'react'
|
||||
import React from "react";
|
||||
|
||||
const Status = () => {
|
||||
return (
|
||||
<div>Status</div>
|
||||
)
|
||||
}
|
||||
return <div>Status</div>;
|
||||
};
|
||||
|
||||
export default Status
|
||||
export default Status;
|
||||
Reference in new issue
Block a user