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