@@ -103,6 +108,7 @@ SettingsAccountDesktopItem.propTypes = {
canEdit: PropTypes.bool,
description: PropTypes.string,
customButton: PropTypes.element,
+ permissionLevel: PropTypes.number,
};
export default observer(SettingsAccountDesktopItem);
diff --git a/app/components/settings/account/item/mobile.jsx b/app/components/settings/account/item/mobile.jsx
index 7fbe1dde..e339c135 100644
--- a/app/components/settings/account/item/mobile.jsx
+++ b/app/components/settings/account/item/mobile.jsx
@@ -39,6 +39,7 @@ const SettingsAccountMobileItem = ({
id,
canEdit,
fontColor,
+ permissionLevel,
...props
}) => {
const {
@@ -46,6 +47,10 @@ const SettingsAccountMobileItem = ({
modalStore: { openModal, closeModal },
} = useContextStore();
+ if (permissionLevel && permissionLevel < user.permission) {
+ return null;
+ }
+
const color = !fontColor ? {} : { color: `var(--${fontColor}-700)` };
return (
@@ -88,6 +93,7 @@ SettingsAccountMobileItem.propTypes = {
id: PropTypes.string.isRequired,
canEdit: PropTypes.bool,
fontColor: PropTypes.string,
+ permissionLevel: PropTypes.number,
};
export default observer(SettingsAccountMobileItem);
diff --git a/app/pages/error.jsx b/app/pages/error.jsx
index 41a3ff99..c30377c4 100644
--- a/app/pages/error.jsx
+++ b/app/pages/error.jsx
@@ -1,4 +1,4 @@
-import './error.scss';
+import '../styles/pages/error.scss';
// import dependencies
import { useNavigate } from 'react-router-dom';
diff --git a/app/pages/home.jsx b/app/pages/home.jsx
index 3dae0152..e44c979c 100644
--- a/app/pages/home.jsx
+++ b/app/pages/home.jsx
@@ -1,5 +1,5 @@
// import styles
-import './home.scss';
+import '../styles/pages/home.scss';
// import dependencies
import { useState } from 'react';
@@ -15,6 +15,7 @@ import useContextStore from '../context';
import HomeMenu from '../components/home/menu';
import MonitorTable from '../components/home/monitor/layout/table';
import useLocalStorageContext from '../hooks/useLocalstorage';
+import MonitorCompactItem from '../components/home/monitor/layout/compact/monitor';
const Home = () => {
const {
@@ -23,6 +24,7 @@ const Home = () => {
const [search, setSearch] = useState('');
const { layout, status, setStatus } = useLocalStorageContext();
+ const [activeMonitor, setActiveMonitor] = useState('');
const handleReset = () => {
setSearch('');
@@ -63,7 +65,12 @@ const Home = () => {
if (layout === 'compact') {
return (
-
+
);
}
@@ -84,6 +91,22 @@ const Home = () => {
);
}
+ if (layout === 'compact') {
+ return (
+
+ setSearch(e.target.value)}
+ />
+
+
+ {monitorsList}
+
+
+ );
+ }
+
return (
{
setSearch={(e) => setSearch(e.target.value)}
/>
- {monitorsList}
+ {monitorsList}
);
};
diff --git a/app/pages/login.jsx b/app/pages/login.jsx
index 6b16330a..544df210 100644
--- a/app/pages/login.jsx
+++ b/app/pages/login.jsx
@@ -1,4 +1,4 @@
-import './register.scss';
+import '../styles/pages/register.scss';
// import dependencies
import { useNavigate } from 'react-router-dom';
diff --git a/app/pages/monitor.jsx b/app/pages/monitor.jsx
index c7120216..18db867c 100644
--- a/app/pages/monitor.jsx
+++ b/app/pages/monitor.jsx
@@ -1,6 +1,7 @@
-import './monitor.scss';
+import '../styles/pages/monitor.scss';
// import dependencies
+import PropTypes from 'prop-types';
import { observer } from 'mobx-react-lite';
// import local files
@@ -12,13 +13,13 @@ import useContextStore from '../context';
import MonitorMenu from '../components/monitor/menu';
import { useParams } from 'react-router-dom';
-const Monitor = () => {
+const Monitor = ({ monitor_id }) => {
const {
globalStore: { getMonitor },
} = useContextStore();
const query = useParams();
- const monitorId = query['monitor_id'];
+ const monitorId = query['monitor_id'] || monitor_id;
const monitor = getMonitor(monitorId);
@@ -39,4 +40,8 @@ const Monitor = () => {
Monitor.displayName = 'MonitorPage';
+Monitor.propTypes = {
+ monitor_id: PropTypes.string,
+};
+
export default observer(Monitor);
diff --git a/app/pages/notifications.jsx b/app/pages/notifications.jsx
index bcef0228..409f7413 100644
--- a/app/pages/notifications.jsx
+++ b/app/pages/notifications.jsx
@@ -1,5 +1,5 @@
// import styles
-import './notifications.scss';
+import '../styles/pages/notifications.scss';
// import dependencies
import { observer } from 'mobx-react-lite';
diff --git a/app/pages/register.jsx b/app/pages/register.jsx
index 87a50d8e..0afeba46 100644
--- a/app/pages/register.jsx
+++ b/app/pages/register.jsx
@@ -1,4 +1,4 @@
-import './register.scss';
+import '../styles/pages/register.scss';
// import dependencies
import { useNavigate } from 'react-router-dom';
diff --git a/app/pages/settings.jsx b/app/pages/settings.jsx
index 6fa8cab1..48f93d98 100644
--- a/app/pages/settings.jsx
+++ b/app/pages/settings.jsx
@@ -1,4 +1,4 @@
-import './settings.scss';
+import '../styles/pages/settings.scss';
// import dependencies
import { useEffect, useState } from 'react';
diff --git a/app/pages/verify.jsx b/app/pages/verify.jsx
index c6474bed..7f556bde 100644
--- a/app/pages/verify.jsx
+++ b/app/pages/verify.jsx
@@ -1,4 +1,4 @@
-import './verify.scss';
+import '../styles/pages/verify.scss';
import { StatusLogo } from '../components/icons';
diff --git a/app/pages/error.scss b/app/styles/pages/error.scss
similarity index 94%
rename from app/pages/error.scss
rename to app/styles/pages/error.scss
index 5764586a..edf1eec1 100644
--- a/app/pages/error.scss
+++ b/app/styles/pages/error.scss
@@ -1,4 +1,4 @@
-@use '../styles/breakpoints.scss' as *;
+@use '../breakpoints.scss' as *;
.error-page-container {
display: flex;
diff --git a/app/pages/home.scss b/app/styles/pages/home.scss
similarity index 84%
rename from app/pages/home.scss
rename to app/styles/pages/home.scss
index ce11de15..428907fc 100644
--- a/app/pages/home.scss
+++ b/app/styles/pages/home.scss
@@ -1,4 +1,4 @@
-@use '../styles/pxToRem.scss' as *;
+@use '../pxToRem.scss' as *;
.home-container {
display: flex;
diff --git a/app/pages/monitor.scss b/app/styles/pages/monitor.scss
similarity index 77%
rename from app/pages/monitor.scss
rename to app/styles/pages/monitor.scss
index a5a74c39..f065bfb2 100644
--- a/app/pages/monitor.scss
+++ b/app/styles/pages/monitor.scss
@@ -1,4 +1,4 @@
-@use '../styles/pxToRem.scss' as *;
+@use '../pxToRem.scss' as *;
.monitor-container {
display: flex;
diff --git a/app/pages/notifications.scss b/app/styles/pages/notifications.scss
similarity index 100%
rename from app/pages/notifications.scss
rename to app/styles/pages/notifications.scss
diff --git a/app/pages/register.scss b/app/styles/pages/register.scss
similarity index 98%
rename from app/pages/register.scss
rename to app/styles/pages/register.scss
index 805cdc97..56fe2e45 100644
--- a/app/pages/register.scss
+++ b/app/styles/pages/register.scss
@@ -1,4 +1,4 @@
-@use '../styles/pxToRem.scss' as *;
+@use '../pxToRem.scss' as *;
.auth-form-container {
width: 100vw;
diff --git a/app/pages/settings.scss b/app/styles/pages/settings.scss
similarity index 94%
rename from app/pages/settings.scss
rename to app/styles/pages/settings.scss
index ed66681f..73b1d3bc 100644
--- a/app/pages/settings.scss
+++ b/app/styles/pages/settings.scss
@@ -1,5 +1,5 @@
-@use '../styles/pxToRem.scss' as *;
-@use '../styles/breakpoints.scss' as *;
+@use '../pxToRem.scss' as *;
+@use '../breakpoints.scss' as *;
.settings-content {
display: flex;
diff --git a/app/pages/verify.scss b/app/styles/pages/verify.scss
similarity index 100%
rename from app/pages/verify.scss
rename to app/styles/pages/verify.scss
diff --git a/package.json b/package.json
index 2c24f6d9..58a0ba15 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "lunalytics",
- "version": "0.6.2",
+ "version": "0.6.3",
"description": "Open source Node.js server/website monitoring tool",
"private": true,
"author": "KSJaay
",