@oneuptime/common 11.7.3 → 11.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/AlertEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/AlertStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentEpisodeStateTimeline.ts +1 -0
- package/Models/DatabaseModels/IncidentStateTimeline.ts +1 -0
- package/Models/DatabaseModels/Index.ts +5 -0
- package/Models/DatabaseModels/LogDropFilter.ts +89 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +13 -3
- package/Models/DatabaseModels/RecommendationDismissal.ts +463 -0
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +1 -0
- package/Models/DatabaseModels/StatusPageGroup.ts +95 -0
- package/Models/DatabaseModels/TraceDropFilter.ts +89 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +5 -1
- package/Server/API/AlertAPI.ts +32 -17
- package/Server/API/BaseAPI.ts +31 -2
- package/Server/API/BaseAnalyticsAPI.ts +36 -2
- package/Server/API/CommonAPI.ts +57 -0
- package/Server/API/IncidentAPI.ts +60 -33
- package/Server/API/IncidentEpisodeAPI.ts +31 -16
- package/Server/API/MonitorAPI.ts +30 -0
- package/Server/API/MonitorTemplateAPI.ts +8 -0
- package/Server/API/ProbeAPI.ts +196 -15
- package/Server/API/ProjectAPI.ts +79 -1
- package/Server/API/ScheduledMaintenanceAPI.ts +33 -18
- package/Server/API/StatusPageAPI.ts +74 -37
- package/Server/API/WorkspaceNotificationRuleAPI.ts +34 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.ts +527 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.ts +55 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.ts +53 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Services/AlertEpisodeService.ts +47 -0
- package/Server/Services/AlertService.ts +125 -0
- package/Server/Services/BillingService.ts +98 -0
- package/Server/Services/DatabaseService.ts +184 -20
- package/Server/Services/IncidentEpisodeService.ts +47 -0
- package/Server/Services/IncidentService.ts +123 -0
- package/Server/Services/IncidentTemplateService.ts +123 -1
- package/Server/Services/Index.ts +2 -0
- package/Server/Services/LogDropFilterService.ts +133 -0
- package/Server/Services/MonitorProbeService.ts +94 -4
- package/Server/Services/MonitorService.ts +48 -43
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +70 -0
- package/Server/Services/ProbeService.ts +66 -0
- package/Server/Services/ProjectService.ts +131 -7
- package/Server/Services/RecommendationDismissalService.ts +52 -0
- package/Server/Services/RunbookAgentJobService.ts +68 -7
- package/Server/Services/ScheduledMaintenanceService.ts +103 -0
- package/Server/Services/ScheduledMaintenanceTemplateService.ts +90 -0
- package/Server/Services/StatusPageGroupService.ts +186 -0
- package/Server/Services/TraceDropFilterService.ts +133 -0
- package/Server/Types/Workflow/Components/API/Delete.ts +12 -0
- package/Server/Types/Workflow/Components/API/Get.ts +12 -0
- package/Server/Types/Workflow/Components/API/Patch.ts +12 -0
- package/Server/Types/Workflow/Components/API/Post.ts +12 -0
- package/Server/Types/Workflow/Components/API/Put.ts +13 -0
- package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +212 -0
- package/Server/Utils/DropFilterValidation.ts +127 -0
- package/Server/Utils/Errors.ts +5 -0
- package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
- package/Server/Utils/Monitor/MonitorIncident.ts +31 -2
- package/Server/Utils/Telemetry/AppMetrics.ts +31 -0
- package/Tests/Models/DatabaseModels/MonitorProbeColumnAccessControl.test.ts +196 -0
- package/Tests/Models/RecommendationDismissalModel.test.ts +269 -0
- package/Tests/Server/API/BaseAPIUpdatePayloadValidation.test.ts +320 -0
- package/Tests/Server/API/BaseAnalyticsAPIUpdatePayloadValidation.test.ts +293 -0
- package/Tests/Server/API/CommonAPIAuthGuard.test.ts +164 -0
- package/Tests/Server/API/ProbeAPI.test.ts +422 -53
- package/Tests/Server/API/ProjectAPI.test.ts +180 -0
- package/Tests/Server/API/ProjectAPIExtendTrialBillingDisabled.test.ts +138 -0
- package/Tests/Server/API/ProjectScopedCustomRouteAuth.test.ts +458 -0
- package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +359 -0
- package/Tests/Server/Infrastructure/ProcessSignalDelivery.test.ts +427 -0
- package/Tests/Server/Services/BillingServiceExtendTrial.test.ts +439 -0
- package/Tests/Server/Services/CrossProjectReferenceWriteGuard.test.ts +810 -0
- package/Tests/Server/Services/DatabaseServiceAtomicAddToColumns.test.ts +269 -0
- package/Tests/Server/Services/DatabaseServiceEmptyUpdate.test.ts +277 -0
- package/Tests/Server/Services/DatabaseServiceSortColumnSelect.test.ts +201 -0
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +81 -23
- package/Tests/Server/Services/DropFilterSaveValidation.test.ts +398 -0
- package/Tests/Server/Services/MonitorProbeDeleteHooks.test.ts +280 -0
- package/Tests/Server/Services/MonitorProbeServiceProbeTenancy.test.ts +304 -0
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +262 -0
- package/Tests/Server/Services/ProjectServiceExtendTrial.test.ts +614 -0
- package/Tests/Server/Services/RecommendationDismissalService.test.ts +306 -0
- package/Tests/Server/Services/RepairCrossProjectIncidentReferencesMigration.test.ts +528 -0
- package/Tests/Server/Services/StatusPageGroupNesting.test.ts +395 -0
- package/Tests/Server/TestingUtils/Services/BillingServiceHelper.ts +26 -21
- package/Tests/Server/Types/Database/Permissions/WorkflowVariableColumnPermission.test.ts +227 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +285 -0
- package/Tests/Server/Utils/Database/ProjectScopedReferenceValidator.test.ts +463 -0
- package/Tests/Server/Utils/DropFilterValidation.test.ts +269 -0
- package/Tests/Server/Utils/Telemetry/SpanUtil.test.ts +94 -0
- package/Tests/Types/DateUserTimezone.test.ts +52 -0
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +177 -9
- package/Tests/Types/Monitor/MonitorStepDnsMonitor.test.ts +105 -0
- package/Tests/Types/Monitor/MonitorStepDnssecMonitor.test.ts +131 -0
- package/Tests/Types/Monitor/MonitorStepDomainMonitor.test.ts +60 -0
- package/Tests/Types/Monitor/MonitorStepExternalStatusPageMonitor.test.ts +82 -0
- package/Tests/Types/Monitor/MonitorStepInfrastructureMonitors.test.ts +268 -0
- package/Tests/Types/Monitor/MonitorStepMetricMonitor.test.ts +386 -0
- package/Tests/Types/Monitor/MonitorStepProfileMonitor.test.ts +185 -0
- package/Tests/Types/Monitor/MonitorStepSnmpMonitor.test.ts +156 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +371 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +901 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +607 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.test.ts +754 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +960 -0
- package/Tests/Types/RollingTime/RollingTimeUtil.test.ts +186 -0
- package/Tests/Types/Runbook/RunbookStepTimeout.test.ts +410 -0
- package/Tests/Types/Telemetry/DropFilterSampling.test.ts +241 -0
- package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +353 -0
- package/Tests/Types/Workspace/NotificationRuleUtil.test.ts +566 -0
- package/Tests/UI/Components/CodeEditor.test.tsx +174 -0
- package/Tests/UI/Components/ErrorBoundary.test.tsx +555 -24
- package/Tests/UI/Components/InfoCard.test.tsx +358 -0
- package/Tests/UI/Components/LogTimeRangePicker.test.tsx +138 -0
- package/Tests/UI/Components/Modal.test.tsx +43 -5
- package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +427 -0
- package/Tests/UI/Components/Runbook/StepTimeoutInput.test.tsx +386 -0
- package/Tests/UI/Components/StatusPage/ResourceGroupSection.test.tsx +671 -0
- package/Tests/UI/Components/TelemetryTimeRangePicker.test.tsx +404 -0
- package/Tests/UI/Utils/DropdownAlignment.test.ts +306 -0
- package/Tests/UI/Utils/TableFilterUrlState.test.ts +292 -0
- package/Tests/Utils/Monitor/MonitorSummaryProbeUtil.test.ts +263 -0
- package/Tests/Utils/NetworkDiscovery/ScanTargetUtil.test.ts +583 -0
- package/Tests/Utils/StatusPage/GroupNestingLayout.test.ts +1072 -0
- package/Tests/Utils/StatusPage/GroupTree.test.ts +583 -0
- package/Tests/Utils/StatusPage/ResourceUptime.test.ts +411 -0
- package/Types/Date.ts +15 -6
- package/Types/Monitor/KubernetesAlertTemplates.ts +205 -0
- package/Types/Monitor/MonitorStep.ts +10 -1
- package/Types/Monitor/MonitorStepMetricMonitor.ts +46 -1
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +413 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.ts +168 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +175 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +743 -0
- package/Types/Permission.ts +45 -0
- package/Types/Recommendation/RecommendationType.ts +20 -0
- package/Types/Runbook/RunbookExecutionDeadline.ts +129 -0
- package/Types/Runbook/RunbookStepTimeout.ts +202 -0
- package/Types/Telemetry/DropFilterSampling.ts +92 -0
- package/UI/Components/AI/GenerateFromAIModal.tsx +0 -2
- package/UI/Components/Accordion/Accordion.tsx +10 -2
- package/UI/Components/BulkUpdate/BulkLabelActions.tsx +0 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +34 -20
- package/UI/Components/Date/RangeStartAndEndDateView.tsx +0 -1
- package/UI/Components/EditionLabel/EditionLabel.tsx +1 -27
- package/UI/Components/Error/PageError.tsx +0 -4
- package/UI/Components/ErrorBoundary.tsx +252 -15
- package/UI/Components/InfoCard/InfoCard.tsx +58 -1
- package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +34 -1
- package/UI/Components/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +116 -67
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +150 -47
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
- package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +34 -1
- package/UI/Utils/DropdownAlignment.ts +162 -0
- package/UI/Utils/TableFilterUrlState.ts +59 -20
- package/Utils/API.ts +106 -2
- package/Utils/Monitor/MonitorSummaryProbeUtil.ts +130 -0
- package/Utils/NetworkDiscovery/ScanTargetUtil.ts +434 -0
- package/Utils/StatusPage/GroupNestingLayout.ts +343 -0
- package/Utils/StatusPage/GroupTree.ts +307 -0
- package/Utils/StatusPage/ResourceUptime.ts +90 -17
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/AlertStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/LogDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/LogDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +14 -4
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js +484 -0
- package/build/dist/Models/DatabaseModels/RecommendationDismissal.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js +94 -0
- package/build/dist/Models/DatabaseModels/StatusPageGroup.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js +91 -0
- package/build/dist/Models/DatabaseModels/TraceDropFilter.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +5 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +22 -13
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +22 -1
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js +24 -1
- package/build/dist/Server/API/BaseAnalyticsAPI.js.map +1 -1
- package/build/dist/Server/API/CommonAPI.js +42 -0
- package/build/dist/Server/API/CommonAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +43 -26
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +21 -12
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorAPI.js +23 -0
- package/build/dist/Server/API/MonitorAPI.js.map +1 -1
- package/build/dist/Server/API/MonitorTemplateAPI.js +4 -0
- package/build/dist/Server/API/MonitorTemplateAPI.js.map +1 -1
- package/build/dist/Server/API/ProbeAPI.js +131 -15
- package/build/dist/Server/API/ProbeAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectAPI.js +62 -3
- package/build/dist/Server/API/ProjectAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +23 -14
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +61 -33
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js +26 -2
- package/build/dist/Server/API/WorkspaceNotificationRuleAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js +397 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785320000000-RepairCrossProjectIncidentReferences.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785329453269-AddParentGroupToStatusPageGroup.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js +30 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785397674289-AddRecommendationDismissalTable.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785405581596-AddDroppedCountersToDropFilters.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeService.js +39 -0
- package/build/dist/Server/Services/AlertEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +95 -0
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +71 -0
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +140 -17
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +39 -0
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +100 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentTemplateService.js +97 -0
- package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +2 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/LogDropFilterService.js +93 -0
- package/build/dist/Server/Services/LogDropFilterService.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +73 -5
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +34 -39
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/ProbeService.js +64 -0
- package/build/dist/Server/Services/ProbeService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +103 -7
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/RecommendationDismissalService.js +50 -0
- package/build/dist/Server/Services/RecommendationDismissalService.js.map +1 -0
- package/build/dist/Server/Services/RunbookAgentJobService.js +63 -5
- package/build/dist/Server/Services/RunbookAgentJobService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +83 -0
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js +65 -0
- package/build/dist/Server/Services/ScheduledMaintenanceTemplateService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageGroupService.js +136 -0
- package/build/dist/Server/Services/StatusPageGroupService.js.map +1 -1
- package/build/dist/Server/Services/TraceDropFilterService.js +93 -0
- package/build/dist/Server/Services/TraceDropFilterService.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +11 -0
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +12 -0
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +132 -0
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -0
- package/build/dist/Server/Utils/DropFilterValidation.js +80 -0
- package/build/dist/Server/Utils/DropFilterValidation.js.map +1 -0
- package/build/dist/Server/Utils/Errors.js +3 -0
- package/build/dist/Server/Utils/Errors.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +30 -12
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +38 -18
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js +26 -0
- package/build/dist/Server/Utils/Telemetry/AppMetrics.js.map +1 -1
- package/build/dist/Types/Date.js +14 -4
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +192 -0
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +6 -1
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js +32 -1
- package/build/dist/Types/Monitor/MonitorStepMetricMonitor.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +294 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js +110 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationSeverityMapper.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +58 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +451 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -0
- package/build/dist/Types/Permission.js +40 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Recommendation/RecommendationType.js +21 -0
- package/build/dist/Types/Recommendation/RecommendationType.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js +93 -0
- package/build/dist/Types/Runbook/RunbookExecutionDeadline.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js +142 -0
- package/build/dist/Types/Runbook/RunbookStepTimeout.js.map +1 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js +75 -0
- package/build/dist/Types/Telemetry/DropFilterSampling.js.map +1 -0
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js +1 -2
- package/build/dist/UI/Components/AI/GenerateFromAIModal.js.map +1 -1
- package/build/dist/UI/Components/Accordion/Accordion.js +9 -2
- package/build/dist/UI/Components/Accordion/Accordion.js.map +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js +1 -1
- package/build/dist/UI/Components/BulkUpdate/BulkLabelActions.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +27 -14
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js +1 -1
- package/build/dist/UI/Components/Date/RangeStartAndEndDateView.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +2 -20
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/Error/PageError.js +1 -3
- package/build/dist/UI/Components/Error/PageError.js.map +1 -1
- package/build/dist/UI/Components/ErrorBoundary.js +145 -11
- package/build/dist/UI/Components/ErrorBoundary.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +28 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Components/Modal/Modal.js +4 -32
- package/build/dist/UI/Components/Modal/Modal.js.map +1 -1
- package/build/dist/UI/Components/ModelFormModal/ModelFormModal.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +69 -33
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +73 -32
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -1
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js +101 -0
- package/build/dist/UI/Components/Runbook/StepTimeoutInput.js.map +1 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js +73 -0
- package/build/dist/UI/Components/StatusPage/ResourceGroupSection.js.map +1 -0
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +13 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Utils/DropdownAlignment.js +98 -0
- package/build/dist/UI/Utils/DropdownAlignment.js.map +1 -0
- package/build/dist/UI/Utils/TableFilterUrlState.js +48 -15
- package/build/dist/UI/Utils/TableFilterUrlState.js.map +1 -1
- package/build/dist/Utils/API.js +39 -2
- package/build/dist/Utils/API.js.map +1 -1
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js +97 -0
- package/build/dist/Utils/Monitor/MonitorSummaryProbeUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js +330 -0
- package/build/dist/Utils/NetworkDiscovery/ScanTargetUtil.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js +280 -0
- package/build/dist/Utils/StatusPage/GroupNestingLayout.js.map +1 -0
- package/build/dist/Utils/StatusPage/GroupTree.js +214 -0
- package/build/dist/Utils/StatusPage/GroupTree.js.map +1 -0
- package/build/dist/Utils/StatusPage/ResourceUptime.js +60 -16
- package/build/dist/Utils/StatusPage/ResourceUptime.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Scan-target parsing for network device discovery.
|
|
3
|
+
*
|
|
4
|
+
* A discovery scan's target is the IPv4 address space a probe sweeps. Two
|
|
5
|
+
* notations are accepted:
|
|
6
|
+
*
|
|
7
|
+
* CIDR 192.168.1.0/24
|
|
8
|
+
* Octet range 10.16-22.0-255.51-66
|
|
9
|
+
*
|
|
10
|
+
* Octet-range notation exists because real networks are not shaped like CIDR
|
|
11
|
+
* blocks. "The .51-.66 management addresses in every /24 of 10.16-22.x" is a
|
|
12
|
+
* single target here; expressed in CIDR it is 1,792 separate scans, and the
|
|
13
|
+
* only CIDR that covers it in one go (10.16.0.0/13) is 512k addresses, of
|
|
14
|
+
* which 98% are not worth probing.
|
|
15
|
+
*
|
|
16
|
+
* This lives in Common rather than in the Probe's SubnetScanner so the server
|
|
17
|
+
* can validate a target at write time with exactly the parser the probe will
|
|
18
|
+
* later expand it with. A target that saves is a target that scans.
|
|
19
|
+
*
|
|
20
|
+
* IPv4-only by design, same as the sweep itself: IPv6 space is far too sparse
|
|
21
|
+
* to enumerate, and IPv6 discovery will be neighbour-discovery based.
|
|
22
|
+
*/
|
|
23
|
+
// Which of the two notations a target string is written in.
|
|
24
|
+
export var ScanTargetNotation;
|
|
25
|
+
(function (ScanTargetNotation) {
|
|
26
|
+
ScanTargetNotation["Cidr"] = "CIDR";
|
|
27
|
+
ScanTargetNotation["OctetRange"] = "OctetRange";
|
|
28
|
+
})(ScanTargetNotation || (ScanTargetNotation = {}));
|
|
29
|
+
export class ScanTargetUtil {
|
|
30
|
+
/*
|
|
31
|
+
* Parses a target into the shape needed to count and expand it. Returns null
|
|
32
|
+
* for anything malformed; use getValidationError() when you need to tell the
|
|
33
|
+
* operator WHY. Size is deliberately not checked here — parse() answers "is
|
|
34
|
+
* this well-formed", the caller decides what it can afford to sweep.
|
|
35
|
+
*/
|
|
36
|
+
static parse(target) {
|
|
37
|
+
return ScanTargetUtil.parseWithError(target).target || null;
|
|
38
|
+
}
|
|
39
|
+
// True when `target` is well-formed in either notation. Ignores size.
|
|
40
|
+
static isValid(target) {
|
|
41
|
+
return ScanTargetUtil.parse(target) !== null;
|
|
42
|
+
}
|
|
43
|
+
/*
|
|
44
|
+
* The notation `target` is written in, or null when it is not a valid target
|
|
45
|
+
* at all. A string containing '/' is always read as CIDR — a malformed CIDR
|
|
46
|
+
* is never silently retried as an octet range, because "10.0.0.0/99" is a
|
|
47
|
+
* typo'd prefix and deserves to say so.
|
|
48
|
+
*/
|
|
49
|
+
static getNotation(target) {
|
|
50
|
+
var _a;
|
|
51
|
+
return ((_a = ScanTargetUtil.parse(target)) === null || _a === void 0 ? void 0 : _a.notation) || null;
|
|
52
|
+
}
|
|
53
|
+
/*
|
|
54
|
+
* How many addresses `target` sweeps, or 0 when it is malformed. Computed
|
|
55
|
+
* from the prefix length / range widths alone, with no allocation: expand()
|
|
56
|
+
* materializes one string per address, so a size check that ran after
|
|
57
|
+
* expansion would let a /8 allocate ~16M strings before the limit it exists
|
|
58
|
+
* to enforce was ever consulted.
|
|
59
|
+
*/
|
|
60
|
+
static countHosts(target) {
|
|
61
|
+
var _a;
|
|
62
|
+
return ((_a = ScanTargetUtil.parse(target)) === null || _a === void 0 ? void 0 : _a.hostCount) || 0;
|
|
63
|
+
}
|
|
64
|
+
/*
|
|
65
|
+
* The single validation entry point for a scan target: syntax first, then
|
|
66
|
+
* the size ceiling. Returns null when the target is good to scan, otherwise
|
|
67
|
+
* a message written for the operator who typed it.
|
|
68
|
+
*/
|
|
69
|
+
static getValidationError(target) {
|
|
70
|
+
const outcome = ScanTargetUtil.parseWithError(target);
|
|
71
|
+
if (!outcome.target) {
|
|
72
|
+
return outcome.error || ScanTargetUtil.getMalformedTargetMessage(target);
|
|
73
|
+
}
|
|
74
|
+
if (outcome.target.hostCount > ScanTargetUtil.MAX_SCAN_HOSTS) {
|
|
75
|
+
return (`"${String(target).trim()}" expands to ` +
|
|
76
|
+
`${outcome.target.hostCount.toLocaleString("en-US")} addresses, ` +
|
|
77
|
+
`exceeding the ${ScanTargetUtil.MAX_SCAN_HOSTS.toLocaleString("en-US")}-address scan limit. ` +
|
|
78
|
+
`Narrow the target (a smaller subnet, or tighter octet ranges) or split it into several scans.`);
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/*
|
|
83
|
+
* Expands a target into the addresses to probe, in ascending address order.
|
|
84
|
+
*
|
|
85
|
+
* Returns an empty array for a malformed target — there is nothing to sweep.
|
|
86
|
+
* THROWS for a well-formed target above MAX_SCAN_HOSTS: that is a caller
|
|
87
|
+
* that skipped its size check, and quietly returning a truncated or empty
|
|
88
|
+
* list would turn it into a silently wrong scan. Callers should gate on
|
|
89
|
+
* getValidationError() (or countHosts()) first and never see this.
|
|
90
|
+
*/
|
|
91
|
+
static expand(target) {
|
|
92
|
+
const parsed = ScanTargetUtil.parse(target);
|
|
93
|
+
if (!parsed) {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
if (parsed.hostCount > ScanTargetUtil.MAX_SCAN_HOSTS) {
|
|
97
|
+
throw new Error(ScanTargetUtil.getValidationError(target) ||
|
|
98
|
+
`Scan target "${String(target).trim()}" is too large to expand.`);
|
|
99
|
+
}
|
|
100
|
+
if (parsed.notation === ScanTargetNotation.Cidr) {
|
|
101
|
+
return ScanTargetUtil.expandCidrTarget(parsed);
|
|
102
|
+
}
|
|
103
|
+
return ScanTargetUtil.expandOctetRangeTarget(parsed);
|
|
104
|
+
}
|
|
105
|
+
/*
|
|
106
|
+
* Both notations in one sentence, for form hints and error messages. Kept
|
|
107
|
+
* here so the UI, the server-side validator and the probe all describe the
|
|
108
|
+
* accepted syntax identically.
|
|
109
|
+
*/
|
|
110
|
+
static getSyntaxHint() {
|
|
111
|
+
return (`Use CIDR notation (e.g. ${ScanTargetUtil.EXAMPLE_CIDR}) or octet-range notation, ` +
|
|
112
|
+
`where any octet may be an inclusive low-high range (e.g. ${ScanTargetUtil.EXAMPLE_OCTET_RANGE}).`);
|
|
113
|
+
}
|
|
114
|
+
static parseWithError(target) {
|
|
115
|
+
if (typeof target !== "string" || target.trim().length === 0) {
|
|
116
|
+
return {
|
|
117
|
+
error: `A scan target is required. ${ScanTargetUtil.getSyntaxHint()}`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const trimmed = target.trim();
|
|
121
|
+
/*
|
|
122
|
+
* Length gate BEFORE anything builds a message. Every rejection below
|
|
123
|
+
* quotes the offending target back (parseOctetRange quotes both the bad
|
|
124
|
+
* term AND the whole target, doubling it), and the server-side create
|
|
125
|
+
* hook runs ahead of the column's 100-character cap — so without this,
|
|
126
|
+
* a 50 MB request body would be reflected into a ~100 MB exception that
|
|
127
|
+
* is both logged and serialized into the response. This message is a
|
|
128
|
+
* constant and echoes nothing.
|
|
129
|
+
*/
|
|
130
|
+
if (trimmed.length > ScanTargetUtil.MAX_TARGET_LENGTH) {
|
|
131
|
+
return {
|
|
132
|
+
error: `A scan target cannot be longer than ${ScanTargetUtil.MAX_TARGET_LENGTH} characters. ` +
|
|
133
|
+
ScanTargetUtil.getSyntaxHint(),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/*
|
|
137
|
+
* The '/' is the discriminator, checked before either parser runs. A
|
|
138
|
+
* string carrying a prefix is a CIDR attempt by intent, so "10.0.0.0/99"
|
|
139
|
+
* must report a bad prefix rather than fall through to the octet-range
|
|
140
|
+
* parser and report the far more confusing "not a valid scan target".
|
|
141
|
+
*/
|
|
142
|
+
if (trimmed.includes("/")) {
|
|
143
|
+
return ScanTargetUtil.parseCidr(trimmed);
|
|
144
|
+
}
|
|
145
|
+
return ScanTargetUtil.parseOctetRange(trimmed);
|
|
146
|
+
}
|
|
147
|
+
static parseCidr(trimmed) {
|
|
148
|
+
const match = trimmed.match(ScanTargetUtil.CIDR_PATTERN);
|
|
149
|
+
if (!match) {
|
|
150
|
+
return {
|
|
151
|
+
error: `"${trimmed}" is not a valid IPv4 CIDR. ` +
|
|
152
|
+
`Expected four octets and a prefix length, e.g. ${ScanTargetUtil.EXAMPLE_CIDR}.`,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
let baseLong = 0;
|
|
156
|
+
for (let i = 1; i <= 4; i++) {
|
|
157
|
+
const octet = parseInt(match[i], 10);
|
|
158
|
+
if (octet > 255) {
|
|
159
|
+
return {
|
|
160
|
+
error: `Octet "${match[i]}" in "${trimmed}" is out of range. ` +
|
|
161
|
+
`Each octet must be between 0 and 255.`,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
baseLong = baseLong * 256 + octet;
|
|
165
|
+
}
|
|
166
|
+
const prefix = parseInt(match[5], 10);
|
|
167
|
+
if (prefix > 32) {
|
|
168
|
+
return {
|
|
169
|
+
error: `Prefix length "/${match[5]}" in "${trimmed}" is out of range. ` +
|
|
170
|
+
`An IPv4 prefix must be between /0 and /32.`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
const hostBits = 32 - prefix;
|
|
174
|
+
const blockSize = Math.pow(2, hostBits);
|
|
175
|
+
/*
|
|
176
|
+
* Shifting by 32 is a no-op in JS (the shift count is taken mod 32), so a
|
|
177
|
+
* /0 would mask with 0xffffffff and "expand" from the address as typed
|
|
178
|
+
* rather than from 0.0.0.0. Special-cased rather than relied upon.
|
|
179
|
+
*/
|
|
180
|
+
const mask = hostBits >= 32 ? 0 : (0xffffffff << hostBits) >>> 0;
|
|
181
|
+
const networkLong = (baseLong & mask) >>> 0;
|
|
182
|
+
return {
|
|
183
|
+
target: {
|
|
184
|
+
notation: ScanTargetNotation.Cidr,
|
|
185
|
+
/*
|
|
186
|
+
* /31 and /32 have no network/broadcast addresses to exclude (RFC
|
|
187
|
+
* 3021), so every address in them is a host. Larger blocks drop the
|
|
188
|
+
* first and last.
|
|
189
|
+
*/
|
|
190
|
+
hostCount: blockSize <= 2 ? blockSize : blockSize - 2,
|
|
191
|
+
networkLong: networkLong,
|
|
192
|
+
blockSize: blockSize,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static parseOctetRange(trimmed) {
|
|
197
|
+
const terms = trimmed.split(".");
|
|
198
|
+
if (terms.length !== 4) {
|
|
199
|
+
return { error: ScanTargetUtil.getMalformedTargetMessage(trimmed) };
|
|
200
|
+
}
|
|
201
|
+
const octetRanges = [];
|
|
202
|
+
let hostCount = 1;
|
|
203
|
+
for (const term of terms) {
|
|
204
|
+
const match = term.match(ScanTargetUtil.OCTET_TERM_PATTERN);
|
|
205
|
+
if (!match) {
|
|
206
|
+
return {
|
|
207
|
+
error: `"${term}" in "${trimmed}" is not a valid octet. ` +
|
|
208
|
+
`Each octet must be a number (42) or an inclusive range (16-22).`,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const start = parseInt(match[1], 10);
|
|
212
|
+
// No '-' in the term means a single value: a zero-width range.
|
|
213
|
+
const end = match[2] === undefined ? start : parseInt(match[2], 10);
|
|
214
|
+
if (start > 255 || end > 255) {
|
|
215
|
+
return {
|
|
216
|
+
error: `Octet "${term}" in "${trimmed}" is out of range. ` +
|
|
217
|
+
`Each octet must be between 0 and 255.`,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/*
|
|
221
|
+
* Reversed bounds are a typo, not an empty set. Silently accepting
|
|
222
|
+
* "22-16" as zero addresses would produce a scan that sweeps nothing
|
|
223
|
+
* and reports success — the least debuggable outcome available.
|
|
224
|
+
*/
|
|
225
|
+
if (start > end) {
|
|
226
|
+
return {
|
|
227
|
+
error: `Octet range "${term}" in "${trimmed}" is reversed. ` +
|
|
228
|
+
`Write the lower bound first, e.g. ${end}-${start}.`,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
octetRanges.push({ start: start, end: end });
|
|
232
|
+
hostCount = hostCount * (end - start + 1);
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
target: {
|
|
236
|
+
notation: ScanTargetNotation.OctetRange,
|
|
237
|
+
/*
|
|
238
|
+
* Every address in the product is swept, with no network/broadcast
|
|
239
|
+
* exclusion. An octet range is an explicit enumeration, not a subnet:
|
|
240
|
+
* whoever wrote "10.0.0.0-255" asked for .0 and .255 by name, and
|
|
241
|
+
* there is no prefix length here from which a broadcast address could
|
|
242
|
+
* even be derived.
|
|
243
|
+
*/
|
|
244
|
+
hostCount: hostCount,
|
|
245
|
+
octetRanges: octetRanges,
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
static expandCidrTarget(parsed) {
|
|
250
|
+
const networkLong = parsed.networkLong;
|
|
251
|
+
const blockSize = parsed.blockSize;
|
|
252
|
+
const hosts = [];
|
|
253
|
+
if (blockSize <= 2) {
|
|
254
|
+
// /31 and /32: every address is usable.
|
|
255
|
+
for (let i = 0; i < blockSize; i++) {
|
|
256
|
+
hosts.push(ScanTargetUtil.longToIp(networkLong + i));
|
|
257
|
+
}
|
|
258
|
+
return hosts;
|
|
259
|
+
}
|
|
260
|
+
// Skip network (first) and broadcast (last).
|
|
261
|
+
for (let i = 1; i < blockSize - 1; i++) {
|
|
262
|
+
hosts.push(ScanTargetUtil.longToIp(networkLong + i));
|
|
263
|
+
}
|
|
264
|
+
return hosts;
|
|
265
|
+
}
|
|
266
|
+
static expandOctetRangeTarget(parsed) {
|
|
267
|
+
const ranges = parsed.octetRanges;
|
|
268
|
+
const hosts = [];
|
|
269
|
+
// Outer-to-inner octet order, so the result comes out address-ascending.
|
|
270
|
+
for (let a = ranges[0].start; a <= ranges[0].end; a++) {
|
|
271
|
+
for (let b = ranges[1].start; b <= ranges[1].end; b++) {
|
|
272
|
+
for (let c = ranges[2].start; c <= ranges[2].end; c++) {
|
|
273
|
+
for (let d = ranges[3].start; d <= ranges[3].end; d++) {
|
|
274
|
+
hosts.push(`${a}.${b}.${c}.${d}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return hosts;
|
|
280
|
+
}
|
|
281
|
+
static getMalformedTargetMessage(target) {
|
|
282
|
+
const shown = typeof target === "string" ? target.trim() : String(target);
|
|
283
|
+
return (`"${shown}" is not a valid scan target. ` + ScanTargetUtil.getSyntaxHint());
|
|
284
|
+
}
|
|
285
|
+
static longToIp(long) {
|
|
286
|
+
return (((long >>> 24) & 0xff) +
|
|
287
|
+
"." +
|
|
288
|
+
((long >>> 16) & 0xff) +
|
|
289
|
+
"." +
|
|
290
|
+
((long >>> 8) & 0xff) +
|
|
291
|
+
"." +
|
|
292
|
+
(long & 0xff));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/*
|
|
296
|
+
* Hard ceiling on how many addresses one scan may sweep.
|
|
297
|
+
*
|
|
298
|
+
* The number is a wall-clock budget, not a memory one. SubnetScanner runs 32
|
|
299
|
+
* workers; a dead host costs ~1s (the ICMP pre-sweep timeout), or ~2s when
|
|
300
|
+
* the pre-sweep is unavailable and every host is SNMP-probed directly. At
|
|
301
|
+
* this ceiling that is ~17 minutes with the pre-sweep and ~34 minutes
|
|
302
|
+
* without — both comfortably inside the 2-hour window after which the server
|
|
303
|
+
* declares an In Progress scan abandoned (Workers/Jobs/
|
|
304
|
+
* NetworkDeviceDiscovery/RequeueRecurringScans.ts) and safely above the
|
|
305
|
+
* 15-minute minimum rescan interval for recurring scans.
|
|
306
|
+
*
|
|
307
|
+
* It is also still a real abuse guard: a /17 in CIDR terms. Anything larger
|
|
308
|
+
* (a /16 sweep, an unbounded 10.*.*.* octet range) is rejected at write time
|
|
309
|
+
* with a message telling the operator to narrow the target.
|
|
310
|
+
*/
|
|
311
|
+
ScanTargetUtil.MAX_SCAN_HOSTS = 32768;
|
|
312
|
+
/*
|
|
313
|
+
* Longest string we will even attempt to parse. The widest well-formed
|
|
314
|
+
* target is "255-255.255-255.255-255.255-255" at 31 characters, so this is
|
|
315
|
+
* ~2x headroom and still far below the 100-character column. It exists to
|
|
316
|
+
* bound the error messages, which quote the target back — see the gate in
|
|
317
|
+
* parseWithError().
|
|
318
|
+
*/
|
|
319
|
+
ScanTargetUtil.MAX_TARGET_LENGTH = 64;
|
|
320
|
+
/*
|
|
321
|
+
* Hoisted so the literals are not the object of a member expression, which
|
|
322
|
+
* `wrap-regex` and Prettier cannot agree on. Same reason as CidrMatchUtil.
|
|
323
|
+
*/
|
|
324
|
+
ScanTargetUtil.CIDR_PATTERN = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,3})$/;
|
|
325
|
+
// A single octet term: `42` or `16-22`. Bounds are validated after parsing.
|
|
326
|
+
ScanTargetUtil.OCTET_TERM_PATTERN = /^(\d{1,3})(?:-(\d{1,3}))?$/;
|
|
327
|
+
ScanTargetUtil.EXAMPLE_CIDR = "192.168.1.0/24";
|
|
328
|
+
ScanTargetUtil.EXAMPLE_OCTET_RANGE = "10.16-22.0-255.51-66";
|
|
329
|
+
export default ScanTargetUtil;
|
|
330
|
+
//# sourceMappingURL=ScanTargetUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScanTargetUtil.js","source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,kCAAmB,GAAW,sBAAsB,CAAC;AA6U/E,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import StatusPageGroupViewMode from "../../Types/StatusPage/StatusPageGroupViewMode";
|
|
2
|
+
/*
|
|
3
|
+
* Status page groups nest (Corporate Unit -> Region -> Market -> Site) and the
|
|
4
|
+
* overview page draws that nesting.
|
|
5
|
+
*
|
|
6
|
+
* Drawing each level as a card inside a card inside a card is what it used to
|
|
7
|
+
* do, and it does not survive contact with a real hierarchy: four borders end
|
|
8
|
+
* up wrapped around one uptime bar, every level eats horizontal room the bars
|
|
9
|
+
* need, and a leaf resource ends up rendered larger than the group that
|
|
10
|
+
* contains it. Below the top level a group is therefore drawn as a row hanging
|
|
11
|
+
* off a tree rail - one hairline down the left, one indent step, no extra card.
|
|
12
|
+
*
|
|
13
|
+
* The numbers live here rather than inline in the page because they are the
|
|
14
|
+
* part that has to hold at depth 1 and still hold at depth 12, and that is
|
|
15
|
+
* worth pinning down in tests.
|
|
16
|
+
*/
|
|
17
|
+
/* What a group header shows on its right hand side, if anything. */
|
|
18
|
+
export var StatusPageGroupRollupKind;
|
|
19
|
+
(function (StatusPageGroupRollupKind) {
|
|
20
|
+
StatusPageGroupRollupKind["UptimePercent"] = "UptimePercent";
|
|
21
|
+
StatusPageGroupRollupKind["CurrentStatus"] = "CurrentStatus";
|
|
22
|
+
StatusPageGroupRollupKind["None"] = "None";
|
|
23
|
+
})(StatusPageGroupRollupKind || (StatusPageGroupRollupKind = {}));
|
|
24
|
+
class StatusPageGroupNestingLayoutUtil {
|
|
25
|
+
/*
|
|
26
|
+
* A depth that is not a whole number >= 0 is treated as the top level. The
|
|
27
|
+
* page derives depth from a recursive render, but nothing stops a caller (or
|
|
28
|
+
* a future refactor) from handing over -1 or NaN, and a broken indent is not
|
|
29
|
+
* worth a broken page.
|
|
30
|
+
*/
|
|
31
|
+
static getVisualDepth(data) {
|
|
32
|
+
if (!Number.isFinite(data.depth)) {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
const depth = Math.floor(data.depth);
|
|
36
|
+
if (depth <= 0) {
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
return Math.min(depth, this.MaxIndentedDepth);
|
|
40
|
+
}
|
|
41
|
+
static isRootLevel(data) {
|
|
42
|
+
return this.getVisualDepth({ depth: data.depth }) === 0;
|
|
43
|
+
}
|
|
44
|
+
/*
|
|
45
|
+
* Nesting is expressed with the rail, so the title only ever steps down once
|
|
46
|
+
* - and never below the size a resource name renders at. That inversion, a
|
|
47
|
+
* text-sm group heading over a text-lg resource, is what made the old nesting
|
|
48
|
+
* read upside down.
|
|
49
|
+
*/
|
|
50
|
+
/*
|
|
51
|
+
* Truncates at every width, including on a phone. Wrapping was tried and is
|
|
52
|
+
* worse: the title is the only shrinkable item in the header row, so next to a
|
|
53
|
+
* sub group badge and a rollup it collapses to a ~30px column and breaks a
|
|
54
|
+
* name one character per line. An ellipsis with the full name in `title` is the
|
|
55
|
+
* lesser evil.
|
|
56
|
+
*/
|
|
57
|
+
static getTitleClassName(data) {
|
|
58
|
+
const base = "min-w-0 truncate font-semibold text-gray-900";
|
|
59
|
+
if (this.isRootLevel(data)) {
|
|
60
|
+
return `${base} text-base sm:text-lg tracking-tight`;
|
|
61
|
+
}
|
|
62
|
+
return `${base} text-base tracking-tight`;
|
|
63
|
+
}
|
|
64
|
+
/*
|
|
65
|
+
* A resource name, as rendered by MonitorOverview. It lives here so the floor
|
|
66
|
+
* a group title has to clear is the same string the resource actually renders
|
|
67
|
+
* with, rather than a number written down next to it.
|
|
68
|
+
*/
|
|
69
|
+
static getResourceTitleClassName() {
|
|
70
|
+
return "text-base font-medium";
|
|
71
|
+
}
|
|
72
|
+
/*
|
|
73
|
+
* The chevron box and the gap after it are what set where a title starts, and
|
|
74
|
+
* a sub group's contents and a group description are both aligned to that. All
|
|
75
|
+
* three are derived from these two, so moving the chevron moves them with it.
|
|
76
|
+
*/
|
|
77
|
+
static getChevronBoxClassName() {
|
|
78
|
+
return "flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-md transition-colors";
|
|
79
|
+
}
|
|
80
|
+
static getHeaderRowClassName() {
|
|
81
|
+
return "flex min-w-0 flex-1 items-center gap-2.5";
|
|
82
|
+
}
|
|
83
|
+
/*
|
|
84
|
+
* A nested group is not a card. It is a block in the parent's body, so all it
|
|
85
|
+
* gets is the vertical rhythm that separates it from its siblings.
|
|
86
|
+
*/
|
|
87
|
+
static getContainerClassName(data) {
|
|
88
|
+
if (this.isRootLevel(data)) {
|
|
89
|
+
return "bg-white rounded-xl shadow px-4 py-3 sm:px-6 sm:py-4";
|
|
90
|
+
}
|
|
91
|
+
return "";
|
|
92
|
+
}
|
|
93
|
+
/*
|
|
94
|
+
* Resources that belong to no group at all get their own card at the top of
|
|
95
|
+
* the page. It is the same surface as a top level group, minus the header.
|
|
96
|
+
*/
|
|
97
|
+
static getUngroupedResourcesCardClassName() {
|
|
98
|
+
return "bg-white rounded-xl shadow px-4 py-4 sm:px-6 sm:py-5";
|
|
99
|
+
}
|
|
100
|
+
/* Vertical rhythm between the resources of one group. */
|
|
101
|
+
static getResourceListClassName() {
|
|
102
|
+
return "space-y-4 sm:space-y-5";
|
|
103
|
+
}
|
|
104
|
+
/*
|
|
105
|
+
* Quieter than the per-resource labels it replaces. It is a scale, not a
|
|
106
|
+
* reading, and it is what made a nested block look shouty when it appeared
|
|
107
|
+
* three times in one screen.
|
|
108
|
+
*/
|
|
109
|
+
static getTimeAxisClassName() {
|
|
110
|
+
return "flex justify-between text-[11px] text-gray-400";
|
|
111
|
+
}
|
|
112
|
+
/*
|
|
113
|
+
* The rolled up reading on the right of a group header. Sized to match the
|
|
114
|
+
* per-resource readings below it: a rollup and a resource reading are the same
|
|
115
|
+
* kind of number, and the status dot is what tells them apart.
|
|
116
|
+
*/
|
|
117
|
+
static getRollupClassName() {
|
|
118
|
+
return "flex-shrink-0 text-sm sm:text-base font-medium";
|
|
119
|
+
}
|
|
120
|
+
static getHeaderClassName(data) {
|
|
121
|
+
/*
|
|
122
|
+
* The whole row is the disclosure control, so it carries the hover state.
|
|
123
|
+
* Negative horizontal margin with matching padding lets that hover reach the
|
|
124
|
+
* edge of the content column while the row's contents stay aligned with the
|
|
125
|
+
* resources below it.
|
|
126
|
+
*
|
|
127
|
+
* The width has to pay for both margins explicitly. A button shrink wraps
|
|
128
|
+
* even as a flex container, so it needs a width; but `w-full` with both
|
|
129
|
+
* negative margins over-constrains the box, and the browser resolves that by
|
|
130
|
+
* dropping margin-right (CSS 2.1 10.3.3) - which leaves every rollup 16px
|
|
131
|
+
* short of the card edge the resource readings below it sit on. 100% + 1rem
|
|
132
|
+
* satisfies the equation exactly, so nothing is dropped.
|
|
133
|
+
*/
|
|
134
|
+
const base = "flex w-[calc(100%+1rem)] items-center justify-between gap-3 text-left rounded-lg -mx-2 px-2 transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-300";
|
|
135
|
+
return this.isRootLevel(data) ? `${base} py-2` : `${base} py-1.5`;
|
|
136
|
+
}
|
|
137
|
+
/*
|
|
138
|
+
* The rail and the indent that carry one nesting step.
|
|
139
|
+
*
|
|
140
|
+
* `ml` moves the rail under its parent's chevron and `pl` pushes the contents
|
|
141
|
+
* clear of it, so the two together land a sub group's contents at the parent's
|
|
142
|
+
* title. Past MaxIndentedDepth the step tightens rather than stops: the rails
|
|
143
|
+
* have to stay distinguishable, but a deep tree still has to leave room for
|
|
144
|
+
* the uptime bars on a phone.
|
|
145
|
+
*/
|
|
146
|
+
static getIndentClassName(data) {
|
|
147
|
+
const visualDepth = this.getVisualDepth(data);
|
|
148
|
+
if (visualDepth === 0) {
|
|
149
|
+
return "";
|
|
150
|
+
}
|
|
151
|
+
if (visualDepth < this.MaxIndentedDepth) {
|
|
152
|
+
return "ml-2.5 sm:ml-3 pl-4 sm:pl-5";
|
|
153
|
+
}
|
|
154
|
+
return "ml-1.5 pl-3";
|
|
155
|
+
}
|
|
156
|
+
/*
|
|
157
|
+
* Everything a group contains - its own resources and then its sub groups -
|
|
158
|
+
* lives in one body so a single rail covers all of it.
|
|
159
|
+
*/
|
|
160
|
+
static getBodyClassName(data) {
|
|
161
|
+
if (this.isRootLevel(data)) {
|
|
162
|
+
// The card's own padding is the boundary at the top level; no rail.
|
|
163
|
+
return "mt-3 space-y-4";
|
|
164
|
+
}
|
|
165
|
+
return `mt-2.5 space-y-3.5 border-l border-gray-200 ${this.getIndentClassName(data)}`;
|
|
166
|
+
}
|
|
167
|
+
static showRail(data) {
|
|
168
|
+
return !this.isRootLevel(data);
|
|
169
|
+
}
|
|
170
|
+
static getSubGroupListClassName(data) {
|
|
171
|
+
return this.isRootLevel(data) ? "space-y-3" : "space-y-2.5";
|
|
172
|
+
}
|
|
173
|
+
/*
|
|
174
|
+
* A group with resources of its own *and* sub groups needs a line between the
|
|
175
|
+
* two, otherwise its last resource reads as belonging to the first sub group.
|
|
176
|
+
*/
|
|
177
|
+
static shouldShowSubGroupDivider(data) {
|
|
178
|
+
return data.hasOwnResources && data.subGroupCount > 0;
|
|
179
|
+
}
|
|
180
|
+
static getSubGroupDividerClassName() {
|
|
181
|
+
return "border-t border-gray-100 pt-3.5";
|
|
182
|
+
}
|
|
183
|
+
/*
|
|
184
|
+
* The group description hangs under the title, indented past the chevron so
|
|
185
|
+
* it lines up with the name rather than with the disclosure control. It sits
|
|
186
|
+
* outside the header button on purpose: a description is markdown and may
|
|
187
|
+
* contain links, which cannot live inside a button.
|
|
188
|
+
*
|
|
189
|
+
* The indent is 34px: the 24px chevron box (w-6, see getChevronBoxClassName)
|
|
190
|
+
* plus the 10px gap after it (gap-2.5, see getHeaderRowClassName).
|
|
191
|
+
*
|
|
192
|
+
* Alignment only. Type and vertical rhythm are MarkdownViewer's - it sets
|
|
193
|
+
* them on the paragraph it renders, which beats anything inherited from here,
|
|
194
|
+
* so declaring a size or a colour on this wrapper would just be a comment that
|
|
195
|
+
* looks like code.
|
|
196
|
+
*/
|
|
197
|
+
static getDescriptionClassName() {
|
|
198
|
+
return "pl-[34px] pr-2";
|
|
199
|
+
}
|
|
200
|
+
static getSubGroupCountBadgeClassName() {
|
|
201
|
+
return "flex-shrink-0 inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-[11px] font-medium text-gray-500 tabular-nums";
|
|
202
|
+
}
|
|
203
|
+
/* The status dot that marks a reading as a rollup rather than a resource's own. */
|
|
204
|
+
static getRollupDotClassName() {
|
|
205
|
+
return "h-1.5 w-1.5 flex-shrink-0 rounded-full";
|
|
206
|
+
}
|
|
207
|
+
static getRollupLabelClassName() {
|
|
208
|
+
return "font-semibold tabular-nums";
|
|
209
|
+
}
|
|
210
|
+
/*
|
|
211
|
+
* A group that only exists to hold sub groups has no resources of its own,
|
|
212
|
+
* and telling the visitor it is empty would be wrong - the sub groups below
|
|
213
|
+
* it are its content. A group with neither still renders its (empty) resource
|
|
214
|
+
* list, because that is where the "no resources" message belongs.
|
|
215
|
+
*/
|
|
216
|
+
static shouldRenderOwnResources(data) {
|
|
217
|
+
return data.ownResourceCount > 0 || data.subGroupCount === 0;
|
|
218
|
+
}
|
|
219
|
+
/*
|
|
220
|
+
* Whether a group draws the time axis under its own resource list.
|
|
221
|
+
*
|
|
222
|
+
* Once per resource list rather than once per resource: every bar in one list
|
|
223
|
+
* is drawn over the same window and sits in the same column, so one axis
|
|
224
|
+
* describes all of them. It deliberately does not cover sub groups - their
|
|
225
|
+
* bars are indented past this one, and they may be collapsed, so an axis up
|
|
226
|
+
* here would be labelling a column that is not there.
|
|
227
|
+
*
|
|
228
|
+
* A group in grid view draws a matrix of cells instead of bars, so its
|
|
229
|
+
* resources are not something a time axis describes.
|
|
230
|
+
*/
|
|
231
|
+
static shouldRenderTimeAxis(data) {
|
|
232
|
+
var _a, _b, _c;
|
|
233
|
+
if (((_a = data.statusPageGroup) === null || _a === void 0 ? void 0 : _a.viewMode) === StatusPageGroupViewMode.Grid) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
const groupId = ((_c = (_b = data.statusPageGroup) === null || _b === void 0 ? void 0 : _b._id) === null || _c === void 0 ? void 0 : _c.toString()) || null;
|
|
237
|
+
return (data.statusPageResources.find((resource) => {
|
|
238
|
+
var _a;
|
|
239
|
+
if (!resource.showStatusHistoryChart) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
/*
|
|
243
|
+
* Skipped for the same reason the page skips them - a resource that
|
|
244
|
+
* resolves to neither a monitor nor a monitor group draws nothing.
|
|
245
|
+
*/
|
|
246
|
+
if (!resource.monitor && !resource.monitorGroupId) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
const resourceGroupId = ((_a = resource.statusPageGroupId) === null || _a === void 0 ? void 0 : _a.toString()) || null;
|
|
250
|
+
return resourceGroupId === groupId;
|
|
251
|
+
}) !== undefined);
|
|
252
|
+
}
|
|
253
|
+
/*
|
|
254
|
+
* Which rolled up reading a group header shows.
|
|
255
|
+
*
|
|
256
|
+
* A group that is currently down shows its status rather than an uptime
|
|
257
|
+
* percent - "99.9% uptime" next to a red group is not the thing a visitor came
|
|
258
|
+
* to read - and a group whose uptime cannot be worked out (no resources under
|
|
259
|
+
* it at all) shows nothing rather than a zero.
|
|
260
|
+
*/
|
|
261
|
+
static getRollupKind(data) {
|
|
262
|
+
if (data.showUptimePercent && !data.isCurrentlyDown) {
|
|
263
|
+
return data.uptimePercent === null
|
|
264
|
+
? StatusPageGroupRollupKind.None
|
|
265
|
+
: StatusPageGroupRollupKind.UptimePercent;
|
|
266
|
+
}
|
|
267
|
+
return data.showCurrentStatus
|
|
268
|
+
? StatusPageGroupRollupKind.CurrentStatus
|
|
269
|
+
: StatusPageGroupRollupKind.None;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/*
|
|
273
|
+
* Beyond this depth the indent step shrinks instead of growing. Nesting is
|
|
274
|
+
* capped on write at StatusPageGroupTreeUtil.MaxNestingDepth, but rows
|
|
275
|
+
* written straight to the database are not, so the layout is not allowed to
|
|
276
|
+
* assume any particular ceiling.
|
|
277
|
+
*/
|
|
278
|
+
StatusPageGroupNestingLayoutUtil.MaxIndentedDepth = 4;
|
|
279
|
+
export default StatusPageGroupNestingLayoutUtil;
|
|
280
|
+
//# sourceMappingURL=GroupNestingLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupNestingLayout.js","sourceRoot":"","sources":["../../../../Utils/StatusPage/GroupNestingLayout.ts"],"names":[],"mappings":"AAEA,OAAO,uBAAuB,MAAM,gDAAgD,CAAC;AAErF;;;;;;;;;;;;;;GAcG;AAEH,oEAAoE;AACpE,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,4DAA+B,CAAA;IAC/B,4DAA+B,CAAA;IAC/B,0CAAa,CAAA;AACf,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC;AAED,MAAqB,gCAAgC;IASnD;;;;;OAKG;IACI,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,MAAM,KAAK,GAAW,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACf,OAAO,CAAC,CAAC;QACX,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,IAAuB;QAC/C,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IACH;;;;;;OAMG;IACI,MAAM,CAAC,iBAAiB,CAAC,IAAuB;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