- Update JSDoc

This commit is contained in:
Shemy Gan committed 2024-12-30 13:52:22 -05:00
1 parent d8da182f60
commit 1206451989
6 files changed
+49 -3

No files matched your search

@@ -100,3 +100,8 @@ export const ServerEndAdornment = ({ id, removeItem }) => {
</InputAdornment>
);
};
ServerEndAdornment.propTypes = {
id: PropTypes.string.isRequired,
removeItem: PropTypes.func.isRequired,
};
@@ -2,7 +2,17 @@ import { ServerStartAdornment, ServerEndAdornment } from "../../../../Inputs/Tex
import Search from "../../../../Inputs/Search";
import {useState} from "react"
const Server = ({ id, removeItem, onChange, monitors, value, label }) => {
/**
*
* @param {*} id The Id of the Server component
* @param {*} removeItem The function used to remove a single server
* @param {*} onChange The Change handler function to handle when the server value is changed
* used to update the server(monitor) lists
* @param {*} monitors The server monitors options
* @param {*} value the option label of the server/monitor, namely the monitor name field
* @returns
*/
const Server = ({ id, removeItem, onChange, monitors, value }) => {
const [search, setSearch] = useState("");
const handleSearch = (val) => {
setSearch(val);
@@ -5,6 +5,11 @@ import Card from "@mui/material/Card";
import Server from "./Server"
import { CardContent } from "@mui/material";
/**
* CustomCard is a React Forward Ref component that
* passes properties to its wrapped component with
* ref that carrys the drag and drop feature etc
*/
const CustomCard = React.forwardRef((props, ref) => (
<Card ref={ref}>
<CardContent>
@@ -19,6 +24,19 @@ const CustomCard = React.forwardRef((props, ref) => (
</Card>
));
/**
* @param {*} id The Id of the Server component
* @param {*} index The index of the Card in its natural order of placement
* @param {*} moveCard The function to actually move a card
* @param {*} removeCard The function to remote the card
* @param {*} onChange The Change handler function to handle when the server value is changed
* used to update the server(monitor) lists
* @param {*} monitors The server monitors options
* @param {*} value the option label of the server/monitor, namely the monitor name field
* @returns The Card component representing a singler server/monitor that is capable of being
* dragged and droped
*/
const MyCard = ({ id, index, moveCard, removeCard, value, onChange, monitors }) => {
const ref = useRef(null);
const [, drop] = useDrop({
@@ -11,6 +11,12 @@ import { logger } from "../../../Utils/Logger"
import { createToast } from "../../../Utils/toastUtils";
import { networkService } from "../../../main";
/**
* Content Panel is used to compose the second part of the status page
* for the servers/monitors to watch for in its public page presence and some
* other server related configurations etc
*
*/
const ContentPanel = () => {
const theme = useTheme();
const { form, setForm, errors, setErrors } = useContext(StatusFormContext);
@@ -18,6 +18,10 @@ import ImageIcon from "@mui/icons-material/Image";
import { HttpAdornment } from "../../Inputs/TextInput/Adornments";
import { StatusFormContext } from "../../../Pages/Status/CreateStatusContext";
/**
* General settings panel is ued to compose part of the public static page
* for general informations like company name, subdomain url, logo and color etc
*/
const GeneralSettingsPanel = () => {
const theme = useTheme();
const [logo, setLogo] = useState();
+5 -2
View File
@@ -6,9 +6,13 @@ import CreateStatus from "./CreateStatus";
import { useEffect, useState } from "react";
import { networkService } from "../../main";
import { useSelector } from "react-redux";
import { createToast } from "../../Utils/toastUtils"
import { logger } from "../../Utils/Logger";
/**
* The configuration page for public page that contains a general settings and
* content tabs, It will display a static page if there is no status page configured
* or the status page if one is already configured
*/
const Status = () => {
const theme = useTheme();
const navigate = useNavigate();
@@ -23,7 +27,6 @@ const Status = () => {
if(res && res.data)
setInitForm( res.data.data)
}catch (error) {
createToast({ body: "Failed to fetch status page data" });
logger.error("Failed to fetch status page", error);
}