@galaxy-io/filament-ui 0.3.0 → 0.5.0

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.
Files changed (35) hide show
  1. package/dist/api/queries/metrics.d.ts +1 -1
  2. package/dist/api/queries/metrics.js +9 -18
  3. package/dist/module/hooks.d.ts +1 -0
  4. package/dist/module/hooks.js +2 -1
  5. package/dist/module/routes.d.ts +1 -0
  6. package/dist/module/schemas.d.ts +2 -1
  7. package/dist/module/schemas.js +2 -1
  8. package/dist/pages/observability/ObservabilityPage.js +64 -53
  9. package/dist/pages/observability/components/ObservabilityPageActions.js +34 -12
  10. package/dist/pages/observability/components/ObservabilityRefreshIntervalSelect.d.ts +8 -0
  11. package/dist/pages/observability/components/ObservabilityRefreshIntervalSelect.js +26 -0
  12. package/dist/pages/observability/components/ObservabilityTimeframeSwitcher.js +2 -1
  13. package/dist/pages/observability/components/metrics/ObservabilityMetricsWidget.js +10 -3
  14. package/dist/pages/observability/components/runs/ObservabilityRunsChart.js +8 -5
  15. package/dist/pages/observability/components/runs/ObservabilityRunsPastTable.js +13 -17
  16. package/dist/pages/observability/components/runs/ObservabilityRunsScheduledChart.js +2 -2
  17. package/dist/pages/observability/components/runs/ObservabilityRunsTableWidget.js +3 -0
  18. package/dist/pages/observability/components/runs/ObservabilityRunsUpcomingTable.js +10 -14
  19. package/dist/pages/observability/components/runs/constants.d.ts +0 -1
  20. package/dist/pages/observability/components/runs/constants.js +1 -1
  21. package/dist/pages/observability/components/timeseries/ObservabilityTimeseriesChart.js +8 -5
  22. package/dist/pages/observability/constants.d.ts +8 -1
  23. package/dist/pages/observability/constants.js +24 -3
  24. package/dist/pages/observability/hooks/useObservabilityScrollTakeover.d.ts +4 -0
  25. package/dist/pages/observability/hooks/useObservabilityScrollTakeover.js +27 -0
  26. package/dist/pages/observability/types.d.ts +7 -0
  27. package/dist/pages/observability/types.js +9 -1
  28. package/dist/pages/observability/utils.d.ts +2 -0
  29. package/dist/pages/observability/utils.js +3 -1
  30. package/dist/pages/pipelines/canvas/routes/PipelineCanvasRoutesDraftRow.js +7 -3
  31. package/dist/pages/pipelines/components/create/rows.js +8 -4
  32. package/dist/pages/pipelines/components/resource/utils.d.ts +6 -0
  33. package/dist/pages/pipelines/components/resource/utils.js +2 -1
  34. package/dist/styles.css +2 -0
  35. package/package.json +1 -1
@@ -8,4 +8,4 @@ export declare const useQueryAggregateQuery: ({ input, options, }?: {
8
8
  input?: QueryAggregateRequest;
9
9
  options?: UseQueryOptions<typeof MetricsService.method.queryAggregate.output, QueryAggregateResponse>;
10
10
  }) => import('@tanstack/react-query').UseQueryResult<QueryAggregateResponse, import('@connectrpc/connect').ConnectError>;
11
- export declare const useRefreshObservabilityQueries: () => () => void;
11
+ export declare const useRefreshObservabilityQueries: () => () => Promise<void[]>;
@@ -6,7 +6,6 @@ import { useCallback } from "react";
6
6
  import { useQueryClient } from "@tanstack/react-query";
7
7
  import { createConnectQueryKey, useQuery, useTransport } from "@connectrpc/connect-query";
8
8
  //#region src/api/queries/metrics.ts
9
- var METRICS_REFETCH_INTERVAL = 3e4;
10
9
  var createQueryTimeseriesQueryKey = (input, transport) => {
11
10
  return createConnectQueryKey({
12
11
  schema: MetricsService.method.queryTimeseries,
@@ -16,10 +15,7 @@ var createQueryTimeseriesQueryKey = (input, transport) => {
16
15
  });
17
16
  };
18
17
  var useQueryTimeseriesQuery = ({ input, options = {} } = {}) => {
19
- return useQuery(MetricsService.method.queryTimeseries, input, {
20
- refetchInterval: METRICS_REFETCH_INTERVAL,
21
- ...options
22
- });
18
+ return useQuery(MetricsService.method.queryTimeseries, input, options);
23
19
  };
24
20
  var createQueryAggregateQueryKey = (input, transport) => {
25
21
  return createConnectQueryKey({
@@ -30,23 +26,18 @@ var createQueryAggregateQueryKey = (input, transport) => {
30
26
  });
31
27
  };
32
28
  var useQueryAggregateQuery = ({ input, options = {} } = {}) => {
33
- return useQuery(MetricsService.method.queryAggregate, input, {
34
- refetchInterval: METRICS_REFETCH_INTERVAL,
35
- ...options
36
- });
29
+ return useQuery(MetricsService.method.queryAggregate, input, options);
37
30
  };
38
31
  var useRefreshObservabilityQueries = () => {
39
32
  const queryClient = useQueryClient();
40
33
  const transport = useTransport();
41
- return useCallback(() => {
42
- for (const queryKey of [
43
- createQueryTimeseriesQueryKey(void 0, transport),
44
- createQueryAggregateQueryKey(void 0, transport),
45
- createListRunsQueryKey(void 0, transport),
46
- createListConnectionsQueryKey(void 0, transport),
47
- createListPipelinesQueryKey(void 0, transport)
48
- ]) queryClient.invalidateQueries({ queryKey });
49
- }, [queryClient, transport]);
34
+ return useCallback(() => Promise.all([
35
+ createQueryTimeseriesQueryKey(void 0, transport),
36
+ createQueryAggregateQueryKey(void 0, transport),
37
+ createListRunsQueryKey(void 0, transport),
38
+ createListConnectionsQueryKey(void 0, transport),
39
+ createListPipelinesQueryKey(void 0, transport)
40
+ ].map((queryKey) => queryClient.invalidateQueries({ queryKey }))), [queryClient, transport]);
50
41
  };
51
42
  //#endregion
52
43
  export { useQueryAggregateQuery, useQueryTimeseriesQuery, useRefreshObservabilityQueries };
@@ -34,6 +34,7 @@ export declare const useListSearch: () => {
34
34
  };
35
35
  export declare const useObservabilitySearch: () => {
36
36
  timeframe: import('../pages/observability/types').ObservabilityTimeframe;
37
+ refreshInterval: import('../pages/observability/types').ObservabilityRefreshInterval;
37
38
  runs: import('../pages/observability/types').ObservabilityRunsView;
38
39
  statuses: import('../gen/ingestion/v1/runs_pb').RunStatus[];
39
40
  throughput?: import('../pages/observability/types').ObservabilityThroughputView | undefined;
@@ -1,5 +1,5 @@
1
1
  import { OBSERVABILITY_RUNS_DEFAULT_STATUSES } from "../pages/observability/components/runs/constants.js";
2
- import { OBSERVABILITY_DEFAULT_RUNS_VIEW, OBSERVABILITY_DEFAULT_TIMEFRAME } from "../pages/observability/constants.js";
2
+ import { OBSERVABILITY_DEFAULT_REFRESH_INTERVAL, OBSERVABILITY_DEFAULT_RUNS_VIEW, OBSERVABILITY_DEFAULT_TIMEFRAME } from "../pages/observability/constants.js";
3
3
  import { connectionsSearchSchema, filamentLayoutSearchSchema, listSearchParamsSchema, observabilitySearchSchema, pipelineCanvasSearchSchema, pipelineHistorySearchSchema, pipelineParamsSchema, pipelineSearchSchema, pipelinesSearchSchema } from "./schemas.js";
4
4
  import { useCallback } from "react";
5
5
  import { useMatchRoute, useMatches, useNavigate, useParams, useSearch } from "@tanstack/react-router";
@@ -56,6 +56,7 @@ var useObservabilitySearch = () => useSearch({
56
56
  return {
57
57
  ...parsed,
58
58
  timeframe: parsed.timeframe ?? OBSERVABILITY_DEFAULT_TIMEFRAME,
59
+ refreshInterval: parsed.refreshInterval ?? OBSERVABILITY_DEFAULT_REFRESH_INTERVAL,
59
60
  runs: parsed.runs ?? OBSERVABILITY_DEFAULT_RUNS_VIEW,
60
61
  statuses: parsed.statuses ?? OBSERVABILITY_RUNS_DEFAULT_STATUSES
61
62
  };
@@ -20,6 +20,7 @@ export declare const filamentNotFoundRouteOptions: FilamentRouteComponents;
20
20
  export declare const observabilityRouteOptions: FilamentRouteComponents & {
21
21
  validateSearch: import('zod').ZodObject<{
22
22
  timeframe: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../pages/observability/types').ObservabilityTimeframe>>>;
23
+ refreshInterval: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../pages/observability/types').ObservabilityRefreshInterval>>>;
23
24
  runs: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../pages/observability/types').ObservabilityRunsView>>>;
24
25
  throughput: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../pages/observability/types').ObservabilityThroughputView>>>;
25
26
  throughputPivot: import('zod').ZodCatch<import('zod').ZodOptional<import('zod').ZodEnum<typeof import('../gen/metrics/v1/metrics_pb').MetricDimension>>>;
@@ -3,7 +3,7 @@ import { ConnectorKind } from '../gen/ingestion/v1/common_pb';
3
3
  import { RunStatus } from '../gen/ingestion/v1/runs_pb';
4
4
  import { SortBy, SortOrder } from '../gen/ingestion/v1/sorting_pb';
5
5
  import { MetricDimension } from '../gen/metrics/v1/metrics_pb';
6
- import { ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView } from '../pages/observability/types';
6
+ import { ObservabilityRefreshInterval, ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView } from '../pages/observability/types';
7
7
  import { PipelineCanvasView } from '../pages/pipelines/canvas/types';
8
8
  import { SettingsTeamView } from '../pages/settings/types';
9
9
  import { Flow } from './types';
@@ -28,6 +28,7 @@ export declare const teamSearchSchema: z.ZodObject<{
28
28
  export type TeamSearch = z.infer<typeof teamSearchSchema>;
29
29
  export declare const observabilitySearchSchema: z.ZodObject<{
30
30
  timeframe: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof ObservabilityTimeframe>>>;
31
+ refreshInterval: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof ObservabilityRefreshInterval>>>;
31
32
  runs: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof ObservabilityRunsView>>>;
32
33
  throughput: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof ObservabilityThroughputView>>>;
33
34
  throughputPivot: z.ZodCatch<z.ZodOptional<z.ZodEnum<typeof MetricDimension>>>;
@@ -1,7 +1,7 @@
1
1
  import { ConnectorKind } from "../gen/ingestion/v1/common_pb.js";
2
2
  import { SortBy, SortOrder } from "../gen/ingestion/v1/sorting_pb.js";
3
3
  import { RunStatus } from "../gen/ingestion/v1/runs_pb.js";
4
- import { ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView } from "../pages/observability/types.js";
4
+ import { ObservabilityRefreshInterval, ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView } from "../pages/observability/types.js";
5
5
  import { MetricDimension } from "../gen/metrics/v1/metrics_pb.js";
6
6
  import { PipelineCanvasView } from "../pages/pipelines/canvas/types.js";
7
7
  import { SettingsTeamView } from "../pages/settings/types.js";
@@ -26,6 +26,7 @@ z.object({
26
26
  });
27
27
  var observabilitySearchSchema = z.object({
28
28
  timeframe: z.enum(ObservabilityTimeframe).optional().catch(void 0),
29
+ refreshInterval: z.enum(ObservabilityRefreshInterval).optional().catch(void 0),
29
30
  runs: z.enum(ObservabilityRunsView).optional().catch(void 0),
30
31
  throughput: z.enum(ObservabilityThroughputView).optional().catch(void 0),
31
32
  throughputPivot: z.enum(MetricDimension).optional().catch(void 0),
@@ -9,6 +9,8 @@ import { useObservabilitySetup } from "./hooks/useObservabilitySetup.js";
9
9
  import ObservabilitySetupChecklist from "./components/setup/ObservabilitySetupChecklist.js";
10
10
  import { OBSERVABILITY_THROUGHPUT_VIEWS, OBSERVABILITY_THROUGHPUT_VIEW_TO_CONFIG_MAP, OBSERVABILITY_USAGE_VIEWS, OBSERVABILITY_USAGE_VIEW_TO_CONFIG_MAP } from "./components/timeseries/constants.js";
11
11
  import ObservabilityTimeseriesWidget from "./components/timeseries/ObservabilityTimeseriesWidget.js";
12
+ import { useObservabilityScrollTakeover } from "./hooks/useObservabilityScrollTakeover.js";
13
+ /* empty css */
12
14
  import { CpuIcon, GaugeIcon } from "@phosphor-icons/react";
13
15
  import { jsx, jsxs } from "react/jsx-runtime";
14
16
  import Flex, { AlignItems, FlexDirection, FlexWrap } from "@galaxy-io/dls/layout/Flex";
@@ -16,9 +18,13 @@ import FlexItem from "@galaxy-io/dls/layout/FlexItem";
16
18
  import ScrollArea from "@galaxy-io/dls/layout/ScrollArea";
17
19
  import ChartGroupProvider from "@galaxy-io/dls/charts/ChartGroupProvider";
18
20
  import PageLayout from "@galaxy-io/dls/layout/PageLayout";
21
+ import { HAIRLINE_WIDTH } from "@galaxy-io/dls/styles/mixins";
19
22
  //#region src/pages/observability/ObservabilityPage.tsx
23
+ var OBSERVABILITY_PAGE_SCROLL_CSS = "filament-ObservabilityPage-OBSERVABILITY_PAGE_SCROLL_CSS-o1p5bblp";
24
+ var OBSERVABILITY_RUNS_TAKEOVER_HEIGHT = `calc(100cqh + ${HAIRLINE_WIDTH})`;
20
25
  var ObservabilityPage = () => {
21
26
  const { isComplete } = useObservabilitySetup();
27
+ const { scrollRef, takeoverRef } = useObservabilityScrollTakeover(isComplete);
22
28
  if (!isComplete) return /* @__PURE__ */ jsx(PageLayout, {
23
29
  header: "Observability",
24
30
  children: /* @__PURE__ */ jsx(ObservabilitySetupChecklist, {})
@@ -28,59 +34,64 @@ var ObservabilityPage = () => {
28
34
  actions: /* @__PURE__ */ jsx(ObservabilityPageActions, {}),
29
35
  children: /* @__PURE__ */ jsx(ChartGroupProvider, {
30
36
  shouldShareTooltip: true,
31
- children: /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsxs(Flex, {
32
- alignItems: AlignItems.START,
33
- direction: FlexDirection.COLUMN,
34
- padding: 16,
35
- gap: 12,
36
- fillWidth: true,
37
- children: [
38
- /* @__PURE__ */ jsx(ObservabilityMetricsWidget, {}),
39
- /* @__PURE__ */ jsxs(Flex, {
40
- gap: 12,
41
- alignItems: AlignItems.STRETCH,
42
- wrap: FlexWrap.WRAP,
43
- fillWidth: true,
44
- children: [/* @__PURE__ */ jsx(FlexItem, {
45
- grow: 1,
46
- basis: OBSERVABILITY_WIDGET_BASIS,
47
- minWidth: 0,
48
- children: /* @__PURE__ */ jsx(ObservabilityTimeseriesWidget, {
49
- header: "Throughput",
50
- icon: GaugeIcon,
51
- isStacked: true,
52
- views: OBSERVABILITY_THROUGHPUT_VIEWS,
53
- viewToConfigMap: OBSERVABILITY_THROUGHPUT_VIEW_TO_CONFIG_MAP,
54
- defaultView: ObservabilityThroughputView.RECORDS,
55
- viewSearchKey: "throughput",
56
- pivotSearchKey: "throughputPivot"
57
- })
58
- }), /* @__PURE__ */ jsx(FlexItem, {
59
- grow: 1,
60
- basis: OBSERVABILITY_WIDGET_BASIS,
61
- minWidth: 0,
62
- children: /* @__PURE__ */ jsx(ObservabilityTimeseriesWidget, {
63
- header: "Usage",
64
- icon: CpuIcon,
65
- views: OBSERVABILITY_USAGE_VIEWS,
66
- viewToConfigMap: OBSERVABILITY_USAGE_VIEW_TO_CONFIG_MAP,
67
- defaultView: ObservabilityUsageView.CPU,
68
- defaultPivot: MetricDimension.PIPELINE_ID,
69
- viewSearchKey: "usage",
70
- pivotSearchKey: "usagePivot"
71
- })
72
- })]
73
- }),
74
- /* @__PURE__ */ jsx(FlexItem, {
75
- fillWidth: true,
76
- children: /* @__PURE__ */ jsx(ObservabilityRunsChartWidget, {})
77
- }),
78
- /* @__PURE__ */ jsx(FlexItem, {
79
- fillWidth: true,
80
- children: /* @__PURE__ */ jsx(ObservabilityRunsTableWidget, {})
81
- })
82
- ]
83
- }) })
37
+ children: /* @__PURE__ */ jsxs(ScrollArea, {
38
+ ref: scrollRef,
39
+ className: OBSERVABILITY_PAGE_SCROLL_CSS,
40
+ children: [/* @__PURE__ */ jsxs(Flex, {
41
+ alignItems: AlignItems.START,
42
+ direction: FlexDirection.COLUMN,
43
+ padding: 16,
44
+ gap: 12,
45
+ fillWidth: true,
46
+ children: [
47
+ /* @__PURE__ */ jsx(ObservabilityMetricsWidget, {}),
48
+ /* @__PURE__ */ jsxs(Flex, {
49
+ gap: 12,
50
+ alignItems: AlignItems.STRETCH,
51
+ wrap: FlexWrap.WRAP,
52
+ fillWidth: true,
53
+ children: [/* @__PURE__ */ jsx(FlexItem, {
54
+ grow: 1,
55
+ basis: OBSERVABILITY_WIDGET_BASIS,
56
+ minWidth: 0,
57
+ children: /* @__PURE__ */ jsx(ObservabilityTimeseriesWidget, {
58
+ header: "Throughput",
59
+ icon: GaugeIcon,
60
+ isStacked: true,
61
+ views: OBSERVABILITY_THROUGHPUT_VIEWS,
62
+ viewToConfigMap: OBSERVABILITY_THROUGHPUT_VIEW_TO_CONFIG_MAP,
63
+ defaultView: ObservabilityThroughputView.RECORDS,
64
+ viewSearchKey: "throughput",
65
+ pivotSearchKey: "throughputPivot"
66
+ })
67
+ }), /* @__PURE__ */ jsx(FlexItem, {
68
+ grow: 1,
69
+ basis: OBSERVABILITY_WIDGET_BASIS,
70
+ minWidth: 0,
71
+ children: /* @__PURE__ */ jsx(ObservabilityTimeseriesWidget, {
72
+ header: "Usage",
73
+ icon: CpuIcon,
74
+ views: OBSERVABILITY_USAGE_VIEWS,
75
+ viewToConfigMap: OBSERVABILITY_USAGE_VIEW_TO_CONFIG_MAP,
76
+ defaultView: ObservabilityUsageView.CPU,
77
+ defaultPivot: MetricDimension.PIPELINE_ID,
78
+ viewSearchKey: "usage",
79
+ pivotSearchKey: "usagePivot"
80
+ })
81
+ })]
82
+ }),
83
+ /* @__PURE__ */ jsx(FlexItem, {
84
+ fillWidth: true,
85
+ children: /* @__PURE__ */ jsx(ObservabilityRunsChartWidget, {})
86
+ })
87
+ ]
88
+ }), /* @__PURE__ */ jsx(Flex, {
89
+ ref: takeoverRef,
90
+ direction: FlexDirection.COLUMN,
91
+ height: OBSERVABILITY_RUNS_TAKEOVER_HEIGHT,
92
+ children: /* @__PURE__ */ jsx(ObservabilityRunsTableWidget, {})
93
+ })]
94
+ })
84
95
  })
85
96
  });
86
97
  };
@@ -1,14 +1,17 @@
1
1
  import { useFilamentSearchUpdate, useObservabilitySearch } from "../../../module/hooks.js";
2
2
  import { useRefreshObservabilityQueries } from "../../../api/queries/metrics.js";
3
+ import ObservabilityRefreshIntervalSelect from "./ObservabilityRefreshIntervalSelect.js";
3
4
  import ObservabilityTimeframeSwitcher from "./ObservabilityTimeframeSwitcher.js";
4
5
  import { ArrowsClockwiseIcon } from "@phosphor-icons/react";
5
6
  import Button, { ButtonVariant } from "@galaxy-io/dls/buttons/Button";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { useState } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
9
  //#region src/pages/observability/components/ObservabilityPageActions.tsx
8
10
  var ObservabilityPageActions = () => {
9
11
  const updateSearch = useFilamentSearchUpdate();
10
12
  const refresh = useRefreshObservabilityQueries();
11
- const { timeframe } = useObservabilitySearch();
13
+ const [isRefreshing, setIsRefreshing] = useState(false);
14
+ const { timeframe, refreshInterval } = useObservabilitySearch();
12
15
  const handleTimeframeChange = (timeframe) => {
13
16
  updateSearch((prev) => ({
14
17
  ...prev,
@@ -17,16 +20,35 @@ var ObservabilityPageActions = () => {
17
20
  runsStatus: void 0
18
21
  }));
19
22
  };
20
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ObservabilityTimeframeSwitcher, {
21
- value: timeframe,
22
- onChange: handleTimeframeChange
23
- }), /* @__PURE__ */ jsx(Button, {
24
- icon: ArrowsClockwiseIcon,
25
- variant: ButtonVariant.SECONDARY,
26
- ariaLabel: "Refresh",
27
- tooltip: "Refresh",
28
- onClick: refresh
29
- })] });
23
+ const handleRefreshIntervalChange = (refreshInterval) => {
24
+ updateSearch((prev) => ({
25
+ ...prev,
26
+ refreshInterval
27
+ }));
28
+ };
29
+ const handleRefresh = async () => {
30
+ setIsRefreshing(true);
31
+ await refresh();
32
+ setIsRefreshing(false);
33
+ };
34
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
35
+ /* @__PURE__ */ jsx(ObservabilityTimeframeSwitcher, {
36
+ value: timeframe,
37
+ onChange: handleTimeframeChange
38
+ }),
39
+ /* @__PURE__ */ jsx(ObservabilityRefreshIntervalSelect, {
40
+ value: refreshInterval,
41
+ onChange: handleRefreshIntervalChange
42
+ }),
43
+ /* @__PURE__ */ jsx(Button, {
44
+ icon: ArrowsClockwiseIcon,
45
+ variant: ButtonVariant.SECONDARY,
46
+ ariaLabel: "Refresh",
47
+ tooltip: "Refresh",
48
+ isLoading: isRefreshing,
49
+ onClick: handleRefresh
50
+ })
51
+ ] });
30
52
  };
31
53
  //#endregion
32
54
  export { ObservabilityPageActions as default };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { ObservabilityRefreshInterval } from '../types';
3
+ interface ObservabilityRefreshIntervalSelectProps {
4
+ value: ObservabilityRefreshInterval;
5
+ onChange: (refreshInterval: ObservabilityRefreshInterval) => void;
6
+ }
7
+ declare const ObservabilityRefreshIntervalSelect: FC<ObservabilityRefreshIntervalSelectProps>;
8
+ export default ObservabilityRefreshIntervalSelect;
@@ -0,0 +1,26 @@
1
+ import { ObservabilityRefreshInterval } from "../types.js";
2
+ import { OBSERVABILITY_REFRESH_INTERVAL_TO_LABEL_MAP } from "../constants.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import SelectInput from "@galaxy-io/dls/inputs/SelectInput";
5
+ import Box from "@galaxy-io/dls/layout/Box";
6
+ //#region src/pages/observability/components/ObservabilityRefreshIntervalSelect.tsx
7
+ var ObservabilityRefreshIntervalSelect = ({ value, onChange }) => {
8
+ const options = Object.values(ObservabilityRefreshInterval).map((refreshInterval) => ({
9
+ id: refreshInterval,
10
+ label: OBSERVABILITY_REFRESH_INTERVAL_TO_LABEL_MAP[refreshInterval]
11
+ }));
12
+ return /* @__PURE__ */ jsx(Box, {
13
+ width: 160,
14
+ children: /* @__PURE__ */ jsx(SelectInput, {
15
+ fillWidth: true,
16
+ options,
17
+ value,
18
+ onChange: (refreshInterval) => {
19
+ if (refreshInterval !== null) onChange(refreshInterval);
20
+ },
21
+ ariaLabel: "Refresh interval"
22
+ })
23
+ });
24
+ };
25
+ //#endregion
26
+ export { ObservabilityRefreshIntervalSelect as default };
@@ -1,11 +1,12 @@
1
1
  import { ObservabilityTimeframe } from "../types.js";
2
+ import { OBSERVABILITY_TIMEFRAME_TO_LABEL_MAP } from "../constants.js";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import ToggleInput, { ToggleInputVariant } from "@galaxy-io/dls/inputs/ToggleInput";
4
5
  //#region src/pages/observability/components/ObservabilityTimeframeSwitcher.tsx
5
6
  var ObservabilityTimeframeSwitcher = ({ value, onChange }) => {
6
7
  const items = Object.values(ObservabilityTimeframe).map((timeframe) => ({
7
8
  id: timeframe,
8
- label: timeframe
9
+ label: OBSERVABILITY_TIMEFRAME_TO_LABEL_MAP[timeframe]
9
10
  }));
10
11
  return /* @__PURE__ */ jsx(ToggleInput, {
11
12
  variant: ToggleInputVariant.PRIMARY,
@@ -4,6 +4,7 @@ import { PIPELINE_RUN_STATUS_TO_LABEL_MAP } from "../../../../components/runs/co
4
4
  import PipelineRunStatusSwatch from "../../../../components/runs/PipelineRunStatusSwatch.js";
5
5
  import { OBSERVABILITY_RUNS_SCHEDULED_INPUT } from "../runs/constants.js";
6
6
  import { Metric, MetricDimension, QueryAggregateRequestSchema } from "../../../../gen/metrics/v1/metrics_pb.js";
7
+ import { OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP } from "../../constants.js";
7
8
  import { useObservabilitySearch } from "../../../../module/hooks.js";
8
9
  import { useListRunsQuery } from "../../../../api/queries/runs.js";
9
10
  import { OBSERVABILITY_METRICS_FEATURED_STATUSES, OBSERVABILITY_METRICS_OTHER_STATUSES } from "./constants.js";
@@ -22,7 +23,7 @@ import BigNumber from "@galaxy-io/dls/charts/BigNumber";
22
23
  import BigNumberGroup, { BigNumberGroupVariant } from "@galaxy-io/dls/charts/BigNumberGroup";
23
24
  //#region src/pages/observability/components/metrics/ObservabilityMetricsWidget.tsx
24
25
  var ObservabilityMetricsWidget = () => {
25
- const { timeframe } = useObservabilitySearch();
26
+ const { timeframe, refreshInterval } = useObservabilitySearch();
26
27
  const bucketStartMs = useObservabilityBucketStart(timeframe);
27
28
  const { totalsInput, statusCountsInput } = useMemo(() => {
28
29
  const sinceMs = createTimeframeSince(timeframe, bucketStartMs);
@@ -42,8 +43,14 @@ var ObservabilityMetricsWidget = () => {
42
43
  })
43
44
  };
44
45
  }, [timeframe, bucketStartMs]);
45
- const { data: totalsData, isLoading: isTotalsLoading } = useQueryAggregateQuery({ input: totalsInput });
46
- const { data: statusCountsData, isLoading: isStatusCountsLoading } = useQueryAggregateQuery({ input: statusCountsInput });
46
+ const { data: totalsData, isLoading: isTotalsLoading } = useQueryAggregateQuery({
47
+ input: totalsInput,
48
+ options: { refetchInterval: OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP[refreshInterval] }
49
+ });
50
+ const { data: statusCountsData, isLoading: isStatusCountsLoading } = useQueryAggregateQuery({
51
+ input: statusCountsInput,
52
+ options: { refetchInterval: OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP[refreshInterval] }
53
+ });
47
54
  const { data: scheduledData, isLoading: isScheduledLoading } = useListRunsQuery({ input: OBSERVABILITY_RUNS_SCHEDULED_INPUT });
48
55
  const [totalRuns = 0, totalRecords = 0, totalBytes = 0] = totalsData?.rows[0]?.values ?? [];
49
56
  const countsByStatus = useMemo(() => new Map((statusCountsData?.rows ?? []).map((row) => [mapOptionIdToEnum(RunStatus, row.key), row.values[0] ?? 0])), [statusCountsData]);
@@ -1,5 +1,5 @@
1
1
  import { OBSERVABILITY_RUNS_NO_STATUSES_PLACEHOLDER, OBSERVABILITY_RUNS_SERIES } from "./constants.js";
2
- import { OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
2
+ import { OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
3
3
  import { useFilamentSearchUpdate, useObservabilitySearch } from "../../../../module/hooks.js";
4
4
  import { getBucketLabelFormatter } from "../../utils.js";
5
5
  import { useObservabilityBucketStart } from "../../hooks/useObservabilityBucketStart.js";
@@ -12,7 +12,7 @@ import BarChart from "@galaxy-io/dls/charts/BarChart";
12
12
  //#region src/pages/observability/components/runs/ObservabilityRunsChart.tsx
13
13
  var ObservabilityRunsChart = () => {
14
14
  const updateSearch = useFilamentSearchUpdate();
15
- const { timeframe, statuses, runsBucket, runsStatus } = useObservabilitySearch();
15
+ const { timeframe, refreshInterval, statuses, runsBucket, runsStatus } = useObservabilitySearch();
16
16
  const bucketStartMs = useObservabilityBucketStart(timeframe);
17
17
  const bucketLabelFormatter = getBucketLabelFormatter(OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity);
18
18
  const input = useMemo(() => createRunCountTimeseriesInput(timeframe, bucketStartMs, statuses), [
@@ -20,9 +20,12 @@ var ObservabilityRunsChart = () => {
20
20
  bucketStartMs,
21
21
  statuses
22
22
  ]);
23
- const { data, isLoading } = useQueryTimeseriesQuery({
23
+ const { data, isFetching } = useQueryTimeseriesQuery({
24
24
  input,
25
- options: { enabled: statuses.length > 0 }
25
+ options: {
26
+ enabled: statuses.length > 0,
27
+ refetchInterval: OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP[refreshInterval]
28
+ }
26
29
  });
27
30
  const groups = useMemo(() => {
28
31
  if (!statuses.length) return [];
@@ -52,7 +55,7 @@ var ObservabilityRunsChart = () => {
52
55
  selection,
53
56
  onSelectionChange: handleSelectionChange,
54
57
  isFilterable: true,
55
- isLoading,
58
+ isLoading: isFetching,
56
59
  placeholder: statuses.length ? void 0 : OBSERVABILITY_RUNS_NO_STATUSES_PLACEHOLDER,
57
60
  ariaLabel: "Runs by status",
58
61
  minSegmentLength: 4
@@ -13,7 +13,6 @@ import PipelineRunVolume from "../../../../components/runs/PipelineRunVolume.js"
13
13
  import { OBSERVABILITY_RUNS_TABLE_BASE_COLUMNS } from "./columns/constants.js";
14
14
  import { useMemo } from "react";
15
15
  import { jsx } from "react/jsx-runtime";
16
- import Box from "@galaxy-io/dls/layout/Box";
17
16
  import Text, { TextSize } from "@galaxy-io/dls/text/Text";
18
17
  import { EMPTY_VALUE, formatBytes, formatDuration } from "@galaxy-io/dls/utils/format";
19
18
  import { FontFamily } from "@galaxy-io/dls/theme/enums";
@@ -103,22 +102,19 @@ var ObservabilityRunsPastTable = () => {
103
102
  search: { runId: [row.id] }
104
103
  });
105
104
  };
106
- return /* @__PURE__ */ jsx(Box, {
107
- height: 450,
108
- children: /* @__PURE__ */ jsx(InfiniteTable, {
109
- columns: OBSERVABILITY_RUNS_PAST_TABLE_COLUMNS,
110
- data: runs,
111
- getRowId: (run) => run.id,
112
- onRowClick: handleRowClick,
113
- isLoading: isLoading || isFetchingNextPage,
114
- onEndReached: () => {
115
- if (hasNextPage) fetchNextPage();
116
- },
117
- ariaLabel: "Recent runs",
118
- emptyState: /* @__PURE__ */ jsx(EmptyLayout, {
119
- size: EmptyLayoutSize.SMALL,
120
- header: OBSERVABILITY_RUNS_EMPTY_STATE_TEXT_MAP[ObservabilityRunsView.PAST]
121
- })
105
+ return /* @__PURE__ */ jsx(InfiniteTable, {
106
+ columns: OBSERVABILITY_RUNS_PAST_TABLE_COLUMNS,
107
+ data: runs,
108
+ getRowId: (run) => run.id,
109
+ onRowClick: handleRowClick,
110
+ isLoading: isLoading || isFetchingNextPage,
111
+ onEndReached: () => {
112
+ if (hasNextPage) fetchNextPage();
113
+ },
114
+ ariaLabel: "History",
115
+ emptyState: /* @__PURE__ */ jsx(EmptyLayout, {
116
+ size: EmptyLayoutSize.SMALL,
117
+ header: OBSERVABILITY_RUNS_EMPTY_STATE_TEXT_MAP[ObservabilityRunsView.PAST]
122
118
  })
123
119
  });
124
120
  };
@@ -14,7 +14,7 @@ var ObservabilityRunsScheduledChart = () => {
14
14
  const { timeframe } = useObservabilitySearch();
15
15
  const bucketStartMs = useObservabilityBucketStart(timeframe);
16
16
  const bucketLabelFormatter = getBucketLabelFormatter(OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity);
17
- const { data, isLoading } = useListRunsQuery({ input: OBSERVABILITY_RUNS_SCHEDULED_INPUT });
17
+ const { data, isFetching } = useListRunsQuery({ input: OBSERVABILITY_RUNS_SCHEDULED_INPUT });
18
18
  const groups = useMemo(() => createScheduledRunsChartGroups(data?.runs ?? [], timeframe, bucketStartMs), [
19
19
  data,
20
20
  timeframe,
@@ -30,7 +30,7 @@ var ObservabilityRunsScheduledChart = () => {
30
30
  series: OBSERVABILITY_RUNS_SCHEDULED_SERIES,
31
31
  groups,
32
32
  labelFormatter: bucketLabelFormatter,
33
- isLoading,
33
+ isLoading: isFetching,
34
34
  ariaLabel: "Scheduled runs"
35
35
  })
36
36
  });
@@ -3,13 +3,16 @@ import { OBSERVABILITY_RUNS_VIEW_TO_TABLE_HEADER_MAP } from "./constants.js";
3
3
  import { useObservabilitySearch } from "../../../../module/hooks.js";
4
4
  import ObservabilityRunsPastTable from "./ObservabilityRunsPastTable.js";
5
5
  import ObservabilityRunsUpcomingTable from "./ObservabilityRunsUpcomingTable.js";
6
+ /* empty css */
6
7
  import { ListIcon } from "@phosphor-icons/react";
7
8
  import { jsx } from "react/jsx-runtime";
8
9
  import Widget from "@galaxy-io/dls/widget/Widget";
9
10
  //#region src/pages/observability/components/runs/ObservabilityRunsTableWidget.tsx
11
+ var OBSERVABILITY_RUNS_TABLE_WIDGET_CSS = "filament-ObservabilityRunsTableWidget-OBSERVABILITY_RUNS_TABLE_WIDGET_CSS-o1fcmgrf";
10
12
  var ObservabilityRunsTableWidget = () => {
11
13
  const { runs: view } = useObservabilitySearch();
12
14
  return /* @__PURE__ */ jsx(Widget, {
15
+ className: OBSERVABILITY_RUNS_TABLE_WIDGET_CSS,
13
16
  isFlush: true,
14
17
  gap: 0,
15
18
  header: OBSERVABILITY_RUNS_VIEW_TO_TABLE_HEADER_MAP[view],
@@ -7,7 +7,6 @@ import { formatTimestamp } from "../../../../utils/format.js";
7
7
  import { OBSERVABILITY_RUNS_TABLE_BASE_COLUMNS } from "./columns/constants.js";
8
8
  import { useMemo } from "react";
9
9
  import { jsx } from "react/jsx-runtime";
10
- import Box from "@galaxy-io/dls/layout/Box";
11
10
  import Text, { TextSize } from "@galaxy-io/dls/text/Text";
12
11
  import EmptyLayout, { EmptyLayoutSize } from "@galaxy-io/dls/layout/EmptyLayout";
13
12
  import InfiniteTable from "@galaxy-io/dls/table/InfiniteTable";
@@ -33,19 +32,16 @@ var ObservabilityRunsUpcomingTable = () => {
33
32
  search: { runId: [row.id] }
34
33
  });
35
34
  };
36
- return /* @__PURE__ */ jsx(Box, {
37
- height: 450,
38
- children: /* @__PURE__ */ jsx(InfiniteTable, {
39
- columns: OBSERVABILITY_RUNS_UPCOMING_TABLE_COLUMNS,
40
- data: runs,
41
- getRowId: (run) => run.id,
42
- onRowClick: handleRowClick,
43
- isLoading,
44
- ariaLabel: "Upcoming runs",
45
- emptyState: /* @__PURE__ */ jsx(EmptyLayout, {
46
- size: EmptyLayoutSize.SMALL,
47
- header: OBSERVABILITY_RUNS_EMPTY_STATE_TEXT_MAP[ObservabilityRunsView.UPCOMING]
48
- })
35
+ return /* @__PURE__ */ jsx(InfiniteTable, {
36
+ columns: OBSERVABILITY_RUNS_UPCOMING_TABLE_COLUMNS,
37
+ data: runs,
38
+ getRowId: (run) => run.id,
39
+ onRowClick: handleRowClick,
40
+ isLoading,
41
+ ariaLabel: "Upcoming runs",
42
+ emptyState: /* @__PURE__ */ jsx(EmptyLayout, {
43
+ size: EmptyLayoutSize.SMALL,
44
+ header: OBSERVABILITY_RUNS_EMPTY_STATE_TEXT_MAP[ObservabilityRunsView.UPCOMING]
49
45
  })
50
46
  });
51
47
  };
@@ -25,7 +25,6 @@ export declare const OBSERVABILITY_RUNS_TABLE_COLUMN_WIDTH_RECORDS = 100;
25
25
  export declare const OBSERVABILITY_RUNS_TABLE_COLUMN_WIDTH_VOLUME = 100;
26
26
  export declare const OBSERVABILITY_RUNS_TABLE_COLUMN_WIDTH_CPU = 100;
27
27
  export declare const OBSERVABILITY_RUNS_TABLE_COLUMN_WIDTH_MEMORY = 100;
28
- export declare const OBSERVABILITY_RUNS_TABLE_HEIGHT = 450;
29
28
  export declare const OBSERVABILITY_RUNS_CHART_HEIGHT = 240;
30
29
  export declare const OBSERVABILITY_RUNS_STATUS_SELECT_WIDTH = 160;
31
30
  export declare const OBSERVABILITY_RUNS_CHART_MIN_SEGMENT_LENGTH = 4;
@@ -18,7 +18,7 @@ var OBSERVABILITY_RUNS_VIEW_TO_LABEL_MAP = {
18
18
  [ObservabilityRunsView.UPCOMING]: "Upcoming"
19
19
  };
20
20
  var OBSERVABILITY_RUNS_VIEW_TO_TABLE_HEADER_MAP = {
21
- [ObservabilityRunsView.PAST]: "Recent runs",
21
+ [ObservabilityRunsView.PAST]: "History",
22
22
  [ObservabilityRunsView.UPCOMING]: "Upcoming runs"
23
23
  };
24
24
  var OBSERVABILITY_RUNS_EMPTY_STATE_TEXT_MAP = {
@@ -2,7 +2,7 @@ import { RunStatus } from "../../../../gen/ingestion/v1/runs_pb.js";
2
2
  import { mapOptionIdToEnum } from "../../../../utils/select.js";
3
3
  import { PIPELINE_RUN_STATUS_TO_HUE_MAP, PIPELINE_RUN_STATUS_TO_LABEL_MAP } from "../../../../components/runs/constants.js";
4
4
  import { MetricDimension } from "../../../../gen/metrics/v1/metrics_pb.js";
5
- import { OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
5
+ import { OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP } from "../../constants.js";
6
6
  import { useObservabilitySearch } from "../../../../module/hooks.js";
7
7
  import { formatPipelineName } from "../../../../components/pipelines/utils.js";
8
8
  import { useGetPipelineQueries } from "../../../../api/queries/pipelines.js";
@@ -18,7 +18,7 @@ import AreaChart from "@galaxy-io/dls/charts/AreaChart";
18
18
  import LineChart from "@galaxy-io/dls/charts/LineChart";
19
19
  //#region src/pages/observability/components/timeseries/ObservabilityTimeseriesChart.tsx
20
20
  var ObservabilityTimeseriesChart = ({ seriesLabel, metric, color, pivot, curve, isStacked, valueFormatter }) => {
21
- const { timeframe } = useObservabilitySearch();
21
+ const { timeframe, refreshInterval } = useObservabilitySearch();
22
22
  const pivotDimension = pivot ?? MetricDimension.UNSPECIFIED;
23
23
  const bucketStartMs = useObservabilityBucketStart(timeframe);
24
24
  const bucketLabelFormatter = getBucketLabelFormatter(OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity);
@@ -31,7 +31,10 @@ var ObservabilityTimeseriesChart = ({ seriesLabel, metric, color, pivot, curve,
31
31
  metric,
32
32
  pivotDimension
33
33
  ]);
34
- const { data, isLoading } = useQueryTimeseriesQuery({ input });
34
+ const { data, isFetching } = useQueryTimeseriesQuery({
35
+ input,
36
+ options: { refetchInterval: OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP[refreshInterval] }
37
+ });
35
38
  const pivotPipelineIds = useMemo(() => pivotDimension === MetricDimension.PIPELINE_ID ? (data?.series ?? []).map((keySeries) => keySeries.key) : [], [data, pivotDimension]);
36
39
  const pivotPipelines = useGetPipelineQueries(pivotPipelineIds);
37
40
  const { series, lines } = useMemo(() => {
@@ -80,7 +83,7 @@ var ObservabilityTimeseriesChart = ({ seriesLabel, metric, color, pivot, curve,
80
83
  curve,
81
84
  valueFormatter,
82
85
  labelFormatter: bucketLabelFormatter,
83
- isLoading,
86
+ isLoading: isFetching,
84
87
  swatch: ChartSwatch.SQUARE,
85
88
  hasLegend: true,
86
89
  isFilterable: true,
@@ -91,7 +94,7 @@ var ObservabilityTimeseriesChart = ({ seriesLabel, metric, color, pivot, curve,
91
94
  curve,
92
95
  valueFormatter,
93
96
  labelFormatter: bucketLabelFormatter,
94
- isLoading,
97
+ isLoading: isFetching,
95
98
  swatch: ChartSwatch.SQUARE,
96
99
  hasLegend: true,
97
100
  isFilterable: true
@@ -1,9 +1,16 @@
1
1
  import { MetricGranularity } from '../../gen/metrics/v1/metrics_pb';
2
- import { ObservabilityRunsView, ObservabilityTimeframe, ObservabilityTimeframeQuery } from './types';
2
+ import { ObservabilityRefreshInterval, ObservabilityRunsView, ObservabilityTimeframe, ObservabilityTimeframeQuery } from './types';
3
3
  export declare const OBSERVABILITY_WIDGET_BASIS = "400px";
4
+ export declare const OBSERVABILITY_SCROLL_END_TOLERANCE_PX = 1;
5
+ export declare const OBSERVABILITY_WHEEL_LINE_PX = 16;
4
6
  export declare const OBSERVABILITY_DEFAULT_TIMEFRAME = ObservabilityTimeframe.TWENTY_FOUR_HOURS;
5
7
  export declare const OBSERVABILITY_DEFAULT_RUNS_VIEW = ObservabilityRunsView.PAST;
8
+ export declare const OBSERVABILITY_DEFAULT_REFRESH_INTERVAL = ObservabilityRefreshInterval.ONE_MINUTE;
6
9
  export declare const OBSERVABILITY_HOUR_MS: number;
7
10
  export declare const OBSERVABILITY_DAY_BUCKET_MIDPOINT_MS: number;
8
11
  export declare const OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP: Record<MetricGranularity, number>;
9
12
  export declare const OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP: Record<ObservabilityTimeframe, ObservabilityTimeframeQuery>;
13
+ export declare const OBSERVABILITY_TIMEFRAME_TO_LABEL_MAP: Record<ObservabilityTimeframe, string>;
14
+ export declare const OBSERVABILITY_REFRESH_INTERVAL_TO_LABEL_MAP: Record<ObservabilityRefreshInterval, string>;
15
+ export declare const OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP: Record<ObservabilityRefreshInterval, number>;
16
+ export declare const OBSERVABILITY_REFRESH_INTERVAL_SELECT_WIDTH = 160;
@@ -1,10 +1,12 @@
1
- import { ObservabilityRunsView, ObservabilityTimeframe } from "./types.js";
1
+ import { ObservabilityRefreshInterval, ObservabilityRunsView, ObservabilityTimeframe } from "./types.js";
2
2
  import { MetricGranularity } from "../../gen/metrics/v1/metrics_pb.js";
3
3
  //#region src/pages/observability/constants.ts
4
4
  var OBSERVABILITY_WIDGET_BASIS = "400px";
5
5
  var OBSERVABILITY_DEFAULT_TIMEFRAME = ObservabilityTimeframe.TWENTY_FOUR_HOURS;
6
6
  var OBSERVABILITY_DEFAULT_RUNS_VIEW = ObservabilityRunsView.PAST;
7
- var OBSERVABILITY_HOUR_MS = 36e5;
7
+ var OBSERVABILITY_DEFAULT_REFRESH_INTERVAL = ObservabilityRefreshInterval.ONE_MINUTE;
8
+ var OBSERVABILITY_MINUTE_MS = 6e4;
9
+ var OBSERVABILITY_HOUR_MS = 60 * OBSERVABILITY_MINUTE_MS;
8
10
  var OBSERVABILITY_DAY_MS = 24 * OBSERVABILITY_HOUR_MS;
9
11
  var OBSERVABILITY_DAY_BUCKET_MIDPOINT_MS = OBSERVABILITY_DAY_MS / 2;
10
12
  var OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP = {
@@ -26,5 +28,24 @@ var OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP = {
26
28
  granularity: MetricGranularity.DAY
27
29
  }
28
30
  };
31
+ var OBSERVABILITY_TIMEFRAME_TO_LABEL_MAP = {
32
+ [ObservabilityTimeframe.TWENTY_FOUR_HOURS]: "24 hours",
33
+ [ObservabilityTimeframe.SEVEN_DAYS]: "7 days",
34
+ [ObservabilityTimeframe.THIRTY_DAYS]: "30 days"
35
+ };
36
+ var OBSERVABILITY_REFRESH_INTERVAL_TO_LABEL_MAP = {
37
+ [ObservabilityRefreshInterval.ONE_MINUTE]: "Every minute",
38
+ [ObservabilityRefreshInterval.FIVE_MINUTES]: "Every 5 minutes",
39
+ [ObservabilityRefreshInterval.FIFTEEN_MINUTES]: "Every 15 minutes",
40
+ [ObservabilityRefreshInterval.THIRTY_MINUTES]: "Every 30 minutes",
41
+ [ObservabilityRefreshInterval.ONE_HOUR]: "Every hour"
42
+ };
43
+ var OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP = {
44
+ [ObservabilityRefreshInterval.ONE_MINUTE]: OBSERVABILITY_MINUTE_MS,
45
+ [ObservabilityRefreshInterval.FIVE_MINUTES]: 5 * OBSERVABILITY_MINUTE_MS,
46
+ [ObservabilityRefreshInterval.FIFTEEN_MINUTES]: 15 * OBSERVABILITY_MINUTE_MS,
47
+ [ObservabilityRefreshInterval.THIRTY_MINUTES]: 30 * OBSERVABILITY_MINUTE_MS,
48
+ [ObservabilityRefreshInterval.ONE_HOUR]: OBSERVABILITY_HOUR_MS
49
+ };
29
50
  //#endregion
30
- export { OBSERVABILITY_DAY_BUCKET_MIDPOINT_MS, OBSERVABILITY_DEFAULT_RUNS_VIEW, OBSERVABILITY_DEFAULT_TIMEFRAME, OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP, OBSERVABILITY_HOUR_MS, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP, OBSERVABILITY_WIDGET_BASIS };
51
+ export { OBSERVABILITY_DAY_BUCKET_MIDPOINT_MS, OBSERVABILITY_DEFAULT_REFRESH_INTERVAL, OBSERVABILITY_DEFAULT_RUNS_VIEW, OBSERVABILITY_DEFAULT_TIMEFRAME, OBSERVABILITY_GRANULARITY_TO_DURATION_MS_MAP, OBSERVABILITY_HOUR_MS, OBSERVABILITY_REFRESH_INTERVAL_TO_LABEL_MAP, OBSERVABILITY_REFRESH_INTERVAL_TO_MS_MAP, OBSERVABILITY_TIMEFRAME_TO_LABEL_MAP, OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP, OBSERVABILITY_WIDGET_BASIS };
@@ -0,0 +1,4 @@
1
+ export declare const useObservabilityScrollTakeover: (isEnabled: boolean) => {
2
+ scrollRef: import('react').RefObject<HTMLDivElement>;
3
+ takeoverRef: import('react').RefObject<HTMLElement>;
4
+ };
@@ -0,0 +1,27 @@
1
+ import { getObservabilityWheelDeltaPx, isObservabilityScrolledToEnd } from "../utils.js";
2
+ import { useEffect, useRef } from "react";
3
+ //#region src/pages/observability/hooks/useObservabilityScrollTakeover.ts
4
+ var useObservabilityScrollTakeover = (isEnabled) => {
5
+ const scrollRef = useRef(null);
6
+ const takeoverRef = useRef(null);
7
+ useEffect(() => {
8
+ const scroll = scrollRef.current;
9
+ if (!isEnabled || scroll === null) return;
10
+ const handleWheel = (event) => {
11
+ const takeover = takeoverRef.current;
12
+ if (event.deltaY <= 0 || event.ctrlKey || takeover === null) return;
13
+ if (!(event.target instanceof Node) || !takeover.contains(event.target)) return;
14
+ if (isObservabilityScrolledToEnd(scroll)) return;
15
+ event.preventDefault();
16
+ scroll.scrollBy({ top: getObservabilityWheelDeltaPx(event, scroll.clientHeight) });
17
+ };
18
+ scroll.addEventListener("wheel", handleWheel, { passive: false });
19
+ return () => scroll.removeEventListener("wheel", handleWheel);
20
+ }, [isEnabled]);
21
+ return {
22
+ scrollRef,
23
+ takeoverRef
24
+ };
25
+ };
26
+ //#endregion
27
+ export { useObservabilityScrollTakeover };
@@ -4,6 +4,13 @@ export declare enum ObservabilityTimeframe {
4
4
  SEVEN_DAYS = "7D",
5
5
  THIRTY_DAYS = "30D"
6
6
  }
7
+ export declare enum ObservabilityRefreshInterval {
8
+ ONE_MINUTE = "1M",
9
+ FIVE_MINUTES = "5M",
10
+ FIFTEEN_MINUTES = "15M",
11
+ THIRTY_MINUTES = "30M",
12
+ ONE_HOUR = "1H"
13
+ }
7
14
  export declare enum ObservabilityRunsView {
8
15
  PAST = "PAST",
9
16
  UPCOMING = "UPCOMING"
@@ -5,6 +5,14 @@ var ObservabilityTimeframe = /* @__PURE__ */ function(ObservabilityTimeframe) {
5
5
  ObservabilityTimeframe["THIRTY_DAYS"] = "30D";
6
6
  return ObservabilityTimeframe;
7
7
  }({});
8
+ var ObservabilityRefreshInterval = /* @__PURE__ */ function(ObservabilityRefreshInterval) {
9
+ ObservabilityRefreshInterval["ONE_MINUTE"] = "1M";
10
+ ObservabilityRefreshInterval["FIVE_MINUTES"] = "5M";
11
+ ObservabilityRefreshInterval["FIFTEEN_MINUTES"] = "15M";
12
+ ObservabilityRefreshInterval["THIRTY_MINUTES"] = "30M";
13
+ ObservabilityRefreshInterval["ONE_HOUR"] = "1H";
14
+ return ObservabilityRefreshInterval;
15
+ }({});
8
16
  var ObservabilityRunsView = /* @__PURE__ */ function(ObservabilityRunsView) {
9
17
  ObservabilityRunsView["PAST"] = "PAST";
10
18
  ObservabilityRunsView["UPCOMING"] = "UPCOMING";
@@ -21,4 +29,4 @@ var ObservabilityUsageView = /* @__PURE__ */ function(ObservabilityUsageView) {
21
29
  return ObservabilityUsageView;
22
30
  }({});
23
31
  //#endregion
24
- export { ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView };
32
+ export { ObservabilityRefreshInterval, ObservabilityRunsView, ObservabilityThroughputView, ObservabilityTimeframe, ObservabilityUsageView };
@@ -10,3 +10,5 @@ export declare const createObservabilityTimeseriesInput: (timeframe: Observabili
10
10
  groupBy: MetricDimension;
11
11
  filters?: MetricFilter[];
12
12
  }) => QueryTimeseriesRequest;
13
+ export declare const isObservabilityScrolledToEnd: (scroll: HTMLElement) => boolean;
14
+ export declare const getObservabilityWheelDeltaPx: (event: WheelEvent, pageHeight: number) => number;
@@ -22,5 +22,7 @@ var createObservabilityTimeseriesInput = (timeframe, bucketStartMs, init) => cre
22
22
  granularity: OBSERVABILITY_TIMEFRAME_TO_QUERY_MAP[timeframe].granularity,
23
23
  tzOffsetMinutes: -new Date(bucketStartMs).getTimezoneOffset()
24
24
  });
25
+ var isObservabilityScrolledToEnd = (scroll) => scroll.scrollTop + scroll.clientHeight >= scroll.scrollHeight - 1;
26
+ var getObservabilityWheelDeltaPx = (event, pageHeight) => match(event.deltaMode).with(WheelEvent.DOM_DELTA_LINE, () => event.deltaY * 16).with(WheelEvent.DOM_DELTA_PAGE, () => event.deltaY * pageHeight).otherwise(() => event.deltaY);
25
27
  //#endregion
26
- export { createObservabilityTimeseriesInput, createTimeframeSince, formatBucketKey, getBucketLabelFormatter, getBucketOffset, getBucketStart };
28
+ export { createObservabilityTimeseriesInput, createTimeframeSince, formatBucketKey, getBucketLabelFormatter, getBucketOffset, getBucketStart, getObservabilityWheelDeltaPx, isObservabilityScrolledToEnd };
@@ -3,7 +3,7 @@ import { getEnumSelectValue, mapOptionIdToEnum } from "../../../../utils/select.
3
3
  import { ConnectorTileSize } from "../../../../components/connections/types.js";
4
4
  import { ResourceCursorConfigSchema } from "../../../../gen/ingestion/v1/pipelines_pb.js";
5
5
  import ConnectorTile from "../../../../components/connections/ConnectorTile.js";
6
- import { getCompatibleWriteModes, getCursorSelectOptions, getReadModeSelectOptions, getRecommendedCursor, getWriteModeSelectOptions } from "../../components/resource/utils.js";
6
+ import { getCompatibleWriteModes, getCursorSelectOptions, getDefaultReadMode, getReadModeSelectOptions, getWriteModeSelectOptions } from "../../components/resource/utils.js";
7
7
  import { PIPELINE_CANVAS_NODE_SINK_HANDLE_ID } from "../constants.js";
8
8
  import { getEdgeResourceStatus, hasSiblingIncrementalRead } from "../utils.js";
9
9
  import { usePipelineCanvasState } from "../providers/canvas/PipelineCanvasProvider.js";
@@ -92,8 +92,12 @@ var PipelineCanvasRoutesDraftRow = ({ draftState }) => {
92
92
  })), [sinks]);
93
93
  if (!draft) return null;
94
94
  const siblingEdges = edges.filter((edge) => edge.source === draftEdge.source && edge.target === draftEdge.target);
95
- const hasRecommendedCursor = getRecommendedCursor(columns ?? []) !== "";
96
- const defaultReadMode = (isManagedIncremental || hasRecommendedCursor) && readModeOptions.includes(ReadMode.INCREMENTAL) ? ReadMode.INCREMENTAL : effectiveReadMode;
95
+ const defaultReadMode = getDefaultReadMode({
96
+ columns: columns ?? [],
97
+ readModeOptions,
98
+ managedIncremental: isManagedIncremental,
99
+ fallback: effectiveReadMode
100
+ });
97
101
  const readMode = draft.readMode ?? defaultReadMode;
98
102
  const routeHasIncremental = readMode === ReadMode.INCREMENTAL || hasSiblingIncrementalRead(edges, draftEdge);
99
103
  const compatibleWriteModes = getCompatibleWriteModes(writeModeOptions, routeHasIncremental ? [ReadMode.INCREMENTAL] : []);
@@ -1,6 +1,6 @@
1
- import { ReadMode, WriteMode } from "../../../../gen/ingestion/v1/common_pb.js";
1
+ import { WriteMode } from "../../../../gen/ingestion/v1/common_pb.js";
2
2
  import { CREATE_PIPELINE_MODAL_DEFAULT_READ_MODE, CREATE_PIPELINE_MODAL_DEFAULT_WRITE_MODE } from "./constants.js";
3
- import { getCompatibleWriteModes, getCursorOptions, getDefaultCursor, getPipelineResourceStatus, getRecommendedCursor } from "../resource/utils.js";
3
+ import { getCompatibleWriteModes, getCursorOptions, getDefaultCursor, getDefaultReadMode, getPipelineResourceStatus } from "../resource/utils.js";
4
4
  //#region src/pages/pipelines/components/create/rows.ts
5
5
  var getDefaultPipelineName = (source, sinks) => {
6
6
  const sinkNames = sinks.map((sink) => sink.name).join(", ");
@@ -18,9 +18,13 @@ var createResourceRows = ({ state, sinkId, resources, columns, supportedReadMode
18
18
  const resourceColumns = columnsByResource.get(resource.name);
19
19
  const isCursorKnown = resourceColumns !== void 0;
20
20
  const cursorOptions = getCursorOptions(resourceColumns ?? []);
21
- const autoCursor = getRecommendedCursor(resourceColumns ?? []);
22
21
  const readModeOptions = hasReadLevers ? supportedReadModes[resource.name] ?? [] : [];
23
- const defaultReadMode = (managedIncremental || autoCursor) && readModeOptions.includes(ReadMode.INCREMENTAL) ? ReadMode.INCREMENTAL : CREATE_PIPELINE_MODAL_DEFAULT_READ_MODE;
22
+ const defaultReadMode = getDefaultReadMode({
23
+ columns: resourceColumns ?? [],
24
+ readModeOptions,
25
+ managedIncremental,
26
+ fallback: CREATE_PIPELINE_MODAL_DEFAULT_READ_MODE
27
+ });
24
28
  const readMode = state.resourceReadModes[sinkId]?.[resource.name] ?? defaultReadMode;
25
29
  const isSelected = isResourceSelected(state.resourceSelection[sinkId], resource);
26
30
  const cursorField = managedIncremental ? "" : state.resourceCursors[sinkId]?.[resource.name] ?? getDefaultCursor(resourceColumns ?? []);
@@ -10,6 +10,12 @@ export declare const getCompatibleWriteModes: (writeModes: WriteMode[], readMode
10
10
  export declare const getCursorOptions: (columns: ResourceColumn[]) => ResourceColumn[];
11
11
  export declare const getRecommendedCursor: (columns: ResourceColumn[]) => ResourceColumn["name"];
12
12
  export declare const getDefaultCursor: (columns: ResourceColumn[]) => ResourceColumn["name"];
13
+ export declare const getDefaultReadMode: ({ columns, readModeOptions, managedIncremental, fallback, }: {
14
+ columns: ResourceColumn[];
15
+ readModeOptions: ReadMode[];
16
+ managedIncremental: boolean;
17
+ fallback: ReadMode;
18
+ }) => ReadMode;
13
19
  interface PipelineResourceStatusInput {
14
20
  resource: Resource["name"];
15
21
  readMode: ReadMode;
@@ -25,6 +25,7 @@ var getDefaultCursor = (columns) => {
25
25
  const eligible = getCursorOptions(columns);
26
26
  return eligible.length === 1 ? eligible[0].name : "";
27
27
  };
28
+ var getDefaultReadMode = ({ columns, readModeOptions, managedIncremental, fallback }) => (managedIncremental || getRecommendedCursor(columns) !== "") && readModeOptions.includes(ReadMode.INCREMENTAL) ? ReadMode.INCREMENTAL : fallback;
28
29
  var getPipelineResourceStatus = ({ resource, readMode, readModeOptions, cursorField, cursorOptions, isCursorKnown, managedIncremental, hasPrimaryKey, needsPrimaryKey }) => {
29
30
  if (!readModeOptions.includes(readMode)) return {
30
31
  resource,
@@ -54,4 +55,4 @@ var getPipelineResourceStatus = ({ resource, readMode, readModeOptions, cursorFi
54
55
  };
55
56
  };
56
57
  //#endregion
57
- export { getCompatibleWriteModes, getCursorOptions, getCursorSelectOptions, getDefaultCursor, getPipelineResourceStatus, getReadModeSelectOptions, getRecommendedCursor, getSharedModes, getWriteModeSelectOptions };
58
+ export { getCompatibleWriteModes, getCursorOptions, getCursorSelectOptions, getDefaultCursor, getDefaultReadMode, getPipelineResourceStatus, getReadModeSelectOptions, getRecommendedCursor, getSharedModes, getWriteModeSelectOptions };
package/dist/styles.css CHANGED
@@ -14,6 +14,8 @@
14
14
  .filament-ConnectionsPageSinksEmptyGraphic-LiveCard-l3vb2ix{height:92px;min-width:0;display:flex;align-items:center;justify-content:center;border:1px dashed var(--gx-color-border-secondary);border-radius:var(--gx-radius-lg);}
15
15
  .filament-ConnectionsPageSourcesEmptyGraphic-SlotsWrapper-s1u2j0jz{display:grid;grid-template-columns:repeat(9, 44px);gap:var(--gx-space-12);mask-image:linear-gradient(180deg, black 55%, transparent 110%);-webkit-mask-image:linear-gradient(180deg, black 55%, transparent 110%);}
16
16
  .filament-ConnectionsPageSourcesEmptyGraphic-Slot-s1xy0sv3{width:44px;height:44px;display:flex;align-items:center;justify-content:center;flex-shrink:0;border:var(--s1xy0sv3-0) var(--s1xy0sv3-1);border-radius:var(--gx-radius-md);animation:var(--s1xy0sv3-2);}@keyframes sources-empty-slot-pulse-filament-ConnectionsPageSourcesEmptyGraphic-Slot-s1xy0sv3{0%,100%{opacity:0.55;}50%{opacity:1;}}@media (prefers-reduced-motion: reduce){.filament-ConnectionsPageSourcesEmptyGraphic-Slot-s1xy0sv3{transition:none!important;animation:none!important;}}
17
+ .filament-ObservabilityRunsTableWidget-OBSERVABILITY_RUNS_TABLE_WIDGET_CSS-o1fcmgrf{flex:1 1 0;min-height:0;border-inline:none;border-bottom:none;border-radius:0;}
18
+ .filament-ObservabilityPage-OBSERVABILITY_PAGE_SCROLL_CSS-o1p5bblp{container-type:size;}
17
19
  /* this gets exported as style.css and can be used for the default theming */
18
20
  /* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */
19
21
  .react-flow {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galaxy-io/filament-ui",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Filament's web UI as a Galaxy module a host app mounts",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {