fix: disabled open site option for ping type monitors
This commit is contained in:
1 parent
02668aeb08
commit
fce178f792
1 file changed
+17
-10
@@ -120,12 +120,11 @@ const Monitors = () => {
|
|||||||
};
|
};
|
||||||
const closeMenu = () => {
|
const closeMenu = () => {
|
||||||
setAnchorEl(null);
|
setAnchorEl(null);
|
||||||
setActions({});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const openRemove = () => {
|
const openRemove = () => {
|
||||||
setAnchorEl(null);
|
closeMenu();
|
||||||
setIsOpen(true);
|
setIsOpen(true);
|
||||||
};
|
};
|
||||||
const handleRemove = async (event) => {
|
const handleRemove = async (event) => {
|
||||||
@@ -220,7 +219,11 @@ const Monitors = () => {
|
|||||||
aria-label="monitor actions"
|
aria-label="monitor actions"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
openMenu(event, monitor._id, monitor.url);
|
openMenu(
|
||||||
|
event,
|
||||||
|
monitor._id,
|
||||||
|
monitor.type === "ping" ? null : monitor.url
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
"&:focus": {
|
"&:focus": {
|
||||||
@@ -326,13 +329,17 @@ const Monitors = () => {
|
|||||||
open={Boolean(anchorEl)}
|
open={Boolean(anchorEl)}
|
||||||
onClose={closeMenu}
|
onClose={closeMenu}
|
||||||
>
|
>
|
||||||
<MenuItem
|
{actions.url !== null ? (
|
||||||
onClick={() => {
|
<MenuItem
|
||||||
window.open(actions.url, "_blank", "noreferrer");
|
onClick={() => {
|
||||||
}}
|
window.open(actions.url, "_blank", "noreferrer");
|
||||||
>
|
}}
|
||||||
Open site
|
>
|
||||||
</MenuItem>
|
Open site
|
||||||
|
</MenuItem>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
<MenuItem onClick={() => navigate(`/monitors/${actions.id}`)}>
|
<MenuItem onClick={() => navigate(`/monitors/${actions.id}`)}>
|
||||||
Details
|
Details
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|||||||
Reference in new issue
Block a user