@oneuptime/common 11.7.2 → 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/AnalyticsModels/KubernetesCostAllocation.ts +103 -0
- 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/TableView.ts +40 -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/1785241000000-AddColumnsToTableView.ts +13 -0
- 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 +10 -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/AnalyticsModels/KubernetesCostAllocation.test.ts +16 -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/JSONFunctions.test.ts +103 -1
- 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/BaseModelTableColumnCustomization.test.tsx +679 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableSearchLabels.test.tsx +397 -0
- package/Tests/UI/Components/ModelTable/ColumnCustomizationModal.test.tsx +999 -0
- package/Tests/UI/Components/ModelTable/ColumnPreference.test.ts +1678 -0
- package/Tests/UI/Components/ModelTable/CustomFieldColumns.test.tsx +1094 -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/Tests/Utils/UserPreferences.test.ts +563 -0
- package/Types/Date.ts +15 -6
- package/Types/JSONFunctions.ts +7 -2
- package/Types/Kubernetes/KubernetesCostIngest.ts +37 -1
- 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/MasterPage/MasterPage.tsx +65 -0
- package/UI/Components/Modal/Modal.tsx +16 -60
- package/UI/Components/ModelFormModal/ModelFormModal.tsx +0 -8
- package/UI/Components/ModelTable/BaseModelTable.tsx +503 -71
- package/UI/Components/ModelTable/Column.ts +17 -0
- package/UI/Components/ModelTable/ColumnCustomizationModal.tsx +523 -0
- package/UI/Components/ModelTable/ColumnPreference.ts +482 -0
- package/UI/Components/ModelTable/CustomFieldColumns.tsx +326 -0
- package/UI/Components/ModelTable/TableView.tsx +24 -2
- package/UI/Components/ModelTable/useCustomFieldColumns.ts +150 -0
- package/UI/Components/Runbook/StepTimeoutInput.tsx +173 -0
- package/UI/Components/SideMenu/SideMenu.tsx +24 -4
- package/UI/Components/StatusPage/ResourceGroupSection.tsx +231 -0
- package/UI/Components/Table/Table.tsx +14 -1
- package/UI/Components/Table/TableRow.tsx +180 -175
- package/UI/Components/Table/Types/Column.ts +2 -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/Utils/UserPreferences.ts +53 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js +86 -0
- package/build/dist/Models/AnalyticsModels/KubernetesCostAllocation.js.map +1 -1
- 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/TableView.js +40 -0
- package/build/dist/Models/DatabaseModels/TableView.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/1785241000000-AddColumnsToTableView.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1785241000000-AddColumnsToTableView.js.map +1 -0
- 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 +10 -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/JSONFunctions.js +8 -3
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesCostIngest.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/MasterPage/MasterPage.js +50 -1
- package/build/dist/UI/Components/MasterPage/MasterPage.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 +308 -40
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js +230 -0
- package/build/dist/UI/Components/ModelTable/ColumnCustomizationModal.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js +258 -0
- package/build/dist/UI/Components/ModelTable/ColumnPreference.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js +168 -0
- package/build/dist/UI/Components/ModelTable/CustomFieldColumns.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/TableView.js +13 -2
- package/build/dist/UI/Components/ModelTable/TableView.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js +84 -0
- package/build/dist/UI/Components/ModelTable/useCustomFieldColumns.js.map +1 -0
- 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/SideMenu/SideMenu.js +15 -5
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- 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/Table/Table.js +15 -2
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +11 -6
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- 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/build/dist/Utils/UserPreferences.js +33 -0
- package/build/dist/Utils/UserPreferences.js.map +1 -1
- package/package.json +1 -1
|
@@ -121,6 +121,59 @@ export default class TableFilterUrlState {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Serialize one slice exactly the way {@link write} puts it on the URL.
|
|
126
|
+
* Returns null for an empty slice (`null`, or an object with no keys) and for
|
|
127
|
+
* anything that will not serialize, so callers can treat "nothing to write"
|
|
128
|
+
* and "could not write" the same way.
|
|
129
|
+
*/
|
|
130
|
+
public static serializeState(
|
|
131
|
+
state: JSONObject | null | undefined,
|
|
132
|
+
): string | null {
|
|
133
|
+
if (!state || Object.keys(state).length === 0) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
return JSON.stringify(JSONFunctions.serialize(state));
|
|
139
|
+
} catch (err) {
|
|
140
|
+
Logger.warn(`TableFilterUrlState: could not serialize state: ${err}`);
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Query params that land a table already in a given filter/facet/view state,
|
|
147
|
+
* for *linking* to it from elsewhere in the product — a count on one page
|
|
148
|
+
* whose rows only exist on another.
|
|
149
|
+
*
|
|
150
|
+
* Values are percent-encoded here because {@link Route.addQueryParams}
|
|
151
|
+
* concatenates them into the route verbatim, while {@link read} pulls them
|
|
152
|
+
* back out through `URLSearchParams`, which decodes. Serialized facet state
|
|
153
|
+
* is JSON, so leaving it raw would produce a URL the reader cannot parse.
|
|
154
|
+
*
|
|
155
|
+
* Empty slices are omitted rather than written as an empty param — the
|
|
156
|
+
* absence of the param is what "no state" already means to {@link read}.
|
|
157
|
+
*/
|
|
158
|
+
public static getLinkQueryParams(
|
|
159
|
+
tableId: string,
|
|
160
|
+
states: Partial<Record<TableFilterUrlStateKind, JSONObject | null>>,
|
|
161
|
+
): Dictionary<string> {
|
|
162
|
+
const params: Dictionary<string> = {};
|
|
163
|
+
|
|
164
|
+
for (const kind of Object.keys(states) as Array<TableFilterUrlStateKind>) {
|
|
165
|
+
const value: string | null = this.serializeState(states[kind]);
|
|
166
|
+
|
|
167
|
+
if (value === null) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
params[this.getParamName(tableId, kind)] = encodeURIComponent(value);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return params;
|
|
175
|
+
}
|
|
176
|
+
|
|
124
177
|
/*
|
|
125
178
|
* Read a previously-persisted snapshot from the URL. Returns null when absent,
|
|
126
179
|
* empty, or unparseable (e.g. a hand-edited param) so callers fall back to
|
|
@@ -195,26 +248,12 @@ export default class TableFilterUrlState {
|
|
|
195
248
|
const state: JSONObject | null | undefined = states[kind];
|
|
196
249
|
const paramName: string = this.getParamName(tableId, kind);
|
|
197
250
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
value = hasState
|
|
206
|
-
? JSON.stringify(JSONFunctions.serialize(state as JSONObject))
|
|
207
|
-
: null;
|
|
208
|
-
} catch (err) {
|
|
209
|
-
/*
|
|
210
|
-
* Serialization failure (shouldn't happen for filter data) — drop the
|
|
211
|
-
* param rather than break the table, and leave a breadcrumb.
|
|
212
|
-
*/
|
|
213
|
-
Logger.warn(
|
|
214
|
-
`TableFilterUrlState: could not serialize "${paramName}": ${err}`,
|
|
215
|
-
);
|
|
216
|
-
value = null;
|
|
217
|
-
}
|
|
251
|
+
/*
|
|
252
|
+
* A serialization failure (shouldn't happen for filter data) drops the
|
|
253
|
+
* param rather than breaking the table; serializeState leaves the
|
|
254
|
+
* breadcrumb.
|
|
255
|
+
*/
|
|
256
|
+
let value: string | null = this.serializeState(state);
|
|
218
257
|
|
|
219
258
|
if (value === null) {
|
|
220
259
|
projected.delete(paramName);
|
package/Utils/API.ts
CHANGED
|
@@ -24,6 +24,30 @@ import Sleep from "../Types/Sleep";
|
|
|
24
24
|
import type { Agent as HttpAgent } from "http";
|
|
25
25
|
import type { Agent as HttpsAgent } from "https";
|
|
26
26
|
|
|
27
|
+
/*
|
|
28
|
+
* Diagnostic summary of one settled fetch() call, retries included. Handed
|
|
29
|
+
* to RequestOptions.onRequestComplete so a caller can log WHERE a request
|
|
30
|
+
* went wrong without having to wrap every one of its call sites.
|
|
31
|
+
*/
|
|
32
|
+
export interface RequestOutcome {
|
|
33
|
+
method: HTTPMethod;
|
|
34
|
+
url: string;
|
|
35
|
+
elapsedInMs: number;
|
|
36
|
+
attempts: number;
|
|
37
|
+
timeoutInMs?: number | undefined;
|
|
38
|
+
// Set whenever the server answered at all — including 4xx/5xx.
|
|
39
|
+
statusCode?: number | undefined;
|
|
40
|
+
// Set when the request failed without a usable response.
|
|
41
|
+
error?: Error | undefined;
|
|
42
|
+
/*
|
|
43
|
+
* The raw axios error, when there was one. It carries the ClientRequest
|
|
44
|
+
* and its socket, which is what tells "we never got a socket" apart from
|
|
45
|
+
* "we connected and the server never replied" — the difference between a
|
|
46
|
+
* client-side and a server-side timeout.
|
|
47
|
+
*/
|
|
48
|
+
axiosError?: AxiosError | undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
27
51
|
export interface RequestOptions {
|
|
28
52
|
retries?: number | undefined;
|
|
29
53
|
exponentialBackoff?: boolean | undefined;
|
|
@@ -35,6 +59,12 @@ export interface RequestOptions {
|
|
|
35
59
|
skipAuthRefresh?: boolean | undefined;
|
|
36
60
|
hasAttemptedAuthRefresh?: boolean | undefined;
|
|
37
61
|
onUploadProgress?: ((event: AxiosProgressEvent) => void) | undefined;
|
|
62
|
+
/*
|
|
63
|
+
* Purely diagnostic observer, called once after the request settles. It
|
|
64
|
+
* cannot change the result and anything it throws is swallowed, so a
|
|
65
|
+
* broken logger can never break a request.
|
|
66
|
+
*/
|
|
67
|
+
onRequestComplete?: ((outcome: RequestOutcome) => void) | undefined;
|
|
38
68
|
}
|
|
39
69
|
|
|
40
70
|
export interface APIRequestOptions {
|
|
@@ -366,6 +396,9 @@ export default class API {
|
|
|
366
396
|
url.addQueryParams(params);
|
|
367
397
|
}
|
|
368
398
|
|
|
399
|
+
const requestStartedAtInMs: number = Date.now();
|
|
400
|
+
let attempts: number = 0;
|
|
401
|
+
|
|
369
402
|
try {
|
|
370
403
|
const finalHeaders: Dictionary<string> = {
|
|
371
404
|
...apiHeaders,
|
|
@@ -392,6 +425,7 @@ export default class API {
|
|
|
392
425
|
|
|
393
426
|
while (currentRetry <= maxRetries) {
|
|
394
427
|
currentRetry++;
|
|
428
|
+
attempts++;
|
|
395
429
|
try {
|
|
396
430
|
const axiosOptions: AxiosRequestConfig = {
|
|
397
431
|
method: method,
|
|
@@ -451,15 +485,63 @@ export default class API {
|
|
|
451
485
|
result.headers as Dictionary<string>,
|
|
452
486
|
);
|
|
453
487
|
|
|
488
|
+
this.notifyRequestComplete(options, {
|
|
489
|
+
method: method,
|
|
490
|
+
url: url.toString(),
|
|
491
|
+
elapsedInMs: Date.now() - requestStartedAtInMs,
|
|
492
|
+
attempts: attempts,
|
|
493
|
+
...(options?.timeout === undefined
|
|
494
|
+
? {}
|
|
495
|
+
: { timeoutInMs: options.timeout }),
|
|
496
|
+
statusCode: result.status,
|
|
497
|
+
});
|
|
498
|
+
|
|
454
499
|
return response;
|
|
455
500
|
} catch (e) {
|
|
456
501
|
const error: Error | AxiosError = e as Error | AxiosError;
|
|
457
502
|
|
|
503
|
+
const elapsedInMs: number = Date.now() - requestStartedAtInMs;
|
|
504
|
+
|
|
505
|
+
const baseOutcome: RequestOutcome = {
|
|
506
|
+
method: method,
|
|
507
|
+
url: url.toString(),
|
|
508
|
+
elapsedInMs: elapsedInMs,
|
|
509
|
+
attempts: attempts,
|
|
510
|
+
...(options?.timeout === undefined
|
|
511
|
+
? {}
|
|
512
|
+
: { timeoutInMs: options.timeout }),
|
|
513
|
+
};
|
|
514
|
+
|
|
458
515
|
if (!axios.isAxiosError(error)) {
|
|
459
|
-
|
|
516
|
+
const apiException: APIException = new APIException(error.message);
|
|
517
|
+
|
|
518
|
+
this.notifyRequestComplete(options, {
|
|
519
|
+
...baseOutcome,
|
|
520
|
+
error: apiException,
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
throw apiException;
|
|
460
524
|
}
|
|
461
525
|
|
|
462
|
-
|
|
526
|
+
let errorResponse: HTTPErrorResponse;
|
|
527
|
+
|
|
528
|
+
/*
|
|
529
|
+
* getErrorResponse THROWS for a request that never produced a
|
|
530
|
+
* response (timeout, DNS failure, connection refused) — which is
|
|
531
|
+
* precisely the case worth reporting, so it has to be observed here
|
|
532
|
+
* rather than on the return path below.
|
|
533
|
+
*/
|
|
534
|
+
try {
|
|
535
|
+
errorResponse = this.getErrorResponse(error);
|
|
536
|
+
} catch (thrownError) {
|
|
537
|
+
this.notifyRequestComplete(options, {
|
|
538
|
+
...baseOutcome,
|
|
539
|
+
error: thrownError as Error,
|
|
540
|
+
axiosError: error,
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
throw thrownError;
|
|
544
|
+
}
|
|
463
545
|
|
|
464
546
|
if (
|
|
465
547
|
error.response?.status === 401 &&
|
|
@@ -512,10 +594,32 @@ export default class API {
|
|
|
512
594
|
}
|
|
513
595
|
|
|
514
596
|
this.handleError(errorResponse);
|
|
597
|
+
|
|
598
|
+
this.notifyRequestComplete(options, {
|
|
599
|
+
...baseOutcome,
|
|
600
|
+
statusCode: errorResponse.statusCode,
|
|
601
|
+
axiosError: error,
|
|
602
|
+
});
|
|
603
|
+
|
|
515
604
|
return errorResponse;
|
|
516
605
|
}
|
|
517
606
|
}
|
|
518
607
|
|
|
608
|
+
private static notifyRequestComplete(
|
|
609
|
+
options: RequestOptions | undefined,
|
|
610
|
+
outcome: RequestOutcome,
|
|
611
|
+
): void {
|
|
612
|
+
if (!options?.onRequestComplete) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
try {
|
|
617
|
+
options.onRequestComplete(outcome);
|
|
618
|
+
} catch {
|
|
619
|
+
// Diagnostics must never change the fate of the request they describe.
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
519
623
|
private static getErrorResponse(error: AxiosError): HTTPErrorResponse {
|
|
520
624
|
if (error.response) {
|
|
521
625
|
return new HTTPErrorResponse(
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The rules behind the "Monitor Summary" probe picker.
|
|
3
|
+
*
|
|
4
|
+
* That card used to be fed every probe in the project plus every global probe,
|
|
5
|
+
* not the probes attached to the monitor being viewed. Choosing one of the
|
|
6
|
+
* strangers answered "No summary available for the selected probe. Should be
|
|
7
|
+
* few minutes for summary to show up." about data that could never arrive -
|
|
8
|
+
* and because the list is project-probes-first, the card frequently *opened*
|
|
9
|
+
* on one. Users read that as "I changed the probe and it was not applied".
|
|
10
|
+
*
|
|
11
|
+
* The picker is a view filter over data that already exists. It cannot change
|
|
12
|
+
* which probe monitors a resource (that is a MonitorProbe row, edited under
|
|
13
|
+
* Monitor > Probes), so it must never offer a probe that does not.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export interface AttachedProbe {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
isEnabled: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum MonitorSummaryProbeState {
|
|
23
|
+
// Nothing is monitoring this resource at all.
|
|
24
|
+
NoProbesAttached = "NoProbesAttached",
|
|
25
|
+
// The selected probe is attached but switched off, so it will never report.
|
|
26
|
+
SelectedProbeDisabled = "SelectedProbeDisabled",
|
|
27
|
+
// Attached and enabled, but it has not reported yet. Waiting is the answer.
|
|
28
|
+
AwaitingFirstResult = "AwaitingFirstResult",
|
|
29
|
+
// There is something to render.
|
|
30
|
+
HasResults = "HasResults",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default class MonitorSummaryProbeUtil {
|
|
34
|
+
/*
|
|
35
|
+
* Which probe the card should show. Keeps the user's choice as long as that
|
|
36
|
+
* probe is still attached: this runs whenever the probe list is handed down
|
|
37
|
+
* again, and unconditionally resetting to the first entry is indistinguishable
|
|
38
|
+
* from a selection that refuses to stick.
|
|
39
|
+
*
|
|
40
|
+
* With no usable previous choice it prefers an enabled probe, because a
|
|
41
|
+
* disabled one has nothing to show and opening there reads as broken.
|
|
42
|
+
*/
|
|
43
|
+
public static resolveSelectedProbeId(data: {
|
|
44
|
+
probes: Array<AttachedProbe>;
|
|
45
|
+
currentlySelectedProbeId?: string | null | undefined;
|
|
46
|
+
}): string | null {
|
|
47
|
+
const probes: Array<AttachedProbe> = (data.probes || []).filter(
|
|
48
|
+
(probe: AttachedProbe) => {
|
|
49
|
+
return Boolean(probe && probe.id);
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
if (probes.length === 0) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (data.currentlySelectedProbeId) {
|
|
58
|
+
const stillAttached: AttachedProbe | undefined = probes.find(
|
|
59
|
+
(probe: AttachedProbe) => {
|
|
60
|
+
return probe.id === data.currentlySelectedProbeId;
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
if (stillAttached) {
|
|
65
|
+
return stillAttached.id;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const firstEnabledProbe: AttachedProbe | undefined = probes.find(
|
|
70
|
+
(probe: AttachedProbe) => {
|
|
71
|
+
return probe.isEnabled;
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return (firstEnabledProbe || (probes[0] as AttachedProbe)).id;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* The option labels. A disabled probe stays on the list - the user may well
|
|
80
|
+
* want to look at what it collected before it was switched off - but saying
|
|
81
|
+
* so is what stops "no summary" from looking like a bug.
|
|
82
|
+
*/
|
|
83
|
+
public static getProbeDropdownOptions(data: {
|
|
84
|
+
probes: Array<AttachedProbe>;
|
|
85
|
+
}): Array<{ label: string; value: string }> {
|
|
86
|
+
return (data.probes || [])
|
|
87
|
+
.filter((probe: AttachedProbe) => {
|
|
88
|
+
return Boolean(probe && probe.id);
|
|
89
|
+
})
|
|
90
|
+
.map((probe: AttachedProbe) => {
|
|
91
|
+
const name: string = probe.name || "Unknown";
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
label: probe.isEnabled ? name : `${name} (disabled)`,
|
|
95
|
+
value: probe.id,
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
* Why the card has nothing to render. "No data yet", "this probe is off" and
|
|
102
|
+
* "nothing is watching this monitor" are three different situations, and
|
|
103
|
+
* telling the user to wait a few minutes for the last two is exactly how a
|
|
104
|
+
* probe change comes to look like it never applied.
|
|
105
|
+
*/
|
|
106
|
+
public static getProbeState(data: {
|
|
107
|
+
isProbeableMonitor: boolean;
|
|
108
|
+
attachedProbeCount: number;
|
|
109
|
+
isSelectedProbeEnabled: boolean;
|
|
110
|
+
probeResponseCount: number;
|
|
111
|
+
}): MonitorSummaryProbeState {
|
|
112
|
+
if (data.probeResponseCount > 0) {
|
|
113
|
+
return MonitorSummaryProbeState.HasResults;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
* Non-probeable monitors (server, incoming request, telemetry...) have no
|
|
118
|
+
* probes by design, so their empty state is not a probe problem.
|
|
119
|
+
*/
|
|
120
|
+
if (data.isProbeableMonitor && data.attachedProbeCount === 0) {
|
|
121
|
+
return MonitorSummaryProbeState.NoProbesAttached;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (!data.isSelectedProbeEnabled) {
|
|
125
|
+
return MonitorSummaryProbeState.SelectedProbeDisabled;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return MonitorSummaryProbeState.AwaitingFirstResult;
|
|
129
|
+
}
|
|
130
|
+
}
|