ts
This commit is contained in:
1 parent
bda3a7e91c
commit
b4e4ec1110
6 files changed
+12
-18
No files matched your search
+2
-3
@@ -7,7 +7,6 @@ import { useAppSelector } from "./hooks/AppHooks";
|
|||||||
import { BrowserRouter } from "react-router-dom";
|
import { BrowserRouter } from "react-router-dom";
|
||||||
import { AuthVerifier } from "@/components/auth-verifier";
|
import { AuthVerifier } from "@/components/auth-verifier";
|
||||||
import { ToastContainer } from "react-toastify";
|
import { ToastContainer } from "react-toastify";
|
||||||
import { colors } from "@/theme/palette";
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const mode = useAppSelector((state) => state.ui.mode);
|
const mode = useAppSelector((state) => state.ui.mode);
|
||||||
@@ -26,8 +25,8 @@ function App() {
|
|||||||
theme={mode}
|
theme={mode}
|
||||||
style={
|
style={
|
||||||
{
|
{
|
||||||
"--toastify-color-progress-light": colors.blueGray450,
|
"--toastify-color-progress-light": "#7C8BA1",
|
||||||
"--toastify-color-progress-dark": colors.blueGray450,
|
"--toastify-color-progress-dark": "#7C8BA1",
|
||||||
} as React.CSSProperties
|
} as React.CSSProperties
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Stack from "@mui/material/Stack";
|
|||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import { lighten, darken } from "@mui/material/styles";
|
import { lighten } from "@mui/material/styles";
|
||||||
import useMediaQuery from "@mui/material/useMediaQuery";
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||||
import type { PaletteKey } from "@/theme/theme";
|
import type { PaletteKey } from "@/theme/theme";
|
||||||
import { BaseBox, TooltipWithInfo } from "@/components/design-elements";
|
import { BaseBox, TooltipWithInfo } from "@/components/design-elements";
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import Menu from "@mui/material/Menu";
|
|||||||
import MenuItem from "@mui/material/MenuItem";
|
import MenuItem from "@mui/material/MenuItem";
|
||||||
import type { ButtonGroupProps } from "@mui/material/ButtonGroup";
|
import type { ButtonGroupProps } from "@mui/material/ButtonGroup";
|
||||||
import { ChevronDown } from "lucide-react";
|
import { ChevronDown } from "lucide-react";
|
||||||
import { useTheme } from "@mui/material/styles";
|
|
||||||
|
|
||||||
export const ButtonGroupInput: React.FC<ButtonGroupProps> = ({
|
export const ButtonGroupInput: React.FC<ButtonGroupProps> = ({
|
||||||
orientation,
|
orientation,
|
||||||
@@ -14,7 +13,6 @@ export const ButtonGroupInput: React.FC<ButtonGroupProps> = ({
|
|||||||
...props
|
...props
|
||||||
}) => {
|
}) => {
|
||||||
const isVertical = orientation === "vertical";
|
const isVertical = orientation === "vertical";
|
||||||
const theme = useTheme();
|
|
||||||
|
|
||||||
if (!isVertical) {
|
if (!isVertical) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { useMemo, useState } from "react";
|
|||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import { Tooltip } from "@/components/design-elements";
|
import { Tooltip } from "@/components/design-elements";
|
||||||
import { config } from "@/config/index";
|
import { config } from "@/config/index";
|
||||||
|
const ENV_VAR = import.meta.env.VITE_APP_DEPLOYMENT_MODE;
|
||||||
const DEPLOYMENT_MODE = config.DEPLOYMENT_MODE;
|
const DEPLOYMENT_MODE = config.DEPLOYMENT_MODE;
|
||||||
const IS_SAAS = DEPLOYMENT_MODE === "saas";
|
const IS_SAAS = DEPLOYMENT_MODE === "saas";
|
||||||
|
|
||||||
@@ -32,12 +33,13 @@ export const SettingsSwitch = () => {
|
|||||||
handleClose();
|
handleClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
const user = useAppSelector((state) => state.auth.user);
|
const user = useAppSelector((state: any) => state.auth.user);
|
||||||
|
|
||||||
const orgPermissions = user?.org?.permissions || [];
|
const orgPermissions = user?.org?.permissions || [];
|
||||||
// Normalize and memoize permissions for robust checks
|
// Normalize and memoize permissions for robust checks
|
||||||
const perms = useMemo(
|
const perms = useMemo(
|
||||||
() => orgPermissions.map((p) => (p ?? "").toString().trim().toLowerCase()),
|
() =>
|
||||||
|
orgPermissions.map((p: any) => (p ?? "").toString().trim().toLowerCase()),
|
||||||
[orgPermissions]
|
[orgPermissions]
|
||||||
);
|
);
|
||||||
const hasTeamEdit =
|
const hasTeamEdit =
|
||||||
@@ -64,6 +66,8 @@ export const SettingsSwitch = () => {
|
|||||||
[perms]
|
[perms]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log("ENV VAR: ", ENV_VAR);
|
||||||
|
console.log("DEPLOYMENT_MODE: ", DEPLOYMENT_MODE);
|
||||||
console.log("Show billing: ", showBilling);
|
console.log("Show billing: ", showBilling);
|
||||||
console.log(JSON.stringify(perms, null, 2));
|
console.log(JSON.stringify(perms, null, 2));
|
||||||
console.log("IS_SAAS: ", IS_SAAS);
|
console.log("IS_SAAS: ", IS_SAAS);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export const ChecksTable = ({
|
|||||||
const headers: Header<CheckWithMonitor>[] = [
|
const headers: Header<CheckWithMonitor>[] = [
|
||||||
{
|
{
|
||||||
id: "monitorName",
|
id: "monitorName",
|
||||||
content: "Monitor name",
|
content: t("incidentsTableMonitorName"),
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
return row.metadata?.monitorId?.name || "N/A";
|
return row.metadata?.monitorId?.name || "N/A";
|
||||||
},
|
},
|
||||||
@@ -102,13 +102,7 @@ export const ChecksTable = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Table
|
<Table headers={headers} data={checks} />
|
||||||
headers={headers}
|
|
||||||
data={checks}
|
|
||||||
onRowClick={(row) => {
|
|
||||||
alert("not yet");
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Pagination
|
<Pagination
|
||||||
component="div"
|
component="div"
|
||||||
count={count}
|
count={count}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {
|
|||||||
DownStatusBox,
|
DownStatusBox,
|
||||||
PausedStatusBox,
|
PausedStatusBox,
|
||||||
InfoBox,
|
InfoBox,
|
||||||
LoadingSpinner,
|
|
||||||
} from "@/components/design-elements";
|
} from "@/components/design-elements";
|
||||||
import { HeaderFilter } from "@/components/monitors";
|
import { HeaderFilter } from "@/components/monitors";
|
||||||
import { HeaderCreate } from "@/components/common";
|
import { HeaderCreate } from "@/components/common";
|
||||||
@@ -138,7 +137,7 @@ const UptimeMonitors = () => {
|
|||||||
entitlement="monitorsMax"
|
entitlement="monitorsMax"
|
||||||
entitlementCount={count}
|
entitlementCount={count}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack direction={isSmall ? "column" : "row"} gap={theme.spacing(8)}>
|
<Stack direction={isSmall ? "column" : "row"} gap={theme.spacing(8)}>
|
||||||
<UpStatusBox n={upCount} />
|
<UpStatusBox n={upCount} />
|
||||||
<DownStatusBox n={downCount} />
|
<DownStatusBox n={downCount} />
|
||||||
|
|||||||
Reference in new issue
Block a user