@oneuptime/common 14.0.8 → 14.0.9
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/Index.ts +2 -0
- package/Models/DatabaseModels/KubernetesAiAgent.ts +364 -0
- package/Models/DatabaseModels/KubernetesCluster.ts +3 -3
- package/Models/DatabaseModels/Project.ts +55 -5
- package/Models/DatabaseModels/ProxmoxResource.ts +49 -1
- package/Models/DatabaseModels/RunnerJob.ts +75 -0
- package/Models/DatabaseModels/TeamComplianceSetting.ts +143 -2
- package/Models/DatabaseModels/WorkspaceProjectAuthToken.ts +17 -0
- package/Server/API/AIChatAPI.ts +6 -3
- package/Server/API/AIInvestigationAPI.ts +17 -10
- package/Server/API/AutoRemediationAPI.ts +207 -25
- package/Server/API/KubernetesClusterAiAccessAPI.ts +623 -21
- package/Server/API/MicrosoftTeamsAPI.ts +93 -14
- package/Server/API/ProxmoxResourceAPI.ts +244 -14
- package/Server/Infrastructure/GlobalCache.ts +32 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796000000000-AddTeamComplianceRuleScope.ts +99 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796100000000-AddKubernetesAiAgentAndAiDefaults.ts +137 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796200000000-AddProxmoxResourceNativePushColumns.ts +42 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
- package/Server/Middleware/TelemetryIngest.ts +41 -18
- package/Server/Services/AIService.ts +70 -1
- package/Server/Services/AlertService.ts +352 -11
- package/Server/Services/AlertSeverityService.ts +65 -15
- package/Server/Services/AutoRemediationRuleService.ts +1 -1
- package/Server/Services/IncidentService.ts +280 -104
- package/Server/Services/IncidentSeverityService.ts +66 -15
- package/Server/Services/KubernetesAiAgentJobService.ts +185 -0
- package/Server/Services/KubernetesAiAgentService.ts +1634 -0
- package/Server/Services/KubernetesClusterAiAccessService.ts +1118 -451
- package/Server/Services/KubernetesClusterService.ts +129 -21
- package/Server/Services/ProjectService.ts +32 -0
- package/Server/Services/ProxmoxResourceService.ts +322 -5
- package/Server/Services/RunnerJobService.ts +241 -104
- package/Server/Services/RunnerService.ts +1 -1
- package/Server/Services/ScheduledMaintenanceService.ts +737 -1
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +414 -56
- package/Server/Services/TeamComplianceSettingService.ts +1125 -9
- package/Server/Utils/AI/ClusterAccess/ClusterAccessContext.ts +67 -9
- package/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.ts +39 -10
- package/Server/Utils/AI/ClusterAccess/KubectlJobRunner.ts +14 -3
- package/Server/Utils/AI/Remediation/RemediationCommandTools.ts +37 -15
- package/Server/Utils/AI/Remediation/RemediationExecutionRunner.ts +67 -24
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +48 -5
- package/Server/Utils/AI/SRE/IncidentPostmortemRunner.ts +40 -8
- package/Server/Utils/AI/SRE/InvestigationEligibility.ts +13 -2
- package/Server/Utils/AI/SRE/InvestigationGrader.ts +1 -1
- package/Server/Utils/AutoRemediation/CommandPlanExecutor.ts +6 -1
- package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +133 -7
- package/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.ts +58 -4
- package/Server/Utils/Telemetry/ProxmoxNativeNodeLiveness.ts +447 -0
- package/Server/Utils/Telemetry/ProxmoxNativePush.ts +903 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +87 -27
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +684 -47
- package/Tests/App/AdminDashboard/RowActionPlacementOverrides.test.tsx +278 -0
- package/Tests/App/Dashboard/AIChatChartWidgetZoom.test.tsx +738 -0
- package/Tests/App/Dashboard/AIFeaturesSettingsPointers.test.tsx +147 -0
- package/Tests/App/Dashboard/AIInsightsKubernetesClusterPage.test.tsx +1523 -0
- package/Tests/App/Dashboard/AdminUserNotificationMethodsPage.test.tsx +463 -3
- package/Tests/App/Dashboard/AffectedResourcesPickerDropdownPlacement.test.tsx +958 -0
- package/Tests/App/Dashboard/AffectedResourcesPickerFocusLeave.test.tsx +595 -0
- package/Tests/App/Dashboard/AskAiAvailability.test.ts +20 -3
- package/Tests/App/Dashboard/AskAiDisabled.test.tsx +8 -3
- package/Tests/App/Dashboard/CephRateChartReload.test.tsx +1456 -0
- package/Tests/App/Dashboard/CephTimeRangeZoom.test.tsx +1229 -0
- package/Tests/App/Dashboard/ChartCardTimeRangeZoom.test.tsx +151 -0
- package/Tests/App/Dashboard/ChartCardZoomAffordances.test.tsx +257 -0
- package/Tests/App/Dashboard/ChartRefetchFrame.test.tsx +141 -0
- package/Tests/App/Dashboard/ChartZoomHarness.tsx +249 -0
- package/Tests/App/Dashboard/ChartZoomStandIn.tsx +131 -0
- package/Tests/App/Dashboard/CloudServerlessSlowLoads.test.tsx +628 -0
- package/Tests/App/Dashboard/CloudServerlessTimeRangeZoom.test.tsx +607 -0
- package/Tests/App/Dashboard/ClusterAccessNotice.test.tsx +91 -19
- package/Tests/App/Dashboard/CompanionMetricsTabZoom.test.tsx +632 -0
- package/Tests/App/Dashboard/ContainerChartZoomStandIn.tsx +195 -0
- package/Tests/App/Dashboard/ContainerHostOverviewSlowLoads.test.tsx +542 -0
- package/Tests/App/Dashboard/ContainerHostOverviewTimeRangeZoom.test.tsx +848 -0
- package/Tests/App/Dashboard/ContainerMetricsTimeRangeZoom.test.tsx +561 -0
- package/Tests/App/Dashboard/DashboardBoardWideZoomShell.test.tsx +1147 -0
- package/Tests/App/Dashboard/DashboardEditPermissions.test.tsx +3 -2
- package/Tests/App/Dashboard/DashboardHistogramWidgetDragCursor.test.tsx +399 -0
- package/Tests/App/Dashboard/DashboardHistogramWidgetZoom.test.tsx +985 -0
- package/Tests/App/Dashboard/DashboardHistogramWidgetZoomHint.test.tsx +803 -0
- package/Tests/App/Dashboard/DashboardLazyPages.test.tsx +1 -0
- package/Tests/App/Dashboard/DashboardSettingsPreviewZoom.test.tsx +679 -0
- package/Tests/App/Dashboard/DashboardSloAndDataSourceChartZoom.test.tsx +881 -0
- package/Tests/App/Dashboard/DashboardTraceStatusWidgets.test.tsx +878 -0
- package/Tests/App/Dashboard/DatabaseMetricChartModalTimeRangeZoom.test.tsx +442 -0
- package/Tests/App/Dashboard/DatabaseOverviewTimeRangeZoom.test.tsx +831 -0
- package/Tests/App/Dashboard/DatabaseServerComponents.test.tsx +43 -0
- package/Tests/App/Dashboard/DockerSwarmInsightsTimeRangeZoom.test.tsx +524 -0
- package/Tests/App/Dashboard/DockerSwarmRateChartRefresh.test.tsx +259 -0
- package/Tests/App/Dashboard/EdgeDetailPanelHistory.test.tsx +763 -0
- package/Tests/App/Dashboard/EdgeDetailPanelTimeRangeZoom.test.tsx +547 -0
- package/Tests/App/Dashboard/EdgeHistoryBucketsCases.tsx +565 -0
- package/Tests/App/Dashboard/EdgeHistoryBucketsKathmandu.test.tsx +73 -0
- package/Tests/App/Dashboard/EdgeHistoryBucketsKolkata.test.tsx +74 -0
- package/Tests/App/Dashboard/EdgeHistoryBucketsNewYork.test.tsx +72 -0
- package/Tests/App/Dashboard/EdgeHistoryBucketsUtc.test.tsx +72 -0
- package/Tests/App/Dashboard/EmbeddedMetricCardRefresh.test.tsx +310 -0
- package/Tests/App/Dashboard/EmbeddedMetricCardTimeRangeZoom.test.tsx +536 -0
- package/Tests/App/Dashboard/EscalationRuleReadiness.test.tsx +3 -1
- package/Tests/App/Dashboard/EscalationRuleRowActions.test.tsx +660 -0
- package/Tests/App/Dashboard/EventNotes.test.tsx +2 -2
- package/Tests/App/Dashboard/EventOverviewPages.test.tsx +587 -13
- package/Tests/App/Dashboard/EventOverviewSnapshotExplorerZoom.test.tsx +1139 -0
- package/Tests/App/Dashboard/EventOverviewSnapshotZoomAcrossTabs.test.tsx +1057 -0
- package/Tests/App/Dashboard/EventOverviewTelemetrySnapshotZoom.test.tsx +757 -0
- package/Tests/App/Dashboard/ExceptionOccurrenceTrendZoom.test.tsx +675 -0
- package/Tests/App/Dashboard/ExceptionOccurrencesZoomSurvivesViewSwitch.test.tsx +405 -0
- package/Tests/App/Dashboard/ExceptionSignalPages.test.tsx +67 -3
- package/Tests/App/Dashboard/ExceptionTablesSpanStatus.test.tsx +515 -0
- package/Tests/App/Dashboard/ExplorerOwnZoomRegression.test.tsx +739 -0
- package/Tests/App/Dashboard/FlowBandwidthAxisCases.tsx +461 -0
- package/Tests/App/Dashboard/FlowBandwidthAxisKathmandu.test.tsx +25 -0
- package/Tests/App/Dashboard/FlowBandwidthAxisKolkata.test.tsx +25 -0
- package/Tests/App/Dashboard/FlowBandwidthAxisNewYork.test.tsx +25 -0
- package/Tests/App/Dashboard/FlowBandwidthAxisUtc.test.tsx +24 -0
- package/Tests/App/Dashboard/FlowTopTalkersZoomRefetch.test.tsx +722 -0
- package/Tests/App/Dashboard/FlowViewportGuard.test.tsx +2526 -0
- package/Tests/App/Dashboard/HostPagesSlowLoads.test.tsx +872 -0
- package/Tests/App/Dashboard/HostPagesTimeRangeZoom.test.tsx +1208 -0
- package/Tests/App/Dashboard/IncidentRootCauseTimeRangeZoom.test.tsx +358 -0
- package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +100 -9
- package/Tests/App/Dashboard/InfrastructureMetricsTabTimeRangeZoom.test.tsx +485 -0
- package/Tests/App/Dashboard/InvestigationDrawerCompanionZoom.test.tsx +655 -0
- package/Tests/App/Dashboard/InvestigationDrawerZoom.test.tsx +830 -0
- package/Tests/App/Dashboard/InvestigationNotStarted.test.tsx +338 -2
- package/Tests/App/Dashboard/InvoicesPayInvoice.test.tsx +454 -16
- package/Tests/App/Dashboard/KubernetesClusterAiAccessSettings.test.ts +799 -819
- package/Tests/App/Dashboard/KubernetesClusterAiAgentOverviewCard.test.tsx +367 -0
- package/Tests/App/Dashboard/KubernetesClusterAiAgentStatus.test.ts +1202 -0
- package/Tests/App/Dashboard/KubernetesClusterAiDocumentationMarkdown.test.ts +106 -0
- package/Tests/App/Dashboard/KubernetesClusterAiNavigation.test.tsx +354 -0
- package/Tests/App/Dashboard/KubernetesClusterAiPage.test.tsx +1884 -2054
- package/Tests/App/Dashboard/KubernetesClusterAiPageServerParity.test.ts +478 -179
- package/Tests/App/Dashboard/KubernetesClusterMetricTooltips.test.ts +50 -0
- package/Tests/App/Dashboard/KubernetesClusterOverviewTooltips.test.tsx +2 -1
- package/Tests/App/Dashboard/KubernetesClusterOverviewZoom.test.tsx +1217 -0
- package/Tests/App/Dashboard/KubernetesClusterPagesZoom.test.tsx +731 -0
- package/Tests/App/Dashboard/KubernetesCostsLoadRecovery.test.tsx +869 -0
- package/Tests/App/Dashboard/KubernetesCostsZoom.test.tsx +1214 -0
- package/Tests/App/Dashboard/KubernetesCostsZoomExactHours.test.tsx +692 -0
- package/Tests/App/Dashboard/KubernetesNetworkThroughputReload.test.tsx +902 -0
- package/Tests/App/Dashboard/KubernetesNetworkZoomBucketEdges.test.tsx +571 -0
- package/Tests/App/Dashboard/KubernetesOverviewZoomBucketEdges.test.tsx +697 -0
- package/Tests/App/Dashboard/KubernetesResourceMetricsTabZoom.test.tsx +633 -0
- package/Tests/App/Dashboard/LogsExplorerTimeRangeZoom.test.tsx +470 -0
- package/Tests/App/Dashboard/LogsInsightsTimeRangeZoom.test.tsx +948 -0
- package/Tests/App/Dashboard/LogsViewerPinnedWindowZoom.test.tsx +486 -0
- package/Tests/App/Dashboard/MetricChartsBucketInspectorDoubleClick.test.tsx +1001 -0
- package/Tests/App/Dashboard/MetricExplorerInvestigationAutoRefresh.test.tsx +514 -0
- package/Tests/App/Dashboard/MetricExplorerSavedViewZoomRoundTrip.test.tsx +581 -0
- package/Tests/App/Dashboard/MetricExplorerTimeRangeZoom.test.tsx +1162 -0
- package/Tests/App/Dashboard/MetricMonitorPreviewZoomLabel.test.ts +72 -0
- package/Tests/App/Dashboard/MetricRowSparklineTimeRangeZoom.test.tsx +204 -0
- package/Tests/App/Dashboard/MetricViewFirstResultLands.test.tsx +408 -0
- package/Tests/App/Dashboard/MetricViewOwnZoomResetPlacement.test.tsx +952 -0
- package/Tests/App/Dashboard/MetricViewTimeRange.test.ts +139 -0
- package/Tests/App/Dashboard/MetricViewTimeRangeZoom.test.tsx +556 -0
- package/Tests/App/Dashboard/MonitorMetricsChartWrappersZoom.test.tsx +552 -0
- package/Tests/App/Dashboard/MonitorMetricsTabsTimeRangeZoom.test.tsx +740 -0
- package/Tests/App/Dashboard/MonitorOverviewChartsTimeRangeZoom.test.tsx +735 -0
- package/Tests/App/Dashboard/MonitorStepPreviewsTimeRangeZoom.test.tsx +835 -0
- package/Tests/App/Dashboard/NetworkDeviceTimeRangeZoom.test.tsx +1115 -0
- package/Tests/App/Dashboard/OnCallPreventionGuards.test.tsx +186 -17
- package/Tests/App/Dashboard/OnCallRulesDeleteGuard.test.tsx +155 -46
- package/Tests/App/Dashboard/PasskeySettings.test.tsx +87 -2
- package/Tests/App/Dashboard/ProjectAISettingsPages.test.tsx +884 -0
- package/Tests/App/Dashboard/ProxmoxNodeRemove.test.tsx +621 -0
- package/Tests/App/Dashboard/ProxmoxOverviewSlowLoads.test.tsx +584 -0
- package/Tests/App/Dashboard/ProxmoxPagesTimeRangeZoom.test.tsx +823 -0
- package/Tests/App/Dashboard/ProxmoxRateChartReload.test.tsx +1253 -0
- package/Tests/App/Dashboard/PublicDashboardBoardWideZoom.test.tsx +605 -0
- package/Tests/App/Dashboard/RealRowsLineChart.tsx +250 -0
- package/Tests/App/Dashboard/RechartsHostsPlotCursor.test.tsx +513 -0
- package/Tests/App/Dashboard/RowActionPlacementOverrides.test.tsx +865 -0
- package/Tests/App/Dashboard/RumOverviewTimeRangeZoom.test.tsx +877 -0
- package/Tests/App/Dashboard/RunnerKubernetesAgentForm.test.tsx +20 -4
- package/Tests/App/Dashboard/RunnerSupersededByAiAgentNote.test.tsx +296 -0
- package/Tests/App/Dashboard/SecurityEventConnectionsTable.test.tsx +146 -36
- package/Tests/App/Dashboard/ServiceDatabaseSlowLoads.test.tsx +1166 -0
- package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +1243 -104
- package/Tests/App/Dashboard/ServiceOverviewTimeRangeZoom.test.tsx +792 -0
- package/Tests/App/Dashboard/SloBudgetBurnDownZoom.test.tsx +771 -0
- package/Tests/App/Dashboard/SloBudgetBurnDownZoomAffordances.test.tsx +380 -0
- package/Tests/App/Dashboard/SloEventMetricsBarChartZoom.test.tsx +369 -0
- package/Tests/App/Dashboard/SloHistoryChartsTimeRangeZoom.test.tsx +694 -0
- package/Tests/App/Dashboard/SloHistoryChartsZoomAffordances.test.tsx +497 -0
- package/Tests/App/Dashboard/SloMetricsTimeRangeZoom.test.tsx +541 -0
- package/Tests/App/Dashboard/SlowLoadHarness.ts +123 -0
- package/Tests/App/Dashboard/SnapshotExplorerPrimaryZoom.test.tsx +1194 -0
- package/Tests/App/Dashboard/SnapshotViewerPinnedWindow.test.tsx +620 -0
- package/Tests/App/Dashboard/TelemetrySnapshotPanelTimeRangeZoom.test.tsx +765 -0
- package/Tests/App/Dashboard/TelemetrySnapshotZoom.test.tsx +516 -0
- package/Tests/App/Dashboard/TelemetrySnapshotZoomAcrossTabs.test.tsx +827 -0
- package/Tests/App/Dashboard/TimeRangeZoomPageHarness.tsx +463 -0
- package/Tests/App/Dashboard/TraceChartEditorStatusSplit.test.tsx +543 -0
- package/Tests/App/Dashboard/TraceStatusPresentation.test.tsx +967 -0
- package/Tests/App/Dashboard/TraceTimelineMinimapZoom.test.tsx +315 -0
- package/Tests/App/Dashboard/TracesAnalyticsStatusSplit.test.tsx +778 -0
- package/Tests/App/Dashboard/TracesAnalyticsViewZoom.test.tsx +349 -0
- package/Tests/App/Dashboard/TracesExplorerTimeRangeZoom.test.tsx +551 -0
- package/Tests/App/Dashboard/TracesStatusChartAndFacet.test.tsx +687 -0
- package/Tests/App/Dashboard/TracesViewerStaleResponses.test.tsx +458 -0
- package/Tests/App/Dashboard/UptimeStripsExcludedFromZoom.test.tsx +406 -0
- package/Tests/App/Dashboard/VMwareOverviewSlowLoads.test.tsx +535 -0
- package/Tests/App/Dashboard/VMwarePagesTimeRangeZoom.test.tsx +606 -0
- package/Tests/App/Dashboard/ValueWidgetSparklineStaleHover.test.tsx +1292 -0
- package/Tests/App/Dashboard/ValueWidgetSparklineZoom.test.tsx +765 -0
- package/Tests/App/StatusPage/StatusPageResourceExplorer.test.tsx +98 -0
- package/Tests/Models/DatabaseModels/KubernetesAiAgentModel.test.ts +295 -0
- package/Tests/Models/DatabaseModels/TeamComplianceSettingModel.test.ts +347 -0
- package/Tests/Server/API/AIChatRouteAuthorization.test.ts +58 -0
- package/Tests/Server/API/AIGenerationProjectAIToggle.test.ts +1 -1
- package/Tests/Server/API/AIInvestigationAPI.test.ts +123 -45
- package/Tests/Server/API/AutoRemediationApproveClusterRound.test.ts +1329 -0
- package/Tests/Server/API/AutoRemediationApproveKubectlRecheck.test.ts +25 -2
- package/Tests/Server/API/KubernetesClusterAiAccessAPI.test.ts +2 -0
- package/Tests/Server/API/KubernetesClusterAiAccessAPIAgent.test.ts +903 -0
- package/Tests/Server/API/MicrosoftTeamsChatsRefreshRoute.test.ts +667 -0
- package/Tests/Server/API/MicrosoftTeamsManifest.test.ts +294 -6
- package/Tests/Server/API/ProxmoxResourceAPIRemoveNode.test.ts +1932 -0
- package/Tests/Server/Infrastructure/GlobalCache.test.ts +195 -0
- package/Tests/Server/Infrastructure/Postgres/AddKubernetesAiAgentAndAiDefaultsMigration.test.ts +623 -0
- package/Tests/Server/Infrastructure/Postgres/AddKubernetesClusterAiAccessMigration.test.ts +87 -10
- package/Tests/Server/Infrastructure/Postgres/AddTeamComplianceRuleScopeMigration.test.ts +622 -0
- package/Tests/Server/Middleware/TelemetryIngestBrowserKey.test.ts +61 -4
- package/Tests/Server/Middleware/TelemetryIngestKubernetesAgentRunnerPinnedKey.test.ts +98 -2
- package/Tests/Server/Middleware/TelemetryIngestKubernetesAgentRunnerRateLimit.test.ts +105 -2
- package/Tests/Server/Services/AIServiceBalanceBlocker.test.ts +282 -0
- package/Tests/Server/Services/AlertMonitorClearWritesNull.test.ts +409 -0
- package/Tests/Server/Services/AlertMonitorEditFeed.test.ts +474 -0
- package/Tests/Server/Services/AlertMonitorEditGuard.test.ts +610 -0
- package/Tests/Server/Services/AutoRemediationClusterRuleEngine.test.ts +2 -0
- package/Tests/Server/Services/AutoRemediationRuleCommandRunners.test.ts +2 -1
- package/Tests/Server/Services/IncidentAffectedMonitorsEdit.test.ts +1360 -0
- package/Tests/Server/Services/IncidentAlertSloLinkSurvivesEdit.test.ts +3 -1
- package/Tests/Server/Services/IncidentSeverityDeletePausesComplianceRules.test.ts +488 -0
- package/Tests/Server/Services/KubernetesAiAgentJobService.test.ts +329 -0
- package/Tests/Server/Services/KubernetesAiAgentServiceHelpers.test.ts +618 -0
- package/Tests/Server/Services/KubernetesAiAgentServiceLifecycle.test.ts +1444 -0
- package/Tests/Server/Services/KubernetesAiAgentServiceRegister.test.ts +1666 -0
- package/Tests/Server/Services/KubernetesClusterAiAccessDeletedRunnerRemedy.test.ts +140 -111
- package/Tests/Server/Services/KubernetesClusterAiAccessGapNextSteps.test.ts +267 -105
- package/Tests/Server/Services/KubernetesClusterAiAccessLegacySuperseded.test.ts +440 -0
- package/Tests/Server/Services/KubernetesClusterAiAccessService.test.ts +567 -411
- package/Tests/Server/Services/KubernetesClusterAiAccessTarget.test.ts +1168 -0
- package/Tests/Server/Services/KubernetesClusterAiSettingsPermission.test.ts +410 -12
- package/Tests/Server/Services/KubernetesClusterServiceAiAccessFeed.test.ts +55 -0
- package/Tests/Server/Services/ProjectServiceNewProjectAiDefaults.test.ts +288 -0
- package/Tests/Server/Services/ProxmoxResourcePostgres.test.ts +5633 -0
- package/Tests/Server/Services/ProxmoxResourceService.test.ts +6458 -5
- package/Tests/Server/Services/RunnerJobEnqueueKubectl.test.ts +48 -15
- package/Tests/Server/Services/RunnerJobEnqueueKubectlAiAgent.test.ts +620 -0
- package/Tests/Server/Services/RunnerJobKubectlWriteScope.test.ts +170 -3
- package/Tests/Server/Services/RunnerJobTimeoutReason.test.ts +72 -0
- package/Tests/Server/Services/RunnerServiceAgentName.test.ts +6 -4
- package/Tests/Server/Services/ScheduledMaintenanceAttachmentEdit.test.ts +2113 -0
- package/Tests/Server/Services/ScheduledMaintenanceMonitorRelease.test.ts +972 -0
- package/Tests/Server/Services/TeamComplianceSettingPostgres.test.ts +2237 -0
- package/Tests/Server/Services/TeamComplianceSettingService.test.ts +3988 -138
- package/Tests/Server/Utils/AI/ClusterAccessContext.test.ts +107 -1
- package/Tests/Server/Utils/AI/IncidentPostmortemRunner.test.ts +351 -0
- package/Tests/Server/Utils/AI/InvestigationClusterAccessWiring.test.ts +2 -0
- package/Tests/Server/Utils/AI/InvestigationEligibility.test.ts +310 -0
- package/Tests/Server/Utils/AI/KubectlInvestigationToolkit.test.ts +70 -0
- package/Tests/Server/Utils/AI/KubectlJobRunnerFinishedJob.test.ts +58 -0
- package/Tests/Server/Utils/AI/RemediationCommandToolsKubectl.test.ts +2 -0
- package/Tests/Server/Utils/AI/RemediationCommandToolsKubectlOutcome.test.ts +2 -0
- package/Tests/Server/Utils/AI/RemediationCommandToolsLiveCluster.test.ts +2 -0
- package/Tests/Server/Utils/AI/RemediationCommandToolsRunnerScope.test.ts +125 -1
- package/Tests/Server/Utils/AI/RemediationExecutionRunner.test.ts +252 -3
- package/Tests/Server/Utils/AI/RemediationExecutionRunnerClusterMode.test.ts +2 -0
- package/Tests/Server/Utils/AI/RemediationExecutionRunnerProjectGates.test.ts +240 -0
- package/Tests/Server/Utils/AI/RemediationKubectlCopyParity.test.ts +2 -0
- package/Tests/Server/Utils/AutoRemediation/CommandPlanExecutor.test.ts +2 -0
- package/Tests/Server/Utils/AutoRemediation/CommandPlanExecutorUnknownRun.test.ts +2 -0
- package/Tests/Server/Utils/AutoRemediation/CommandPlanVerification.test.ts +2 -0
- package/Tests/Server/Utils/Telemetry/HostAssetAttributesFromOtlp.test.ts +68 -0
- package/Tests/Server/Utils/Telemetry/InventoryMirrorPostgres.test.ts +370 -0
- package/Tests/Server/Utils/Telemetry/NetworkDeviceInventoryAttributes.test.ts +522 -0
- package/Tests/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.test.ts +155 -0
- package/Tests/Server/Utils/Telemetry/ProxmoxNativeNodeLiveness.test.ts +8631 -0
- package/Tests/Server/Utils/Telemetry/ProxmoxNativePush.test.ts +2852 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +367 -1
- package/Tests/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.test.ts +45 -3
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsChats.test.ts +25 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsGroupChatNames.test.ts +3119 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsGroupChatNamesPostgres.test.ts +1721 -0
- package/Tests/Types/Kubernetes/KubernetesAgentChartAiAccess.test.ts +581 -113
- package/Tests/Types/Kubernetes/KubernetesAiAgentAccessContract.test.ts +510 -0
- package/Tests/Types/Team/ComplianceRule.test.ts +1029 -0
- package/Tests/Types/Team/TeamComplianceStatus.test.ts +176 -0
- package/Tests/UI/Components/ActionButton/RowActions.test.tsx +641 -0
- package/Tests/UI/Components/ActionButton/RowActionsAccessibility.test.tsx +414 -0
- package/Tests/UI/Components/ActionButton/SplitActionButtons.test.ts +565 -0
- package/Tests/UI/Components/Charts/BarChartDragToSelect.test.tsx +386 -0
- package/Tests/UI/Components/Charts/ChartDoubleClickResetWithoutDblclick.test.tsx +1025 -0
- package/Tests/UI/Components/Charts/ChartGroupPageZoomHint.test.tsx +196 -0
- package/Tests/UI/Components/Charts/ChartPlaceholdersTakeDoubleClick.test.tsx +1861 -0
- package/Tests/UI/Components/Charts/ChartPlotClicksWhileResetArmed.test.tsx +382 -0
- package/Tests/UI/Components/Charts/ChartRangeSelection.test.tsx +704 -0
- package/Tests/UI/Components/Charts/ChartRangeSelectionDoubleClickReset.test.tsx +1481 -0
- package/Tests/UI/Components/Charts/ChartRangeSelectionRealRecharts.test.tsx +918 -0
- package/Tests/UI/Components/Charts/ChartRowBucketStart.test.ts +350 -0
- package/Tests/UI/Components/Charts/DoubleClickReset.test.tsx +996 -0
- package/Tests/UI/Components/Charts/HistogramDoubleClickResetRealRecharts.test.tsx +965 -0
- package/Tests/UI/Components/Charts/HistogramDriftThenRefetch.test.tsx +277 -0
- package/Tests/UI/Components/Charts/HistogramRangeSelectionDataChange.test.tsx +1757 -0
- package/Tests/UI/Components/Charts/HistogramRangeSelectionRealRecharts.test.tsx +560 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/ChartPageTimeRangeZoom.test.tsx +513 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomContext.test.tsx +845 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomHint.test.tsx +119 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomHintTailwind.test.tsx +274 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomUtil.test.ts +433 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/UseTimeRangeZoom.test.tsx +863 -0
- package/Tests/UI/Components/Charts/TimeRangeZoom/ZoomDocsPromises.test.tsx +1147 -0
- package/Tests/UI/Components/DisabledButtonTooltip.test.tsx +14 -3
- package/Tests/UI/Components/EntityDropdownEscape.test.tsx +454 -0
- package/Tests/UI/Components/EntityDropdownFocusLeave.test.tsx +420 -0
- package/Tests/UI/Components/Forms/FormFieldDropdownDisabled.test.tsx +233 -0
- package/Tests/UI/Components/Input.test.tsx +80 -1
- package/Tests/UI/Components/LogsAnalyticsViewZoom.test.tsx +947 -0
- package/Tests/UI/Components/LogsHistogramDragTooltip.test.tsx +17 -5
- package/Tests/UI/Components/LogsViewerAnalyticsZoom.test.tsx +501 -0
- package/Tests/UI/Components/LogsViewerHistogramZoom.test.tsx +1 -1
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +6 -4
- package/Tests/UI/Components/ModelTable/BaseModelTablePermissionGating.test.tsx +60 -8
- package/Tests/UI/Components/ModelTable/BaseModelTableRowActions.test.tsx +476 -0
- package/Tests/UI/Components/ModelTable/ModelTableWrapContent.test.tsx +7 -5
- package/Tests/UI/Components/MoreMenuPortal.test.tsx +623 -0
- package/Tests/UI/Components/StatusPage/ResourceGridActions.test.tsx +538 -0
- package/Tests/UI/Components/StatusPage/ResourceGridSelection.test.tsx +14 -4
- package/Tests/UI/Components/TableCellWrapping.test.tsx +3 -3
- package/Tests/UI/Components/TableRowActions.test.tsx +472 -0
- package/Tests/UI/Components/TelemetryHistogramDragTooltip.test.tsx +1 -1
- package/Tests/UI/Components/TelemetryViewer/TelemetryViewerHistogramClickZoom.test.tsx +1 -1
- package/Tests/UI/Components/TelemetryViewer/TelemetryViewerZoomScope.test.tsx +470 -0
- package/Tests/UI/Components/TelemetryViewer/UseViewerTimeRangeZoom.test.tsx +571 -0
- package/Tests/UI/Components/TelemetryViewer/ViewerDoubleClickResetUnderDataChange.test.tsx +928 -0
- package/Tests/UI/Components/TelemetryViewer/ViewerFollowsEnclosingZoom.test.tsx +1569 -0
- package/Tests/UI/Components/Toggle.test.tsx +66 -0
- package/Tests/UI/MicrosoftTeams/MicrosoftTeamsChatsCardRefreshNames.test.tsx +1023 -0
- package/Tests/UI/Rum/ChunkLoader.test.ts +201 -0
- package/Tests/UI/Rum/FidelityNotices.test.ts +54 -0
- package/Tests/UI/Rum/ReplayCorrelationPanel.test.tsx +72 -0
- package/Tests/UI/Rum/ReplayFrameCapture.test.ts +1009 -9
- package/Tests/UI/Rum/ReplayRecordedAssets.test.ts +1069 -0
- package/Tests/UI/Rum/ReplayStage.test.tsx +913 -2
- package/Tests/UI/Rum/SessionReplayTable.test.tsx +443 -8
- package/Tests/UI/Rum/SessionReplayUsersTable.test.tsx +439 -9
- package/Tests/UI/Rum/UserFlowTablesRowActions.test.tsx +501 -0
- package/Tests/Utils/AiRemediation/KubectlPolicyChartRbacParity.test.ts +47 -19
- package/Tests/Utils/AiRemediation/KubectlWriteScopeCallerParity.test.ts +2 -0
- package/Tests/Utils/AiRemediation/KubernetesAiAgentPolicyCopyParity.test.ts +396 -0
- package/Tests/Utils/Dashboard/DashboardTimeRangeZoom.test.ts +104 -1
- package/Types/AI/AIRunType.ts +9 -4
- package/Types/AI/InvestigationNotStartedReason.ts +6 -0
- package/Types/AutoRemediation/AiRemediationCommandPlan.ts +14 -16
- package/Types/AutoRemediation/AiRemediationCommandPolicyVerdict.ts +28 -0
- package/Types/Dashboard/DashboardComponents/DashboardTraceChartComponent.ts +4 -2
- package/Types/Kubernetes/KubernetesClusterAiAccess.ts +263 -32
- package/Types/Kubernetes/KubernetesClusterAiAccessPermissions.ts +20 -16
- package/Types/Kubernetes/KubernetesClusterAiInsights.ts +81 -0
- package/Types/Monitor/ProxmoxAlertTemplates.ts +4 -4
- package/Types/Team/ComplianceNotificationChannel.ts +22 -0
- package/Types/Team/ComplianceRule.ts +434 -0
- package/Types/Team/ComplianceRuleType.ts +21 -0
- package/Types/Team/TeamComplianceStatus.ts +81 -0
- package/Types/Telemetry/TelemetryIngestSurface.ts +28 -0
- package/UI/Components/ActionButton/ActionButtonSchema.ts +21 -0
- package/UI/Components/ActionButton/RowActions.tsx +238 -0
- package/UI/Components/ActionButton/SplitActionButtons.ts +173 -0
- package/UI/Components/Charts/Area/AreaChart.tsx +32 -2
- package/UI/Components/Charts/Bar/BarChart.tsx +40 -3
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +37 -11
- package/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.tsx +80 -243
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +122 -31
- package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +95 -244
- package/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.ts +214 -0
- package/UI/Components/Charts/ChartLibrary/Utils/UseChartBucketsChange.ts +32 -0
- package/UI/Components/Charts/ChartLibrary/Utils/UseChartRangeSelection.ts +599 -0
- package/UI/Components/Charts/Line/LineChart.tsx +32 -2
- package/UI/Components/Charts/TimeRangeZoom/ResetTimeRangeZoomButton.tsx +70 -0
- package/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomContext.tsx +226 -0
- package/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomHint.tsx +73 -0
- package/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomUtil.ts +163 -0
- package/UI/Components/Charts/TimeRangeZoom/UseTimeRangeZoom.ts +215 -0
- package/UI/Components/Charts/Utils/DataPoint.ts +20 -8
- package/UI/Components/Charts/Utils/XAxis.ts +75 -0
- package/UI/Components/Charts/Utils/useHistogramRangeSelection.ts +493 -59
- package/UI/Components/EntityDropdown/EntityDropdown.tsx +107 -11
- package/UI/Components/Forms/Fields/FormField.tsx +10 -0
- package/UI/Components/Input/Input.tsx +90 -57
- package/UI/Components/List/ListRow.tsx +8 -74
- package/UI/Components/LogsViewer/LogsViewer.tsx +40 -11
- package/UI/Components/LogsViewer/components/LogTimeRangePicker.tsx +22 -6
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +209 -6
- package/UI/Components/LogsViewer/components/LogsHistogram.tsx +127 -84
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +3 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +12 -1
- package/UI/Components/MoreMenu/MoreMenu.tsx +365 -30
- package/UI/Components/MoreMenu/MoreMenuItem.tsx +70 -17
- package/UI/Components/OrderedStatesList/Item.tsx +7 -72
- package/UI/Components/StatusPage/ResourceGrid.tsx +126 -77
- package/UI/Components/Table/TableBody.tsx +8 -2
- package/UI/Components/Table/TableRow.tsx +20 -140
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +41 -10
- package/UI/Components/TelemetryViewer/components/TelemetryHistogram.tsx +47 -9
- package/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.tsx +25 -6
- package/UI/Components/TelemetryViewer/types.ts +2 -0
- package/UI/Components/TelemetryViewer/useViewerTimeRangeZoom.ts +448 -0
- package/UI/Components/Toggle/Toggle.tsx +26 -0
- package/UI/Components/Tooltip/Tooltip.tsx +8 -1
- package/UI/Styles/Theme.css +14 -2
- package/Utils/AiRemediation/CommandPolicy.ts +1 -1
- package/Utils/AiRemediation/KubectlPolicy.ts +1 -1
- package/Utils/Dashboard/DashboardTimeRangeZoom.ts +46 -2
- package/build/dist/Models/DatabaseModels/Index.js +2 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/KubernetesAiAgent.js +385 -0
- package/build/dist/Models/DatabaseModels/KubernetesAiAgent.js.map +1 -0
- package/build/dist/Models/DatabaseModels/KubernetesCluster.js +3 -3
- package/build/dist/Models/DatabaseModels/KubernetesCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +56 -5
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProxmoxResource.js +51 -1
- package/build/dist/Models/DatabaseModels/ProxmoxResource.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RunnerJob.js +74 -0
- package/build/dist/Models/DatabaseModels/RunnerJob.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TeamComplianceSetting.js +134 -3
- package/build/dist/Models/DatabaseModels/TeamComplianceSetting.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkspaceProjectAuthToken.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +6 -1
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +17 -10
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/AutoRemediationAPI.js +144 -24
- package/build/dist/Server/API/AutoRemediationAPI.js.map +1 -1
- package/build/dist/Server/API/KubernetesClusterAiAccessAPI.js +436 -22
- package/build/dist/Server/API/KubernetesClusterAiAccessAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +69 -13
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/ProxmoxResourceAPI.js +187 -14
- package/build/dist/Server/API/ProxmoxResourceAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/GlobalCache.js +27 -0
- package/build/dist/Server/Infrastructure/GlobalCache.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796000000000-AddTeamComplianceRuleScope.js +50 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796000000000-AddTeamComplianceRuleScope.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796100000000-AddKubernetesAiAgentAndAiDefaults.js +84 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796100000000-AddKubernetesAiAgentAndAiDefaults.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796200000000-AddProxmoxResourceNativePushColumns.js +31 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796200000000-AddProxmoxResourceNativePushColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +34 -19
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +59 -1
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertService.js +248 -13
- package/build/dist/Server/Services/AlertService.js.map +1 -1
- package/build/dist/Server/Services/AlertSeverityService.js +51 -15
- package/build/dist/Server/Services/AlertSeverityService.js.map +1 -1
- package/build/dist/Server/Services/AutoRemediationRuleService.js +1 -1
- package/build/dist/Server/Services/AutoRemediationRuleService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +199 -72
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSeverityService.js +51 -15
- package/build/dist/Server/Services/IncidentSeverityService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesAiAgentJobService.js +158 -0
- package/build/dist/Server/Services/KubernetesAiAgentJobService.js.map +1 -0
- package/build/dist/Server/Services/KubernetesAiAgentService.js +1145 -0
- package/build/dist/Server/Services/KubernetesAiAgentService.js.map +1 -0
- package/build/dist/Server/Services/KubernetesClusterAiAccessService.js +842 -371
- package/build/dist/Server/Services/KubernetesClusterAiAccessService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterService.js +86 -17
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +22 -0
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxResourceService.js +258 -3
- package/build/dist/Server/Services/ProxmoxResourceService.js.map +1 -1
- package/build/dist/Server/Services/RunnerJobService.js +178 -92
- package/build/dist/Server/Services/RunnerJobService.js.map +1 -1
- package/build/dist/Server/Services/RunnerService.js +1 -1
- package/build/dist/Server/Services/RunnerService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +535 -3
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +316 -46
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/TeamComplianceSettingService.js +833 -7
- package/build/dist/Server/Services/TeamComplianceSettingService.js.map +1 -1
- package/build/dist/Server/Utils/AI/ClusterAccess/ClusterAccessContext.js +52 -9
- package/build/dist/Server/Utils/AI/ClusterAccess/ClusterAccessContext.js.map +1 -1
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.js +13 -9
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.js.map +1 -1
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlJobRunner.js +7 -3
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlJobRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js +29 -15
- package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js +56 -20
- package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +39 -5
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/IncidentPostmortemRunner.js +30 -3
- package/build/dist/Server/Utils/AI/SRE/IncidentPostmortemRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/InvestigationEligibility.js +13 -2
- package/build/dist/Server/Utils/AI/SRE/InvestigationEligibility.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js +1 -1
- package/build/dist/Server/Utils/AutoRemediation/CommandPlanExecutor.js +4 -2
- package/build/dist/Server/Utils/AutoRemediation/CommandPlanExecutor.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +111 -6
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js +40 -4
- package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ProxmoxNativeNodeLiveness.js +296 -0
- package/build/dist/Server/Utils/Telemetry/ProxmoxNativeNodeLiveness.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/ProxmoxNativePush.js +699 -0
- package/build/dist/Server/Utils/Telemetry/ProxmoxNativePush.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +77 -19
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +505 -42
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/AI/AIRunType.js +9 -4
- package/build/dist/Types/AI/AIRunType.js.map +1 -1
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPlan.js +10 -16
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPlan.js.map +1 -1
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPolicyVerdict.js +28 -0
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPolicyVerdict.js.map +1 -0
- package/build/dist/Types/Kubernetes/KubernetesClusterAiAccess.js +72 -16
- package/build/dist/Types/Kubernetes/KubernetesClusterAiAccess.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesClusterAiAccessPermissions.js +20 -16
- package/build/dist/Types/Kubernetes/KubernetesClusterAiAccessPermissions.js.map +1 -1
- package/build/dist/Types/Kubernetes/KubernetesClusterAiInsights.js +17 -0
- package/build/dist/Types/Kubernetes/KubernetesClusterAiInsights.js.map +1 -0
- package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js +4 -4
- package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js.map +1 -1
- package/build/dist/Types/Team/ComplianceNotificationChannel.js +23 -0
- package/build/dist/Types/Team/ComplianceNotificationChannel.js.map +1 -0
- package/build/dist/Types/Team/ComplianceRule.js +304 -0
- package/build/dist/Types/Team/ComplianceRule.js.map +1 -0
- package/build/dist/Types/Team/ComplianceRuleType.js +21 -0
- package/build/dist/Types/Team/ComplianceRuleType.js.map +1 -1
- package/build/dist/Types/Team/TeamComplianceStatus.js +2 -0
- package/build/dist/Types/Team/TeamComplianceStatus.js.map +1 -0
- package/build/dist/Types/Telemetry/TelemetryIngestSurface.js +25 -0
- package/build/dist/Types/Telemetry/TelemetryIngestSurface.js.map +1 -1
- package/build/dist/UI/Components/ActionButton/ActionButtonSchema.js +20 -1
- package/build/dist/UI/Components/ActionButton/ActionButtonSchema.js.map +1 -1
- package/build/dist/UI/Components/ActionButton/RowActions.js +113 -0
- package/build/dist/UI/Components/ActionButton/RowActions.js.map +1 -0
- package/build/dist/UI/Components/ActionButton/SplitActionButtons.js +71 -0
- package/build/dist/UI/Components/ActionButton/SplitActionButtons.js.map +1 -0
- package/build/dist/UI/Components/Charts/Area/AreaChart.js +16 -1
- package/build/dist/UI/Components/Charts/Area/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js +16 -1
- package/build/dist/UI/Components/Charts/Bar/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +27 -5
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js +61 -194
- package/build/dist/UI/Components/Charts/ChartLibrary/AreaChart/AreaChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +84 -26
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +75 -196
- package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js +133 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/DoubleClick.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/UseChartBucketsChange.js +26 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/UseChartBucketsChange.js.map +1 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/UseChartRangeSelection.js +371 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/Utils/UseChartRangeSelection.js.map +1 -0
- package/build/dist/UI/Components/Charts/Line/LineChart.js +16 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/Charts/TimeRangeZoom/ResetTimeRangeZoomButton.js +35 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/ResetTimeRangeZoomButton.js.map +1 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomContext.js +107 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomContext.js.map +1 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomHint.js +41 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomHint.js.map +1 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomUtil.js +117 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/TimeRangeZoomUtil.js.map +1 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/UseTimeRangeZoom.js +121 -0
- package/build/dist/UI/Components/Charts/TimeRangeZoom/UseTimeRangeZoom.js.map +1 -0
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js +15 -7
- package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/XAxis.js +70 -0
- package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -1
- package/build/dist/UI/Components/Charts/Utils/useHistogramRangeSelection.js +305 -38
- package/build/dist/UI/Components/Charts/Utils/useHistogramRangeSelection.js.map +1 -1
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js +89 -14
- package/build/dist/UI/Components/EntityDropdown/EntityDropdown.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js +11 -2
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +69 -54
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/List/ListRow.js +4 -39
- package/build/dist/UI/Components/List/ListRow.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +31 -8
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js +10 -1
- package/build/dist/UI/Components/LogsViewer/components/LogTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +139 -21
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js +30 -8
- package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +10 -0
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js +253 -14
- package/build/dist/UI/Components/MoreMenu/MoreMenu.js.map +1 -1
- package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js +43 -13
- package/build/dist/UI/Components/MoreMenu/MoreMenuItem.js.map +1 -1
- package/build/dist/UI/Components/OrderedStatesList/Item.js +2 -38
- package/build/dist/UI/Components/OrderedStatesList/Item.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceGrid.js +53 -15
- package/build/dist/UI/Components/StatusPage/ResourceGrid.js.map +1 -1
- package/build/dist/UI/Components/Table/TableBody.js +6 -2
- package/build/dist/UI/Components/Table/TableBody.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +12 -75
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +32 -7
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js +27 -9
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js +11 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryTimeRangePicker.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/useViewerTimeRangeZoom.js +272 -0
- package/build/dist/UI/Components/TelemetryViewer/useViewerTimeRangeZoom.js.map +1 -0
- package/build/dist/UI/Components/Toggle/Toggle.js +14 -1
- package/build/dist/UI/Components/Toggle/Toggle.js.map +1 -1
- package/build/dist/UI/Components/Tooltip/Tooltip.js +1 -1
- package/build/dist/UI/Components/Tooltip/Tooltip.js.map +1 -1
- package/build/dist/Utils/AiRemediation/CommandPolicy.js +1 -1
- package/build/dist/Utils/AiRemediation/CommandPolicy.js.map +1 -1
- package/build/dist/Utils/AiRemediation/KubectlPolicy.js +1 -1
- package/build/dist/Utils/AiRemediation/KubectlPolicy.js.map +1 -1
- package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js +27 -1
- package/build/dist/Utils/Dashboard/DashboardTimeRangeZoom.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import ActionButtonSchema from "./ActionButtonSchema";
|
|
2
|
+
import splitActionButtons, {
|
|
3
|
+
IndexedActionButton,
|
|
4
|
+
isDestructiveActionButton,
|
|
5
|
+
SplitActionButtonsResult,
|
|
6
|
+
} from "./SplitActionButtons";
|
|
7
|
+
import Button, { ButtonSize, ButtonStyleType } from "../Button/Button";
|
|
8
|
+
import Icon from "../Icon/Icon";
|
|
9
|
+
import ConfirmModal from "../Modal/ConfirmModal";
|
|
10
|
+
import MoreMenu from "../MoreMenu/MoreMenu";
|
|
11
|
+
import MoreMenuDivider from "../MoreMenu/Divider";
|
|
12
|
+
import MoreMenuItem from "../MoreMenu/MoreMenuItem";
|
|
13
|
+
import GenericObject from "../../../Types/GenericObject";
|
|
14
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
15
|
+
import useTranslateValue from "../../Utils/Translation";
|
|
16
|
+
import React, { ReactElement, useRef, useState } from "react";
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* The actions of one row - a table row, a list card, a state in an ordered
|
|
20
|
+
* list: one button, and a ⋯ menu holding everything else. SplitActionButtons
|
|
21
|
+
* decides which action is which; this only draws the result.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export interface ComponentProps<T extends GenericObject> {
|
|
25
|
+
item: T;
|
|
26
|
+
actionButtons?: Array<ActionButtonSchema<T>> | undefined;
|
|
27
|
+
isMobile?: boolean | undefined;
|
|
28
|
+
/*
|
|
29
|
+
* Alignment of the button and the menu trigger. Rows right-align their
|
|
30
|
+
* actions (the default); a centred card can centre them.
|
|
31
|
+
*/
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
/*
|
|
34
|
+
* What this row is, for the ⋯ trigger's accessible name - "More actions for
|
|
35
|
+
* Monitor: Checkout API" rather than twenty-five identical "More actions" in
|
|
36
|
+
* a screen reader's list of buttons.
|
|
37
|
+
*/
|
|
38
|
+
itemLabel?: string | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* OUTLINE and its hover variants are drawn by a `btn-outline-secondary` class
|
|
43
|
+
* that no stylesheet defines, so they render as bare text. That was tolerable
|
|
44
|
+
* in a strip of buttons; as the row's one button, sat beside a bordered ⋯, it
|
|
45
|
+
* reads as a stray label. The row's button always looks like a button.
|
|
46
|
+
*/
|
|
47
|
+
const getRowButtonStyle: (style: ButtonStyleType) => ButtonStyleType = (
|
|
48
|
+
style: ButtonStyleType,
|
|
49
|
+
): ButtonStyleType => {
|
|
50
|
+
switch (style) {
|
|
51
|
+
case ButtonStyleType.OUTLINE:
|
|
52
|
+
case ButtonStyleType.HOVER_PRIMARY_OUTLINE:
|
|
53
|
+
case ButtonStyleType.HOVER_SUCCESS_OUTLINE:
|
|
54
|
+
return ButtonStyleType.NORMAL;
|
|
55
|
+
case ButtonStyleType.HOVER_DANGER_OUTLINE:
|
|
56
|
+
return ButtonStyleType.DANGER_OUTLINE;
|
|
57
|
+
default:
|
|
58
|
+
return style;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type RowActionsFunction = <T extends GenericObject>(
|
|
63
|
+
props: ComponentProps<T>,
|
|
64
|
+
) => ReactElement;
|
|
65
|
+
|
|
66
|
+
const RowActions: RowActionsFunction = <T extends GenericObject>(
|
|
67
|
+
props: ComponentProps<T>,
|
|
68
|
+
): ReactElement => {
|
|
69
|
+
const { translateString } = useTranslateValue();
|
|
70
|
+
|
|
71
|
+
const [error, setError] = useState<string>("");
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* Which actions are mid-flight, by their index in props.actionButtons. Held
|
|
75
|
+
* in a ref, as the rows always have: it is read whenever the row renders but
|
|
76
|
+
* never forces a render of its own. Plenty of action handlers navigate away
|
|
77
|
+
* or open a modal without ever calling onCompleteAction, and a spinner that
|
|
78
|
+
* forced its own render would spin on those forever.
|
|
79
|
+
*/
|
|
80
|
+
const loadingActionIndexes: React.MutableRefObject<Array<boolean>> = useRef<
|
|
81
|
+
Array<boolean>
|
|
82
|
+
>([]);
|
|
83
|
+
|
|
84
|
+
const { primary, moreMenu }: SplitActionButtonsResult<T> =
|
|
85
|
+
splitActionButtons<T>({
|
|
86
|
+
actionButtons: props.actionButtons,
|
|
87
|
+
item: props.item,
|
|
88
|
+
isMobile: props.isMobile,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
if (!primary && moreMenu.length === 0 && !error) {
|
|
92
|
+
return <></>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
type RunActionFunction = (entry: IndexedActionButton<T>) => void;
|
|
96
|
+
|
|
97
|
+
const runAction: RunActionFunction = (
|
|
98
|
+
entry: IndexedActionButton<T>,
|
|
99
|
+
): void => {
|
|
100
|
+
const { button, index } = entry;
|
|
101
|
+
|
|
102
|
+
if (button.disabled || !button.onClick) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
loadingActionIndexes.current[index] = true;
|
|
107
|
+
|
|
108
|
+
button.onClick(
|
|
109
|
+
props.item,
|
|
110
|
+
() => {
|
|
111
|
+
loadingActionIndexes.current[index] = false;
|
|
112
|
+
},
|
|
113
|
+
(err: Error) => {
|
|
114
|
+
loadingActionIndexes.current[index] = false;
|
|
115
|
+
setError((err as Error).message);
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const hasMenuIcons: boolean = moreMenu.some(
|
|
121
|
+
(entry: IndexedActionButton<T>) => {
|
|
122
|
+
return Boolean(entry.button.icon);
|
|
123
|
+
},
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const menuItems: Array<ReactElement> = [];
|
|
127
|
+
|
|
128
|
+
moreMenu.forEach((entry: IndexedActionButton<T>, position: number) => {
|
|
129
|
+
const isDestructive: boolean = isDestructiveActionButton(entry.button);
|
|
130
|
+
const previous: IndexedActionButton<T> | undefined = moreMenu[position - 1];
|
|
131
|
+
|
|
132
|
+
// A gap between the everyday actions and the destructive ones below them.
|
|
133
|
+
if (
|
|
134
|
+
isDestructive &&
|
|
135
|
+
previous &&
|
|
136
|
+
!isDestructiveActionButton(previous.button)
|
|
137
|
+
) {
|
|
138
|
+
menuItems.push(<MoreMenuDivider key={`divider-${entry.index}`} />);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const title: string =
|
|
142
|
+
translateString(entry.button.title) || entry.button.title;
|
|
143
|
+
|
|
144
|
+
menuItems.push(
|
|
145
|
+
<MoreMenuItem
|
|
146
|
+
key={`action-${entry.index}`}
|
|
147
|
+
text={title}
|
|
148
|
+
icon={entry.button.icon}
|
|
149
|
+
isIconSpaceReserved={hasMenuIcons}
|
|
150
|
+
isDestructive={isDestructive}
|
|
151
|
+
isDisabled={entry.button.disabled}
|
|
152
|
+
tooltip={translateString(entry.button.tooltip)}
|
|
153
|
+
onClick={() => {
|
|
154
|
+
runAction(entry);
|
|
155
|
+
}}
|
|
156
|
+
/>,
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div
|
|
162
|
+
/*
|
|
163
|
+
* Button carries an md:ml-3 of its own, meant for a row of loose
|
|
164
|
+
* buttons. Here the gap does the spacing, and the stray margin would
|
|
165
|
+
* push a centred group off centre.
|
|
166
|
+
*/
|
|
167
|
+
className={`flex items-center gap-2 [&_button]:md:ml-0 ${
|
|
168
|
+
props.className || "justify-end"
|
|
169
|
+
}`}
|
|
170
|
+
data-testid="row-actions"
|
|
171
|
+
>
|
|
172
|
+
{error && (
|
|
173
|
+
<div className="text-align-left">
|
|
174
|
+
<ConfirmModal
|
|
175
|
+
title={`Error`}
|
|
176
|
+
description={error}
|
|
177
|
+
submitButtonText={"Close"}
|
|
178
|
+
onSubmit={() => {
|
|
179
|
+
return setError("");
|
|
180
|
+
}}
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
183
|
+
)}
|
|
184
|
+
|
|
185
|
+
{primary && (
|
|
186
|
+
/*
|
|
187
|
+
* Button is w-full below md. Its own content-sized box keeps it the
|
|
188
|
+
* size of its label on every surface - a Table card, a List card and a
|
|
189
|
+
* centred ordered-states item alike - instead of stretching whenever
|
|
190
|
+
* the row's container happens to be a block.
|
|
191
|
+
*/
|
|
192
|
+
<div className="shrink-0">
|
|
193
|
+
<Button
|
|
194
|
+
buttonSize={ButtonSize.Small}
|
|
195
|
+
title={primary.button.title}
|
|
196
|
+
icon={primary.button.icon}
|
|
197
|
+
buttonStyle={getRowButtonStyle(primary.button.buttonStyleType)}
|
|
198
|
+
isLoading={loadingActionIndexes.current[primary.index]}
|
|
199
|
+
disabled={primary.button.disabled}
|
|
200
|
+
tooltip={primary.button.tooltip}
|
|
201
|
+
onClick={() => {
|
|
202
|
+
runAction(primary);
|
|
203
|
+
}}
|
|
204
|
+
/>
|
|
205
|
+
</div>
|
|
206
|
+
)}
|
|
207
|
+
|
|
208
|
+
{menuItems.length > 0 && (
|
|
209
|
+
<MoreMenu
|
|
210
|
+
isMenuPortaled={true}
|
|
211
|
+
ariaLabel={
|
|
212
|
+
props.itemLabel
|
|
213
|
+
? `${translateString("More actions for") || "More actions for"} ${props.itemLabel}`
|
|
214
|
+
: translateString("More actions") || "More actions"
|
|
215
|
+
}
|
|
216
|
+
elementToBeShownInsteadOfButton={
|
|
217
|
+
<button
|
|
218
|
+
type="button"
|
|
219
|
+
data-testid="row-actions-more-button"
|
|
220
|
+
/*
|
|
221
|
+
* Sized to the Small row button beside it: that button's label
|
|
222
|
+
* is text-base below md and text-sm above, so the trigger's
|
|
223
|
+
* vertical padding steps down at md to keep the two level.
|
|
224
|
+
*/
|
|
225
|
+
className="inline-flex shrink-0 items-center justify-center rounded-md border border-gray-300 bg-white px-1.5 py-1.5 md:py-1 text-gray-500 shadow-sm transition-colors duration-150 ease-out hover:bg-gray-50 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2"
|
|
226
|
+
>
|
|
227
|
+
<Icon icon={IconProp.EllipsisHorizontal} className="h-5 w-5" />
|
|
228
|
+
</button>
|
|
229
|
+
}
|
|
230
|
+
>
|
|
231
|
+
{menuItems}
|
|
232
|
+
</MoreMenu>
|
|
233
|
+
)}
|
|
234
|
+
</div>
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export default RowActions;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import ActionButtonSchema, {
|
|
2
|
+
ActionButtonPlacement,
|
|
3
|
+
} from "./ActionButtonSchema";
|
|
4
|
+
import { ButtonStyleType } from "../Button/Button";
|
|
5
|
+
import GenericObject from "../../../Types/GenericObject";
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* A row carries one action as a button and folds everything else into a ⋯ menu
|
|
9
|
+
* beside it. Six outlined buttons on every row of a table is the loudest thing
|
|
10
|
+
* on the page and says nothing about which one matters; one button and a menu
|
|
11
|
+
* says exactly that.
|
|
12
|
+
*
|
|
13
|
+
* Which action gets the button, in order:
|
|
14
|
+
*
|
|
15
|
+
* 1. The first visible action marked ActionButtonPlacement.Primary. ModelTable
|
|
16
|
+
* marks its "View" action this way, because opening the record is what a
|
|
17
|
+
* row is for.
|
|
18
|
+
* 2. The first action styled as a call to action (NORMAL, PRIMARY, SUCCESS,
|
|
19
|
+
* WARNING). The author already said which one is prominent.
|
|
20
|
+
* 3. The first action that is not destructive - usually Edit.
|
|
21
|
+
* 4. A lone destructive action. With nothing else on the row, hiding "Delete"
|
|
22
|
+
* behind a menu of one would only add a click.
|
|
23
|
+
*
|
|
24
|
+
* Within 2 and 3, an action this viewer can use beats one that is locked for
|
|
25
|
+
* them. A read-only member should not find the row's one button disabled while
|
|
26
|
+
* the thing they are allowed to do is tucked away in the menu; the locked
|
|
27
|
+
* action still sits in the menu, explaining itself. A locked action is only the
|
|
28
|
+
* button when nothing on the row is usable.
|
|
29
|
+
*
|
|
30
|
+
* Destructive actions are never promoted over anything else, and actions marked
|
|
31
|
+
* ActionButtonPlacement.MoreMenu are never promoted at all. The menu keeps the
|
|
32
|
+
* authored order, except that destructive actions sink to the bottom - the
|
|
33
|
+
* place people look for them, and the place they are least likely to be hit by
|
|
34
|
+
* a slip of the pointer.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export interface IndexedActionButton<T extends GenericObject> {
|
|
38
|
+
button: ActionButtonSchema<T>;
|
|
39
|
+
// Position in the array the caller passed in.
|
|
40
|
+
index: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface SplitActionButtonsResult<T extends GenericObject> {
|
|
44
|
+
primary: IndexedActionButton<T> | null;
|
|
45
|
+
moreMenu: Array<IndexedActionButton<T>>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface SplitActionButtonsOptions<T extends GenericObject> {
|
|
49
|
+
actionButtons: Array<ActionButtonSchema<T>> | undefined;
|
|
50
|
+
item: T;
|
|
51
|
+
isMobile?: boolean | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const DESTRUCTIVE_STYLES: Array<ButtonStyleType> = [
|
|
55
|
+
ButtonStyleType.DANGER,
|
|
56
|
+
ButtonStyleType.DANGER_OUTLINE,
|
|
57
|
+
ButtonStyleType.HOVER_DANGER_OUTLINE,
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const CALL_TO_ACTION_STYLES: Array<ButtonStyleType> = [
|
|
61
|
+
ButtonStyleType.NORMAL,
|
|
62
|
+
ButtonStyleType.PRIMARY,
|
|
63
|
+
ButtonStyleType.SUCCESS,
|
|
64
|
+
ButtonStyleType.WARNING,
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
export const isDestructiveActionButton: <T extends GenericObject>(
|
|
68
|
+
button: ActionButtonSchema<T>,
|
|
69
|
+
) => boolean = <T extends GenericObject>(
|
|
70
|
+
button: ActionButtonSchema<T>,
|
|
71
|
+
): boolean => {
|
|
72
|
+
return DESTRUCTIVE_STYLES.includes(button.buttonStyleType);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const isActionButtonVisible: <T extends GenericObject>(
|
|
76
|
+
button: ActionButtonSchema<T>,
|
|
77
|
+
item: T,
|
|
78
|
+
isMobile: boolean,
|
|
79
|
+
) => boolean = <T extends GenericObject>(
|
|
80
|
+
button: ActionButtonSchema<T>,
|
|
81
|
+
item: T,
|
|
82
|
+
isMobile: boolean,
|
|
83
|
+
): boolean => {
|
|
84
|
+
if (button.isVisible && !button.isVisible(item)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (button.hideOnMobile && isMobile) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return true;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type SplitActionButtonsFunction = <T extends GenericObject>(
|
|
96
|
+
options: SplitActionButtonsOptions<T>,
|
|
97
|
+
) => SplitActionButtonsResult<T>;
|
|
98
|
+
|
|
99
|
+
const splitActionButtons: SplitActionButtonsFunction = <
|
|
100
|
+
T extends GenericObject,
|
|
101
|
+
>(
|
|
102
|
+
options: SplitActionButtonsOptions<T>,
|
|
103
|
+
): SplitActionButtonsResult<T> => {
|
|
104
|
+
const visible: Array<IndexedActionButton<T>> = [];
|
|
105
|
+
|
|
106
|
+
(options.actionButtons || []).forEach(
|
|
107
|
+
(button: ActionButtonSchema<T>, index: number) => {
|
|
108
|
+
if (
|
|
109
|
+
isActionButtonVisible(button, options.item, Boolean(options.isMobile))
|
|
110
|
+
) {
|
|
111
|
+
visible.push({ button, index });
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const candidates: Array<IndexedActionButton<T>> = visible.filter(
|
|
117
|
+
(entry: IndexedActionButton<T>) => {
|
|
118
|
+
return entry.button.placement !== ActionButtonPlacement.MoreMenu;
|
|
119
|
+
},
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const nonDestructiveCandidates: Array<IndexedActionButton<T>> =
|
|
123
|
+
candidates.filter((entry: IndexedActionButton<T>) => {
|
|
124
|
+
return !isDestructiveActionButton(entry.button);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const usableCandidates: Array<IndexedActionButton<T>> =
|
|
128
|
+
nonDestructiveCandidates.filter((entry: IndexedActionButton<T>) => {
|
|
129
|
+
return !entry.button.disabled;
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
type FindCallToActionFunction = (
|
|
133
|
+
entries: Array<IndexedActionButton<T>>,
|
|
134
|
+
) => IndexedActionButton<T> | undefined;
|
|
135
|
+
|
|
136
|
+
const findCallToAction: FindCallToActionFunction = (
|
|
137
|
+
entries: Array<IndexedActionButton<T>>,
|
|
138
|
+
): IndexedActionButton<T> | undefined => {
|
|
139
|
+
return entries.find((entry: IndexedActionButton<T>) => {
|
|
140
|
+
return CALL_TO_ACTION_STYLES.includes(entry.button.buttonStyleType);
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const primary: IndexedActionButton<T> | null =
|
|
145
|
+
candidates.find((entry: IndexedActionButton<T>) => {
|
|
146
|
+
return entry.button.placement === ActionButtonPlacement.Primary;
|
|
147
|
+
}) ||
|
|
148
|
+
findCallToAction(usableCandidates) ||
|
|
149
|
+
usableCandidates[0] ||
|
|
150
|
+
findCallToAction(nonDestructiveCandidates) ||
|
|
151
|
+
nonDestructiveCandidates[0] ||
|
|
152
|
+
(visible.length === 1 && candidates.length === 1 ? candidates[0]! : null);
|
|
153
|
+
|
|
154
|
+
const rest: Array<IndexedActionButton<T>> = visible.filter(
|
|
155
|
+
(entry: IndexedActionButton<T>) => {
|
|
156
|
+
return entry !== primary;
|
|
157
|
+
},
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
primary,
|
|
162
|
+
moreMenu: [
|
|
163
|
+
...rest.filter((entry: IndexedActionButton<T>) => {
|
|
164
|
+
return !isDestructiveActionButton(entry.button);
|
|
165
|
+
}),
|
|
166
|
+
...rest.filter((entry: IndexedActionButton<T>) => {
|
|
167
|
+
return isDestructiveActionButton(entry.button);
|
|
168
|
+
}),
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default splitActionButtons;
|
|
@@ -26,7 +26,14 @@ import ChartReferenceRegionProps from "../Types/ReferenceRegionProps";
|
|
|
26
26
|
import ChartTimeReferenceLineProps from "../Types/TimeReferenceLineProps";
|
|
27
27
|
import ExemplarPoint from "../Types/ExemplarPoint";
|
|
28
28
|
import XAxisUtil from "../Utils/XAxis";
|
|
29
|
+
import XAxisType from "../Types/XAxis/XAxisType";
|
|
29
30
|
import NoDataMessage from "../ChartGroup/NoDataMessage";
|
|
31
|
+
import {
|
|
32
|
+
ChartTimeRangeZoomContextValue,
|
|
33
|
+
ChartTimeRangeZoomHandlers,
|
|
34
|
+
resolveChartTimeRangeZoom,
|
|
35
|
+
useChartTimeRangeZoom,
|
|
36
|
+
} from "../TimeRangeZoom/TimeRangeZoomContext";
|
|
30
37
|
|
|
31
38
|
export const AreaChartPalette: Array<AvailableChartColorsKeys> = [
|
|
32
39
|
"blue",
|
|
@@ -61,6 +68,8 @@ export interface ComponentProps {
|
|
|
61
68
|
/*
|
|
62
69
|
* When provided, the chart supports drag-to-select: dragging across
|
|
63
70
|
* buckets calls back with the [start, end) of the selected time range.
|
|
71
|
+
* Left unset, the chart zooms the enclosing page instead, when the page
|
|
72
|
+
* offers that (TimeRangeZoomScope).
|
|
64
73
|
*/
|
|
65
74
|
onTimeRangeSelect?: ((startTime: Date, endTime: Date) => void) | undefined;
|
|
66
75
|
/*
|
|
@@ -69,6 +78,11 @@ export interface ComponentProps {
|
|
|
69
78
|
* onTimeRangeReset for why an idle handler costs click latency.
|
|
70
79
|
*/
|
|
71
80
|
onTimeRangeReset?: (() => void) | undefined;
|
|
81
|
+
/*
|
|
82
|
+
* Keeps this chart out of drag-to-zoom altogether, including the page's:
|
|
83
|
+
* for a chart whose window is not the page's time range.
|
|
84
|
+
*/
|
|
85
|
+
disableTimeRangeZoom?: boolean | undefined;
|
|
72
86
|
// Plain click on a bucket — see ChartLibrary onBucketClick.
|
|
73
87
|
onBucketClick?:
|
|
74
88
|
| ((
|
|
@@ -109,6 +123,22 @@ const AreaChartElement: FunctionComponent<AreaInternalProps> = (
|
|
|
109
123
|
): ReactElement => {
|
|
110
124
|
const [records, setRecords] = React.useState<Array<ChartDataPoint>>([]);
|
|
111
125
|
|
|
126
|
+
/*
|
|
127
|
+
* Drag-to-zoom: the host's own handlers, or else the enclosing page's
|
|
128
|
+
* (TimeRangeZoomScope), so a drag here retimes every chart on the page.
|
|
129
|
+
*/
|
|
130
|
+
const pageZoom: ChartTimeRangeZoomContextValue | null =
|
|
131
|
+
useChartTimeRangeZoom();
|
|
132
|
+
const timeRangeZoom: ChartTimeRangeZoomHandlers = resolveChartTimeRangeZoom({
|
|
133
|
+
onTimeRangeSelect: props.onTimeRangeSelect,
|
|
134
|
+
onTimeRangeReset: props.onTimeRangeReset,
|
|
135
|
+
isTimeAxis:
|
|
136
|
+
props.xAxis.options.type === XAxisType.Time ||
|
|
137
|
+
props.xAxis.options.type === XAxisType.Date,
|
|
138
|
+
disableTimeRangeZoom: props.disableTimeRangeZoom,
|
|
139
|
+
pageZoom: pageZoom,
|
|
140
|
+
});
|
|
141
|
+
|
|
112
142
|
const bandLower: string | undefined = props.anomalyBandLowerSeriesName;
|
|
113
143
|
const bandUpper: string | undefined = props.anomalyBandUpperSeriesName;
|
|
114
144
|
|
|
@@ -257,8 +287,8 @@ const AreaChartElement: FunctionComponent<AreaInternalProps> = (
|
|
|
257
287
|
formattedExemplars.length > 0 ? formattedExemplars : undefined
|
|
258
288
|
}
|
|
259
289
|
onExemplarClick={props.onExemplarClick}
|
|
260
|
-
onTimeRangeSelect={
|
|
261
|
-
onTimeRangeReset={
|
|
290
|
+
onTimeRangeSelect={timeRangeZoom.onTimeRangeSelect}
|
|
291
|
+
onTimeRangeReset={timeRangeZoom.onTimeRangeReset}
|
|
262
292
|
onBucketClick={props.onBucketClick}
|
|
263
293
|
ghostCategories={props.ghostSeriesNames}
|
|
264
294
|
anomalyBandLowerKey={bandLower}
|
|
@@ -22,7 +22,14 @@ import TimeAnnotationUtil from "../Utils/TimeAnnotation";
|
|
|
22
22
|
import ChartReferenceLineProps from "../Types/ReferenceLineProps";
|
|
23
23
|
import ChartReferenceRegionProps from "../Types/ReferenceRegionProps";
|
|
24
24
|
import ChartTimeReferenceLineProps from "../Types/TimeReferenceLineProps";
|
|
25
|
+
import XAxisType from "../Types/XAxis/XAxisType";
|
|
25
26
|
import NoDataMessage from "../ChartGroup/NoDataMessage";
|
|
27
|
+
import {
|
|
28
|
+
ChartTimeRangeZoomContextValue,
|
|
29
|
+
ChartTimeRangeZoomHandlers,
|
|
30
|
+
resolveChartTimeRangeZoom,
|
|
31
|
+
useChartTimeRangeZoom,
|
|
32
|
+
} from "../TimeRangeZoom/TimeRangeZoomContext";
|
|
26
33
|
|
|
27
34
|
export const BarChartPalette: Array<AvailableChartColorsKeys> = [
|
|
28
35
|
"indigo",
|
|
@@ -59,10 +66,23 @@ export interface ComponentProps {
|
|
|
59
66
|
*/
|
|
60
67
|
colors?: Array<ChartColorValue> | undefined;
|
|
61
68
|
/*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
69
|
+
* When provided, the chart supports drag-to-select: dragging across bars
|
|
70
|
+
* calls back with the [start, end) of the time they cover. Left unset,
|
|
71
|
+
* the chart zooms the enclosing page instead, when the page offers that
|
|
72
|
+
* (TimeRangeZoomScope).
|
|
73
|
+
*/
|
|
74
|
+
onTimeRangeSelect?: ((startTime: Date, endTime: Date) => void) | undefined;
|
|
75
|
+
/*
|
|
76
|
+
* Double-click on the plot: undoes whatever drag-to-select produced, on
|
|
77
|
+
* this chart or a neighbouring one. Supply it only when a reset is
|
|
78
|
+
* actually possible.
|
|
64
79
|
*/
|
|
65
80
|
onTimeRangeReset?: (() => void) | undefined;
|
|
81
|
+
/*
|
|
82
|
+
* Keeps this chart out of drag-to-zoom altogether, including the page's:
|
|
83
|
+
* for a chart whose window is not the page's time range.
|
|
84
|
+
*/
|
|
85
|
+
disableTimeRangeZoom?: boolean | undefined;
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
export interface BarInternalProps extends ComponentProps {
|
|
@@ -74,6 +94,22 @@ const BarChartElement: FunctionComponent<BarInternalProps> = (
|
|
|
74
94
|
): ReactElement => {
|
|
75
95
|
const [records, setRecords] = React.useState<Array<ChartDataPoint>>([]);
|
|
76
96
|
|
|
97
|
+
/*
|
|
98
|
+
* Drag-to-zoom: the host's own handlers, or else the enclosing page's
|
|
99
|
+
* (TimeRangeZoomScope), so a drag here retimes every chart on the page.
|
|
100
|
+
*/
|
|
101
|
+
const pageZoom: ChartTimeRangeZoomContextValue | null =
|
|
102
|
+
useChartTimeRangeZoom();
|
|
103
|
+
const timeRangeZoom: ChartTimeRangeZoomHandlers = resolveChartTimeRangeZoom({
|
|
104
|
+
onTimeRangeSelect: props.onTimeRangeSelect,
|
|
105
|
+
onTimeRangeReset: props.onTimeRangeReset,
|
|
106
|
+
isTimeAxis:
|
|
107
|
+
props.xAxis.options.type === XAxisType.Time ||
|
|
108
|
+
props.xAxis.options.type === XAxisType.Date,
|
|
109
|
+
disableTimeRangeZoom: props.disableTimeRangeZoom,
|
|
110
|
+
pageZoom: pageZoom,
|
|
111
|
+
});
|
|
112
|
+
|
|
77
113
|
const categories: Array<string> = props.data.map((item: SeriesPoint) => {
|
|
78
114
|
return item.seriesName;
|
|
79
115
|
});
|
|
@@ -161,7 +197,8 @@ const BarChartElement: FunctionComponent<BarInternalProps> = (
|
|
|
161
197
|
? formattedReferenceRegions
|
|
162
198
|
: undefined
|
|
163
199
|
}
|
|
164
|
-
|
|
200
|
+
onTimeRangeSelect={timeRangeZoom.onTimeRangeSelect}
|
|
201
|
+
onTimeRangeReset={timeRangeZoom.onTimeRangeReset}
|
|
165
202
|
/>
|
|
166
203
|
{hasNoData && <NoDataMessage />}
|
|
167
204
|
</div>
|
|
@@ -9,6 +9,13 @@ import AreaChartElement, {
|
|
|
9
9
|
ComponentProps as AreaChartProps,
|
|
10
10
|
} from "../Area/AreaChart";
|
|
11
11
|
import ExemplarPoint from "../Types/ExemplarPoint";
|
|
12
|
+
import XAxisType from "../Types/XAxis/XAxisType";
|
|
13
|
+
import {
|
|
14
|
+
ChartTimeRangeZoomContextValue,
|
|
15
|
+
ChartTimeRangeZoomHandlers,
|
|
16
|
+
resolveChartTimeRangeZoom,
|
|
17
|
+
useChartTimeRangeZoom,
|
|
18
|
+
} from "../TimeRangeZoom/TimeRangeZoomContext";
|
|
12
19
|
import Icon, { SizeProp } from "../../Icon/Icon";
|
|
13
20
|
import IconProp from "../../../../Types/Icon/IconProp";
|
|
14
21
|
import Modal, { ModalWidth } from "../../Modal/Modal";
|
|
@@ -90,6 +97,9 @@ const ChartGroup: FunctionComponent<ComponentProps> = (
|
|
|
90
97
|
const syncId: string = props.syncId || fallbackSyncId;
|
|
91
98
|
const [metricInfoModalChart, setMetricInfoModalChart] =
|
|
92
99
|
useState<ChartMetricInfo | null>(null);
|
|
100
|
+
// The page's zoom, which every chart below takes unless it has its own.
|
|
101
|
+
const pageZoom: ChartTimeRangeZoomContextValue | null =
|
|
102
|
+
useChartTimeRangeZoom();
|
|
93
103
|
|
|
94
104
|
type GetChartContentFunction = (chart: Chart, index: number) => ReactElement;
|
|
95
105
|
|
|
@@ -147,23 +157,39 @@ const ChartGroup: FunctionComponent<ComponentProps> = (
|
|
|
147
157
|
const getDragToZoomHint: GetDragToZoomHintFunction = (
|
|
148
158
|
chart: Chart,
|
|
149
159
|
): ReactElement => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
160
|
+
if (
|
|
161
|
+
chart.type !== ChartType.LINE &&
|
|
162
|
+
chart.type !== ChartType.AREA &&
|
|
163
|
+
chart.type !== ChartType.BAR
|
|
164
|
+
) {
|
|
165
|
+
return <></>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/*
|
|
169
|
+
* Resolved exactly the way the chart itself resolves them, so the hint
|
|
170
|
+
* never promises a gesture the chart does not have: the chart's own
|
|
171
|
+
* handlers, else the page's zoom.
|
|
172
|
+
*/
|
|
173
|
+
const chartProps: LineChartProps | AreaChartProps | BarChartProps =
|
|
174
|
+
chart.props;
|
|
175
|
+
const xAxisType: XAxisType | undefined = chartProps.xAxis?.options?.type;
|
|
176
|
+
const zoom: ChartTimeRangeZoomHandlers = resolveChartTimeRangeZoom({
|
|
177
|
+
onTimeRangeSelect: chartProps.onTimeRangeSelect,
|
|
178
|
+
onTimeRangeReset: chartProps.onTimeRangeReset,
|
|
179
|
+
isTimeAxis: xAxisType === XAxisType.Time || xAxisType === XAxisType.Date,
|
|
180
|
+
disableTimeRangeZoom: chartProps.disableTimeRangeZoom,
|
|
181
|
+
pageZoom: pageZoom,
|
|
182
|
+
});
|
|
155
183
|
|
|
156
|
-
if (!
|
|
184
|
+
if (!zoom.onTimeRangeSelect) {
|
|
157
185
|
return <></>;
|
|
158
186
|
}
|
|
159
187
|
|
|
160
188
|
/*
|
|
161
189
|
* The way back out is only worth naming while there is something to
|
|
162
|
-
* reset —
|
|
190
|
+
* reset — a reset handler is supplied exactly then.
|
|
163
191
|
*/
|
|
164
|
-
const canReset: boolean = Boolean(
|
|
165
|
-
(chart.props as LineChartProps | AreaChartProps).onTimeRangeReset,
|
|
166
|
-
);
|
|
192
|
+
const canReset: boolean = Boolean(zoom.onTimeRangeReset);
|
|
167
193
|
|
|
168
194
|
return (
|
|
169
195
|
<span className="ml-auto shrink-0 whitespace-nowrap text-[10px] text-gray-400">
|
|
@@ -395,7 +421,7 @@ const ChartGroup: FunctionComponent<ComponentProps> = (
|
|
|
395
421
|
key={index}
|
|
396
422
|
className={`flex flex-col rounded-lg border border-gray-200 bg-white shadow-sm ${props.chartCssClass || ""}`}
|
|
397
423
|
>
|
|
398
|
-
{/* Header strip — title, meta icons,
|
|
424
|
+
{/* Header strip — title, meta icons, the always-visible zoom hint */}
|
|
399
425
|
<div className="border-b border-gray-100 px-4 py-2.5">
|
|
400
426
|
<div className="flex items-center">
|
|
401
427
|
<h2
|