(probe?.protocol ?? "icmp")
const [target, setTarget] = useState(probe?.target ?? "")
- const [port, setPort] = useState(
- (probe?.protocol === "tcp" || probe?.protocol === "http") && probe.port ? String(probe.port) : ""
- )
+ const [port, setPort] = useState(probe?.protocol === "tcp" && probe.port ? String(probe.port) : "")
const [probeInterval, setProbeInterval] = useState(String(probe?.interval ?? defaultInterval))
const [name, setName] = useState(probe?.name ?? "")
const [loading, setLoading] = useState(false)
@@ -423,7 +445,7 @@ function ProbeDialogContent({
setProtocol(probe?.protocol ?? "icmp")
setTarget(probe?.target ?? "")
- setPort((probe?.protocol === "tcp" || probe?.protocol === "http") && probe.port ? String(probe.port) : "")
+ setPort(probe?.protocol === "tcp" && probe.port ? String(probe.port) : "")
setProbeInterval(String(probe?.interval ?? defaultInterval))
setName(probe?.name ?? "")
setSelectedSystemId(probe?.system ?? "")
@@ -444,7 +466,7 @@ function ProbeDialogContent({
system: selectedSystem,
target,
protocol,
- port: protocol === "tcp" || protocol === "http" ? Number(port) : 0,
+ port: protocol === "tcp" ? Number(port) : 0,
interval: probeInterval,
name,
},
@@ -500,7 +522,7 @@ function ProbeDialogContent({
setTarget(e.target.value)}
- placeholder={protocol === "http" ? "https://example.com" : "1.1.1.1"}
+ placeholder={protocol === "http" ? "http://localhost:8090" : "1.1.1.1"}
required
/>
@@ -520,7 +542,7 @@ function ProbeDialogContent({
- {(protocol === "tcp" || protocol === "http") && (
+ {protocol === "tcp" && (