use demo role to show/hide features
This commit is contained in:
1 parent
63da8bd571
commit
7f9950b9e5
5 files changed
+16
-13
No files matched your search
@@ -92,7 +92,8 @@ function Sidebar() {
|
|||||||
const [popup, setPopup] = useState();
|
const [popup, setPopup] = useState();
|
||||||
const { user } = useSelector((state) => state.auth);
|
const { user } = useSelector((state) => state.auth);
|
||||||
|
|
||||||
if (!user.role.includes("superadmin")) {
|
// Remove demo password if demo
|
||||||
|
if (user.role.includes("demo")) {
|
||||||
menu[3].nested = menu[3].nested.filter((item) => {
|
menu[3].nested = menu[3].nested.filter((item) => {
|
||||||
return item.name !== "Password";
|
return item.name !== "Password";
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ const ProfilePanel = () => {
|
|||||||
borderColor: theme.palette.border.light,
|
borderColor: theme.palette.border.light,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{user.role.includes("superadmin") && (
|
{!user.role.includes("demo") && (
|
||||||
<Box component="form" noValidate spellCheck="false">
|
<Box component="form" noValidate spellCheck="false">
|
||||||
<Box mb={theme.spacing(6)}>
|
<Box mb={theme.spacing(6)}>
|
||||||
<Typography component="h1">Delete account</Typography>
|
<Typography component="h1">Delete account</Typography>
|
||||||
|
|||||||
@@ -24,9 +24,11 @@ const Account = ({ open = "profile" }) => {
|
|||||||
};
|
};
|
||||||
const { user } = useSelector((state) => state.auth);
|
const { user } = useSelector((state) => state.auth);
|
||||||
|
|
||||||
let tabList = ["Profile", "Team"];
|
let tabList = ["Profile", "Team", "Password"];
|
||||||
if (user.role.includes("superadmin")) {
|
|
||||||
tabList.push("Password");
|
// Remove passwrod for demo
|
||||||
|
if (user.role.includes("demo")) {
|
||||||
|
tabList = tabList.filter((tab) => tab !== "Password");
|
||||||
}
|
}
|
||||||
const requiredRoles = ["superadmin", "admin"];
|
const requiredRoles = ["superadmin", "admin"];
|
||||||
const hideTeams = !requiredRoles.some((role) => user.role.includes(role));
|
const hideTeams = !requiredRoles.some((role) => user.role.includes(role));
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";
|
|||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { logger } from "../../Utils/Logger";
|
import { logger } from "../../Utils/Logger";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
const DEMO = import.meta.env.VITE_APP_DEMO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the initial landing page.
|
* Displays the initial landing page.
|
||||||
@@ -327,8 +328,8 @@ const Login = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [form, setForm] = useState({
|
const [form, setForm] = useState({
|
||||||
email: "uptimedemo@demo.com",
|
email: DEMO !== undefined ? "uptimedemo@demo.com" : "",
|
||||||
password: "Demouser1!",
|
password: DEMO !== undefined ? "Demouser1!" : "",
|
||||||
});
|
});
|
||||||
const [errors, setErrors] = useState({});
|
const [errors, setErrors] = useState({});
|
||||||
const [step, setStep] = useState(0);
|
const [step, setStep] = useState(0);
|
||||||
|
|||||||
@@ -10,11 +10,9 @@
|
|||||||
|
|
||||||
<p align="center"><strong>An open source server monitoring application</strong></p>
|
<p align="center"><strong>An open source server monitoring application</strong></p>
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
(yes, we have a light theme as well, but this looks better on readme.md)
|
(yes, we have a light theme as well, but this looks better on readme.md)
|
||||||
|
|
||||||
|
|
||||||
BlueWave Uptime is an open source server monitoring application used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.
|
BlueWave Uptime is an open source server monitoring application used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -214,10 +212,11 @@ That's it, the application is ready to use on port 80.
|
|||||||
|
|
||||||
##### Environmental Variables <a id="env-vars-client"></a>
|
##### Environmental Variables <a id="env-vars-client"></a>
|
||||||
|
|
||||||
| ENV Variable Name | Required/Optional | Type | Description | Accepted Values |
|
| ENV Variable Name | Required/Optional | Type | Description | Accepted Values |
|
||||||
| --------------------- | ----------------- | -------- | ------------------ | ---------------------------------- |
|
| --------------------- | ----------------- | --------- | ------------------ | ---------------------------------- |
|
||||||
| VITE_APP_API_BASE_URL | Required | `string` | Base URL of server | {host}/api/v1 |
|
| VITE_APP_API_BASE_URL | Required | `string` | Base URL of server | {host}/api/v1 |
|
||||||
| VITE_APP_LOG_LEVEL | Optional | `string` | Log level | `"none"`\|`"error"` \| `"warn"` \| |
|
| VITE_APP_LOG_LEVEL | Optional | `string` | Log level | `"none"`\|`"error"` \| `"warn"` \| |
|
||||||
|
| VITE_APP_DEMO | Optional | `boolean` | Demo server or not | `true`\|`false` \| |
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user