diff --git a/changelog.md b/changelog.md index 218d6b1..949c266 100644 --- a/changelog.md +++ b/changelog.md @@ -1,15 +1,20 @@ ## Version 0.12.0 - New Dashboard - New metrics gathering system + - New alerts system + - New notification center + - New events manager - Integrated a new docker-less mode of functioning for networking - Added Button to force reset HTTPS cert in settings - New color slider with reset buttons - - Fixed blinking modals issues + - Added a notification when updating a container - Added lazyloading to URL and Servapp pages images - Added a dangerous IP detector that stops sending HTTP response to IPs that are abusing various shields features - Added a button in the servapp page to easily download the docker backup - Redirect static folder to host if possible - New Homescreen look + - Added option to disable routes without deleting them + - Fixed blinking modals issues - Improve display or icons [fixes #121] - Refactored Mongo connection code [fixes #111] - Forward simultaneously TCP and UDP [fixes #122] diff --git a/client/src/api/metrics.demo.jsx b/client/src/api/metrics.demo.jsx index 10a9c0f..71d28bb 100644 --- a/client/src/api/metrics.demo.jsx +++ b/client/src/api/metrics.demo.jsx @@ -6,6 +6,20 @@ function get() { }); } +function reset() { + return new Promise((resolve, reject) => { + resolve() + }); +} + +// function list() { +// return new Promise((resolve, reject) => { +// resolve() +// }); +// } + export { get, + reset, + // list, }; \ No newline at end of file diff --git a/client/src/api/metrics.jsx b/client/src/api/metrics.jsx index c16ed66..5822023 100644 --- a/client/src/api/metrics.jsx +++ b/client/src/api/metrics.jsx @@ -18,7 +18,17 @@ function reset() { })) } +function list() { + return wrap(fetch('/cosmos/api/list-metrics', { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + }, + })) +} + export { get, reset, + list, }; \ No newline at end of file diff --git a/client/src/api/users.jsx b/client/src/api/users.jsx index 46a2998..323ef22 100644 --- a/client/src/api/users.jsx +++ b/client/src/api/users.jsx @@ -110,6 +110,24 @@ function resetPassword(values) { })) } +function getNotifs() { + return wrap(fetch('/cosmos/api/notifications', { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + }, + })) +} + +function readNotifs(notifs) { + return wrap(fetch('/cosmos/api/notifications/read?ids=' + notifs.join(','), { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + }, + })) +} + export { list, create, @@ -122,4 +140,6 @@ export { check2FA, reset2FA, resetPassword, + getNotifs, + readNotifs, }; \ No newline at end of file diff --git a/client/src/assets/images/wallpaper2.jpg b/client/src/assets/images/wallpaper2.jpg index 149e23e..93b77f3 100644 Binary files a/client/src/assets/images/wallpaper2.jpg and b/client/src/assets/images/wallpaper2.jpg differ diff --git a/client/src/components/delete.jsx b/client/src/components/delete.jsx index ed3601b..362182c 100644 --- a/client/src/components/delete.jsx +++ b/client/src/components/delete.jsx @@ -3,11 +3,13 @@ import { Card, Chip, Stack, Tooltip } from "@mui/material"; import { useState } from "react"; import { useTheme } from '@mui/material/styles'; -export const DeleteButton = ({onDelete}) => { +export const DeleteButton = ({onDelete, disabled}) => { const [confirmDelete, setConfirmDelete] = useState(false); return (<> - {!confirmDelete && (} onClick={() => setConfirmDelete(true)}/>)} - {confirmDelete && (} color="error" onClick={(event) => onDelete(event)}/>)} + {!confirmDelete && (} + onClick={() => !disabled && setConfirmDelete(true)}/>)} + {confirmDelete && (} color="error" + onClick={(event) => !disabled && onDelete(event)}/>)} ); } \ No newline at end of file diff --git a/client/src/components/tabbedView/tabbedView.jsx b/client/src/components/tabbedView/tabbedView.jsx index 8aee043..3070c55 100644 --- a/client/src/components/tabbedView/tabbedView.jsx +++ b/client/src/components/tabbedView/tabbedView.jsx @@ -37,7 +37,7 @@ const a11yProps = (index) => { }; }; -const PrettyTabbedView = ({ tabs, isLoading, currentTab, setCurrentTab, fullwidth }) => { +const PrettyTabbedView = ({ tabs, isLoading, currentTab, setCurrentTab }) => { const [value, setValue] = useState(0); const isMobile = useMediaQuery((theme) => theme.breakpoints.down('md')); @@ -55,8 +55,8 @@ const PrettyTabbedView = ({ tabs, isLoading, currentTab, setCurrentTab, fullwidt }; return ( - - {(isMobile && !currentTab) ? ( + + {(isMobile) ? (