Skip to content

Commit

Permalink
Adds UX for status page configure
Browse files Browse the repository at this point in the history
  • Loading branch information
KSJaay committed Jan 29, 2025
1 parent b87bbc1 commit 8bb8802
Show file tree
Hide file tree
Showing 99 changed files with 6,601 additions and 105 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

![Demo](https://raw.githubusercontent.com/KSJaay/Lunalytics/refs/heads/main/docs/public/demo.gif)

## Features
## 📔 Features

- Easy to self-host
- Monitor uptime for HTTP(s)/TCP
- Support for multiple users
- Fully customisable status/dashboard pages
- Role based access control
- Clean and easy to use UX/UI
- Customizable themes/colors
- Customizable user profiles
- Customizable user profiles/themes/colors
- Support for notifications
- Discord
- Slack
Expand All @@ -39,7 +39,7 @@

Make sure you have the following applications installed before starting:

- [Nodejs](https://nodejs.org/en/download/) (v18 or higher)
- [Nodejs](https://nodejs.org/en/download/) (v20 or higher)
- Npm or [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable)
- [Git](https://git-scm.com/)

Expand Down Expand Up @@ -99,6 +99,11 @@ pm2 monit
- [ ] Add support for more notification services
- [ ] Better role based access control

## ⭐ Help us grow

- Add a star to the project if you like it!
- [AlternativeTo](https://alternativeto.net/software/lunalytics/about/)

## 📖 Backstory

There's a lot of monitoring applications out there and I personally love using uptime-kuma. But, one of the main issues with Uptime-kuma is the ability to share with my friends/colleagues. And for the services that do allow me to share with others, they either have an outdated UI from the 90s or are so expensive I can't justify paying for it.
Expand Down
20 changes: 17 additions & 3 deletions app/components/icons/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BsTable } from 'react-icons/bs';
import { BsBroadcast, BsTable } from 'react-icons/bs';
import {
FaChevronDown,
FaChevronLeft,
Expand All @@ -11,6 +11,7 @@ import {
FaSignOutAlt,
FaUsers,
FaClone,
FaClock,
} from 'react-icons/fa';
import { FiLayout } from 'react-icons/fi';
import { HiStatusOffline, HiStatusOnline } from 'react-icons/hi';
Expand All @@ -27,11 +28,19 @@ import {
FaPause,
FaPlay,
} from 'react-icons/fa6';
import { IoArrowBack, IoColorPalette, IoGrid, IoReload } from 'react-icons/io5';
import { RiStackFill } from 'react-icons/ri';
import {
IoArrowBack,
IoColorPalette,
IoGrid,
IoReload,
IoWarning,
} from 'react-icons/io5';
import { RiStackFill, RiIndeterminateCircleFill } from 'react-icons/ri';
import StatusLogo from './statusLogo';
import { PiBroadcast, PiDotsSixVerticalBold } from 'react-icons/pi';

export {
BsBroadcast,
BsTable,
FaBars,
FaCheck,
Expand All @@ -40,6 +49,7 @@ export {
FaChevronRight,
FaChevronUp,
FaCircleCheck,
FaClock,
FaClone,
FaCog,
FaEllipsisVertical,
Expand All @@ -63,10 +73,14 @@ export {
IoMdEyeOff,
IoMdHelpCircle,
IoReload,
IoWarning,
LiaSyncSolid,
MdEdit,
MdErrorOutline,
MdNotifications,
PiBroadcast,
PiDotsSixVerticalBold,
RiIndeterminateCircleFill,
RiStackFill,
StatusLogo,
};
5 changes: 0 additions & 5 deletions app/components/modal/notification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import useNotificationForm from '../../../hooks/useNotificationForm';
import NotificationModalPayload from './payload';
import * as inputForPlatform from './platform';

// Notification types
// - Up and running
// - Application went down
// - Warning (If the monitor goes down once it shows a warning, else throw error)

const NotificationModal = ({ values, isEdit, closeModal, addNotification }) => {
const { inputs, errors, handleInput, handleSubmit } = useNotificationForm(
values,
Expand Down
133 changes: 133 additions & 0 deletions app/components/modal/status/configure/add.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import './add.scss';

// import dependencies
import PropTypes from 'prop-types';
import { MdHistory } from 'react-icons/md';
import { BsGraphUp } from 'react-icons/bs';
import { IoWarning } from 'react-icons/io5';
import { PiBroadcast } from 'react-icons/pi';
import { FaSignal, FaHtml5, FaCss3Alt } from 'react-icons/fa';
import { TbLayoutNavbarInactive } from 'react-icons/tb';

// import local files
import Modal from '../../../ui/modal';
import classNames from 'classnames';
import { useState } from 'react';

const components = [
{
name: 'Header',
icon: (size) => (
<TbLayoutNavbarInactive
style={{ width: `${size}px`, height: `${size}px` }}
/>
),
type: 'header',
},
{
name: 'Status',
icon: (size) => (
<PiBroadcast style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'status',
},
{
name: 'Incidents',
icon: (size) => (
<IoWarning style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'incidents',
},
{
name: 'Uptime',
icon: (size) => (
<FaSignal style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'uptime',
},
{
name: 'Metrics',
icon: (size) => (
<BsGraphUp style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'metrics',
},
{
name: 'History',
icon: (size) => (
<MdHistory style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'history',
},
{
name: 'Custom HTML',
icon: (size) => (
<FaHtml5 style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'customHTML',
},
{
name: 'Custom CSS',
icon: (size) => (
<FaCss3Alt style={{ width: `${size}px`, height: `${size}px` }} />
),
type: 'customCSS',
},
];

const StatusConfigureAddModal = ({ closeModal, createComponent }) => {
const [activeComponent, setActiveComponent] = useState(null);

return (
<Modal.Container closeButton={closeModal}>
<Modal.Title style={{ textAlign: 'center', fontSize: 'var(--font-xl)' }}>
Add New Component
</Modal.Title>
<Modal.Message>
<div className="scma-container">
{components.map((component) => {
const classes = classNames('scma-item', {
active: component.type === activeComponent,
});

return (
<div
key={component.name}
className={classes}
onClick={() => {
setActiveComponent(component.type);
}}
>
<div className="scma-item-icon">{component.icon(28)}</div>
<div className="scma-item-name">{component.name}</div>
</div>
);
})}
</div>
</Modal.Message>

<Modal.Actions>
<Modal.Button onClick={closeModal}>Close</Modal.Button>
<Modal.Button
color="green"
id="monitor-create-button"
onClick={() => {
createComponent(activeComponent);
closeModal();
}}
>
Add
</Modal.Button>
</Modal.Actions>
</Modal.Container>
);
};

StatusConfigureAddModal.displayName = 'StatusConfigureAddModal';

StatusConfigureAddModal.propTypes = {
closeModal: PropTypes.func.isRequired,
createComponent: PropTypes.func.isRequired,
};

export default StatusConfigureAddModal;
43 changes: 43 additions & 0 deletions app/components/modal/status/configure/add.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// status-configure-modal-add > scma

.scma-container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 10px;
margin: 20px 0px 10px 0px;
}

.scma-item {
display: flex;
align-items: center;
justify-content: center;
border: 2px solid var(--accent-700);
padding: 10px;
cursor: pointer;
flex-direction: column;
border-radius: 12px;
transition: all 0.2s ease-in-out;

&:hover {
transition: all 0.2s ease-in-out;
border-color: var(--primary-700);

.scma-item-icon {
transition: all 0.2s ease-in-out;
color: var(--primary-700);
}
}

&.active {
border-color: var(--primary-700);

.scma-item-icon {
color: var(--primary-700);
}
}
}

.scma-item-name {
font-size: var(--font-md);
color: var(--font-color);
}
Loading

0 comments on commit 8bb8802

Please sign in to comment.