feat: add LocationResult type and locationResults to Check model

## Changes
- Add LocationResult interface to server check types
- Add locationResults optional field to Check interface
- Add GlobalpingCheckResult interface to network types
- Add locationResultSchema subdocument and locationResults field to Mongoose Check schema
- Fix formatting in pre-existing files (SettingsGlobalping, Settings index, UptimeMonitorsTable, monitorService)

## Benefits
Non-destructive addition of the data model needed to store per-location
Globalping results inside a single Check document. No existing behaviour
is changed.
This commit is contained in:
gorkem-bwl committed 2026-02-20 01:31:31 -05:00
1 parent b7c9e2710a
commit d25ce9e498
11 files changed
+87 -44

No files matched your search

@@ -113,10 +113,16 @@ const SettingsGlobalping = ({
control={<Radio sx={{ p: 0, mr: theme.spacing(4) }} />}
label={
<Box>
<Typography fontWeight={500} lineHeight={1.5}>
<Typography
fontWeight={500}
lineHeight={1.5}
>
{t(`pages.settings.globalpingSettings.${tier.labelKey}`)}
</Typography>
<Typography variant="body2" color="text.secondary">
<Typography
variant="body2"
color="text.secondary"
>
{t(`pages.settings.globalpingSettings.${tier.descKey}`)}
</Typography>
</Box>
@@ -145,18 +151,30 @@ const SettingsGlobalping = ({
<Typography sx={{ mb: theme.spacing(4) }}>
{t("pages.settings.globalpingSettings.rateLimitsDescription")}
</Typography>
<Box component="ul" sx={{ m: 0, pl: theme.spacing(8) }}>
<Typography component="li" sx={{ mb: theme.spacing(2) }}>
<Box
component="ul"
sx={{ m: 0, pl: theme.spacing(8) }}
>
<Typography
component="li"
sx={{ mb: theme.spacing(2) }}
>
{t("pages.settings.globalpingSettings.rateLimitNoAuth")}
</Typography>
<Typography component="li" sx={{ mb: theme.spacing(2) }}>
<Typography
component="li"
sx={{ mb: theme.spacing(2) }}
>
{t("pages.settings.globalpingSettings.rateLimitAuth")}
</Typography>
<Typography component="li">
{t("pages.settings.globalpingSettings.rateLimitSponsor")}
</Typography>
</Box>
<Typography color="text.secondary" sx={{ mt: theme.spacing(4), fontStyle: "italic" }}>
<Typography
color="text.secondary"
sx={{ mt: theme.spacing(4), fontStyle: "italic" }}
>
{t("pages.settings.globalpingSettings.rateLimitsNote")}
</Typography>
</Box>
+5 -1
View File
@@ -120,7 +120,11 @@ const Settings = () => {
if (isGlobalpingKeySet && !globalpingKeyHasBeenReset && !toSubmit.globalpingApiKey) {
delete toSubmit.globalpingApiKey;
}
if (isEmailPasswordSet && !emailPasswordHasBeenReset && !toSubmit.systemEmailPassword) {
if (
isEmailPasswordSet &&
!emailPasswordHasBeenReset &&
!toSubmit.systemEmailPassword
) {
delete toSubmit.systemEmailPassword;
}
+3 -1
View File
@@ -113,7 +113,9 @@ const UptimeDetailsPage = () => {
const checks = checksData?.checks ?? [];
const checksCount = checksData?.checksCount ?? 0;
const globalpingLocationsUrl = monitor?.globalpingEnabled ? "/monitors/globalping/locations" : null;
const globalpingLocationsUrl = monitor?.globalpingEnabled
? "/monitors/globalping/locations"
: null;
const { data: globalpingData } = useGet<{
locations: { id: string; label: string }[];
labels: Record<string, string>;
@@ -177,7 +177,10 @@ export const MonitorTable = ({
{row?.name}
{row.globalpingEnabled && (
<Tooltip title={t("pages.uptime.table.headers.globalpingEnabled")}>
<Globe size={14} aria-label={t("pages.uptime.table.headers.globalpingEnabled")} />
<Globe
size={14}
aria-label={t("pages.uptime.table.headers.globalpingEnabled")}
/>
</Tooltip>
)}
</Stack>