[PULSE-47] Add uptime monitoring dashboard #15

Merged
uz1mani merged 6 commits from staging into main 2026-02-07 22:38:13 +00:00
3 changed files with 1190 additions and 0 deletions
Showing only changes of commit 8424863a18 - Show all commits

View File

@@ -868,10 +868,8 @@ function MonitorForm({
submitLabel: string
siteDomain: string
}) {
const [protocol, setProtocol] = useState<'https://' | 'http://'>(() => {
if (formData.url.startsWith('http://')) return 'http://'
return 'https://'
})
// * Derive protocol from formData.url so edit modal shows the monitor's actual scheme (no desync)
const protocol: 'https://' | 'http://' = formData.url.startsWith('http://') ? 'http://' : 'https://'
const [showProtocolDropdown, setShowProtocolDropdown] = useState(false)
const dropdownRef = useRef<HTMLDivElement>(null)
@@ -898,9 +896,7 @@ function MonitorForm({
}
const handleProtocolChange = (proto: 'https://' | 'http://') => {
setProtocol(proto)
setShowProtocolDropdown(false)
// * Rebuild URL with new protocol
const path = getPath()
setFormData({ ...formData, url: `${proto}${siteDomain}${path}` })
}