Fix Open Site action for internal monitors#3511
Fix Open Site action for internal monitors#3511ZeinebMegaadi wants to merge 3 commits intobluewave-labs:developfrom
Conversation
ajhollid
left a comment
There was a problem hiding this comment.
On further thought, I don't think the premise of this change is really correct.
If my client and server are both running on the same machine, which is not an unreasonable setup, I may indeed want to open internal URLs in my browser.
I think the only discriminant for opening URLs in the browser should be to exclude types that don't display anything useful in the browser, like docker monitors or infrastrucutre monitors.
|
That makes sense yeah, thanks for the clarification! |
Yeah I understand the intent behind it, but let's keep it flexible since we don't want to assume too much about the user's setup 👍 Sounds like you've got it in hand, we'll get this merged in when the changes are pushed. Thanks for working on the project! |
|
Is this better? |
ajhollid
left a comment
There was a problem hiding this comment.
Change looks good, but is incomplete. Here is the full list of montior types:
export const MonitorTypes = ["http", "ping", "pagespeed", "hardware", "docker", "port", "game", "grpc", "websocket", "unknown"] as const;
Let's figure out which ones should be in the non browser type or not.
| import type { ActionMenuItem } from "@/Components/actions-menu"; | ||
| import type { RootState } from "@/Types/state"; | ||
|
|
||
| const NON_BROWSER_TYPES = ["hardware", "docker"]; |
There was a problem hiding this comment.
What about other non-browser types like gRPC, Docker, etc? I don't know exactly which ones are not browser-friendly, but at least some of them are not.
There was a problem hiding this comment.
Good point. I initially only included hardware and docker, but you're right that other types like gRPC and port-based checks are also not browser-friendly. Also I'm assuming that ping (ICMP) isn’t browser-compatible and game likely uses non-HTTP protocols, but I want to confirm before adding them.
| import type { ActionMenuItem } from "@/Components/actions-menu"; | ||
| import type { RootState } from "@/Types/state"; | ||
|
|
||
| const NON_BROWSER_TYPES = ["hardware", "docker"]; |
There was a problem hiding this comment.
This should be types as an Array<MonitorType>. We want type safety everywhere
|
Closing as inactive |
Describe your changes
Fixed the "Open Site" action in the monitor actions menu to prevent opening internal/private endpoints that are not accessible from the user's browser.
This includes:
The action is now hidden when the monitor target is not externally accessible.
Write your issue number after "Fixes "
Fixes #3434
Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.
<div>Add</div>, use):npm run formatin server and client directories, which automatically formats your code.Open Site button stopped showing for internal links: