@mastra/playground-ui 66.0.0-alpha.0 → 66.0.0-alpha.2
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/dist/ActionRow-CJeLmb4v.cjs +42 -0
- package/dist/{components/ActionRow.cjs.js.map → ActionRow-CJeLmb4v.cjs.map} +1 -1
- package/dist/ActionRow-CWCII_ps.js +37 -0
- package/dist/{components/ActionRow.es.js.map → ActionRow-CWCII_ps.js.map} +1 -1
- package/dist/{Composer-CvORFb_o.js → Composer-CTjshNue.js} +42 -2
- package/dist/Composer-CTjshNue.js.map +1 -0
- package/dist/{Composer-hLplTNPc.cjs → Composer-O0z907Qs.cjs} +65 -1
- package/dist/Composer-O0z907Qs.cjs.map +1 -0
- package/dist/Composer.css +34 -0
- package/dist/components/ActionRow.cjs.js +2 -37
- package/dist/components/ActionRow.es.js +1 -37
- package/dist/components/Composer.cjs.js +5 -1
- package/dist/components/Composer.es.js +1 -1
- package/dist/domains/chat/attachments/composer-attachment-list.cjs.js +1 -1
- package/dist/domains/chat/attachments/composer-attachment-list.es.js +1 -1
- package/dist/domains/observability/components/observability-capability-gate.cjs.js +30 -0
- package/dist/domains/observability/components/observability-capability-gate.cjs.js.map +1 -0
- package/dist/domains/observability/components/observability-capability-gate.d.ts +1 -0
- package/dist/domains/observability/components/observability-capability-gate.es.js +29 -0
- package/dist/domains/observability/components/observability-capability-gate.es.js.map +1 -0
- package/dist/domains/observability/components/observability-list-body.cjs.js +24 -0
- package/dist/domains/observability/components/observability-list-body.cjs.js.map +1 -0
- package/dist/domains/observability/components/observability-list-body.d.ts +1 -0
- package/dist/domains/observability/components/observability-list-body.es.js +23 -0
- package/dist/domains/observability/components/observability-list-body.es.js.map +1 -0
- package/dist/domains/observability/components/observability-page-layout.cjs.js +36 -0
- package/dist/domains/observability/components/observability-page-layout.cjs.js.map +1 -0
- package/dist/domains/observability/components/observability-page-layout.d.ts +1 -0
- package/dist/domains/observability/components/observability-page-layout.es.js +35 -0
- package/dist/domains/observability/components/observability-page-layout.es.js.map +1 -0
- package/dist/domains/observability/hooks/use-observability-list-filters.cjs.js +78 -0
- package/dist/domains/observability/hooks/use-observability-list-filters.cjs.js.map +1 -0
- package/dist/domains/observability/hooks/use-observability-list-filters.d.ts +1 -0
- package/dist/domains/observability/hooks/use-observability-list-filters.es.js +76 -0
- package/dist/domains/observability/hooks/use-observability-list-filters.es.js.map +1 -0
- package/dist/domains/observability/hooks/use-observability-views.cjs.js +24 -0
- package/dist/domains/observability/hooks/use-observability-views.cjs.js.map +1 -0
- package/dist/domains/observability/hooks/use-observability-views.d.ts +1 -0
- package/dist/domains/observability/hooks/use-observability-views.es.js +23 -0
- package/dist/domains/observability/hooks/use-observability-views.es.js.map +1 -0
- package/dist/domains/observability/observability-crumbs.cjs.js +20 -0
- package/dist/domains/observability/observability-crumbs.cjs.js.map +1 -0
- package/dist/domains/observability/observability-crumbs.d.ts +1 -0
- package/dist/domains/observability/observability-crumbs.es.js +18 -0
- package/dist/domains/observability/observability-crumbs.es.js.map +1 -0
- package/dist/domains/observability/observability-selection-params.cjs.js +49 -0
- package/dist/domains/observability/observability-selection-params.cjs.js.map +1 -0
- package/dist/domains/observability/observability-selection-params.d.ts +1 -0
- package/dist/domains/observability/observability-selection-params.es.js +44 -0
- package/dist/domains/observability/observability-selection-params.es.js.map +1 -0
- package/dist/domains/observability.cjs.js +21 -0
- package/dist/domains/observability.d.ts +1 -0
- package/dist/domains/observability.es.js +8 -0
- package/dist/domains/spans/components/spans-explorer-body.cjs.js +114 -0
- package/dist/domains/spans/components/spans-explorer-body.cjs.js.map +1 -0
- package/dist/domains/spans/components/spans-explorer-body.d.ts +1 -0
- package/dist/domains/spans/components/spans-explorer-body.es.js +113 -0
- package/dist/domains/spans/components/spans-explorer-body.es.js.map +1 -0
- package/dist/domains/spans/span-list-row.cjs.js +26 -0
- package/dist/domains/spans/span-list-row.cjs.js.map +1 -0
- package/dist/domains/spans/span-list-row.d.ts +1 -0
- package/dist/domains/spans/span-list-row.es.js +25 -0
- package/dist/domains/spans/span-list-row.es.js.map +1 -0
- package/dist/domains/threads/components/threads-explorer-body.cjs.js +108 -0
- package/dist/domains/threads/components/threads-explorer-body.cjs.js.map +1 -0
- package/dist/domains/threads/components/threads-explorer-body.d.ts +1 -0
- package/dist/domains/threads/components/threads-explorer-body.es.js +107 -0
- package/dist/domains/threads/components/threads-explorer-body.es.js.map +1 -0
- package/dist/domains/threads/thread-list-row.cjs.js +25 -0
- package/dist/domains/threads/thread-list-row.cjs.js.map +1 -0
- package/dist/domains/threads/thread-list-row.d.ts +1 -0
- package/dist/domains/threads/thread-list-row.es.js +24 -0
- package/dist/domains/threads/thread-list-row.es.js.map +1 -0
- package/dist/domains/traces/components/span-rows.cjs.js +2 -2
- package/dist/domains/traces/components/span-rows.es.js +2 -2
- package/dist/domains/traces/components/span-timeline-row.cjs.js +1 -1
- package/dist/domains/traces/components/span-timeline-row.es.js +1 -1
- package/dist/domains/traces/components/thread-trace/thread-trace-span-panel.cjs.js +1 -1
- package/dist/domains/traces/components/thread-trace/thread-trace-span-panel.es.js +1 -1
- package/dist/domains/traces/components/thread-trace/thread-trace-spans.cjs.js +2 -2
- package/dist/domains/traces/components/thread-trace/thread-trace-spans.es.js +2 -2
- package/dist/domains/traces/components/thread-view-by-trace.cjs.js +2 -2
- package/dist/domains/traces/components/thread-view-by-trace.cjs.js.map +1 -1
- package/dist/domains/traces/components/thread-view-by-trace.es.js +2 -2
- package/dist/domains/traces/components/thread-view-by-trace.es.js.map +1 -1
- package/dist/domains/traces/components/trace-data-panel-view.cjs.js +1 -1
- package/dist/domains/traces/components/trace-data-panel-view.es.js +1 -1
- package/dist/domains/traces/components/trace-span-panel.cjs.js +1 -1
- package/dist/domains/traces/components/trace-span-panel.es.js +1 -1
- package/dist/domains/traces/components/trace-thread-item-view.cjs.js +1 -1
- package/dist/domains/traces/components/trace-thread-item-view.es.js +1 -1
- package/dist/domains/traces/components/trace-timeline-span.cjs.js +1 -1
- package/dist/domains/traces/components/trace-timeline-span.es.js +1 -1
- package/dist/domains/traces/components/trace-timeline.cjs.js +1 -1
- package/dist/domains/traces/components/trace-timeline.es.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-body.cjs.js +57 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-body.cjs.js.map +1 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-body.d.ts +1 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-body.es.js +56 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-body.es.js.map +1 -0
- package/dist/domains/traces/components/traces-explorer/traces-explorer-layout.cjs.js +9 -56
- package/dist/domains/traces/components/traces-explorer/traces-explorer-layout.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-layout.es.js +9 -56
- package/dist/domains/traces/components/traces-explorer/traces-explorer-layout.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-list-provider.cjs.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-list-provider.es.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-panel.cjs.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-panel.es.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-root.cjs.js +1 -1
- package/dist/domains/traces/components/traces-explorer/traces-explorer-root.es.js +1 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-discovery.cjs.js +7 -0
- package/dist/domains/traces/components/traces-explorer/use-traces-discovery.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-discovery.es.js +7 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-discovery.es.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-filter-bar.cjs.js +1 -1
- package/dist/domains/traces/components/traces-explorer/use-traces-filter-bar.es.js +1 -1
- package/dist/domains/traces/components/traces-explorer.cjs.js +3 -1
- package/dist/domains/traces/components/traces-explorer.cjs.js.map +1 -1
- package/dist/domains/traces/components/traces-explorer.es.js +3 -1
- package/dist/domains/traces/components/traces-explorer.es.js.map +1 -1
- package/dist/domains/traces/components/traces-list-view.cjs.js +1 -1
- package/dist/domains/traces/components/traces-list-view.es.js +1 -1
- package/dist/domains/traces/components.cjs.js +12 -12
- package/dist/domains/traces/components.es.js +12 -12
- package/dist/domains/traces/hooks.cjs.js +4 -4
- package/dist/domains/traces/hooks.es.js +4 -4
- package/dist/domains/traces.cjs.js +18 -18
- package/dist/domains/traces.es.js +18 -18
- package/dist/domains/workspace/components/workspace-parts.cjs.js +1 -1
- package/dist/domains/workspace/components/workspace-parts.es.js +1 -1
- package/dist/ee/topics/components/topic-trace-details-panel.cjs.js +1 -1
- package/dist/ee/topics/components/topic-trace-details-panel.es.js +1 -1
- package/dist/ee/topics/components/topics-layout.cjs.js +1 -1
- package/dist/ee/topics/components/topics-layout.es.js +1 -1
- package/dist/src/domains/observability/components/observability-capability-gate.d.ts +13 -0
- package/dist/src/domains/observability/components/observability-list-body.d.ts +12 -0
- package/dist/src/domains/observability/components/observability-page-layout.d.ts +20 -0
- package/dist/src/domains/observability/hooks/use-observability-list-filters.d.ts +35 -0
- package/dist/src/domains/observability/hooks/use-observability-views.d.ts +21 -0
- package/dist/src/domains/observability/index.d.ts +12 -0
- package/dist/src/domains/observability/observability-crumbs.d.ts +8 -0
- package/dist/src/domains/observability/observability-selection-params.d.ts +11 -0
- package/dist/src/domains/spans/components/spans-explorer-body.d.ts +18 -0
- package/dist/src/domains/spans/span-list-row.d.ts +3 -0
- package/dist/src/domains/threads/components/threads-explorer-body.d.ts +9 -0
- package/dist/src/domains/threads/thread-list-row.d.ts +3 -0
- package/dist/src/domains/traces/components/traces-explorer/index.d.ts +3 -0
- package/dist/src/domains/traces/components/traces-explorer/traces-explorer-body.d.ts +15 -0
- package/dist/src/domains/traces/components/traces-explorer/traces-explorer-layout.d.ts +4 -11
- package/dist/src/domains/traces/components/traces-explorer/use-traces-discovery.d.ts +2 -0
- package/dist/src/ds/components/Composer/composer-header.d.ts +15 -0
- package/dist/src/ds/components/Composer/index.d.ts +2 -0
- package/dist/style.css +14 -0
- package/package.json +16 -16
- package/dist/Composer-CvORFb_o.js.map +0 -1
- package/dist/Composer-hLplTNPc.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-capability-gate.es.js","names":["_Fragment"],"sources":["../../../../src/domains/observability/components/observability-capability-gate.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { EmptyState } from '@/ds/components/EmptyState';\nimport { Spinner } from '@/ds/components/Spinner';\nimport { Txt } from '@/ds/components/Txt';\n\nexport type ObservabilityCapabilityGateProps = {\n isLoading: boolean;\n enabled: boolean;\n /** The page's screen-reader heading while its body is not shown (the body brings its own). */\n heading: string;\n /** Shown when the store does not support the capability. */\n title: ReactNode;\n description: ReactNode;\n children: ReactNode;\n};\n\n/** Renders its children once the store declares the capability they need. */\nexport function ObservabilityCapabilityGate({\n isLoading,\n enabled,\n heading,\n title,\n description,\n children,\n}: ObservabilityCapabilityGateProps) {\n if (enabled) return children;\n\n return (\n <>\n <h1 className=\"sr-only\">{heading}</h1>\n {isLoading ? (\n <div className=\"flex h-full items-center justify-center gap-2\">\n <Spinner aria-label=\"Loading storage capabilities\" />\n <Txt as=\"span\" variant=\"caption\" tone=\"muted\">\n Loading storage capabilities\n </Txt>\n </div>\n ) : (\n <EmptyState variant=\"fill\" titleSlot={title} descriptionSlot={description} />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,4BAA4B,EAC1C,WACA,SACA,SACA,OACA,aACA,YACmC;CACnC,IAAI,SAAS,OAAO;CAEpB,OACE,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;EAAI,WAAU;EAAW,UAAA;CAAY,CAAA,GACpC,YACC,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,SAAD,EAAS,cAAW,+BAAgC,CAAA,GACpD,oBAAC,KAAD;GAAK,IAAG;GAAO,SAAQ;GAAU,MAAK;GAAQ,UAAA;EAEzC,CAAA,CACF;CAEL,CAAA,IAAA,oBAAC,YAAD;EAAY,SAAQ;EAAO,WAAW;EAAO,iBAAiB;CAAc,CAAA,CAE9E,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
//#region src/domains/observability/components/observability-list-body.tsx
|
|
4
|
+
/** The body of an observability list page: a toolbar above the list, its error or its empty state. */
|
|
5
|
+
function ObservabilityListBody({ toolbar, error, empty, children }) {
|
|
6
|
+
let body = children;
|
|
7
|
+
if (error) body = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8
|
+
className: "flex h-full items-center justify-center",
|
|
9
|
+
children: error
|
|
10
|
+
});
|
|
11
|
+
else if (empty) body = empty;
|
|
12
|
+
if (!toolbar) return body;
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
14
|
+
className: "flex h-full min-h-0 flex-col gap-4",
|
|
15
|
+
children: [toolbar, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
16
|
+
className: "min-h-0 flex-1",
|
|
17
|
+
children: body
|
|
18
|
+
})]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.ObservabilityListBody = ObservabilityListBody;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=observability-list-body.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-list-body.cjs.js","names":[],"sources":["../../../../src/domains/observability/components/observability-list-body.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport type ObservabilityListBodyProps = {\n /** Controls above the list (filters, columns…). */\n toolbar?: ReactNode;\n /** The list failed to load. Takes precedence over `empty` and `children`. */\n error?: ReactNode;\n /** The full-page empty state. Takes precedence over `children`. */\n empty?: ReactNode;\n children: ReactNode;\n};\n\n/** The body of an observability list page: a toolbar above the list, its error or its empty state. */\nexport function ObservabilityListBody({ toolbar, error, empty, children }: ObservabilityListBodyProps) {\n let body: ReactNode = children;\n if (error) body = <div className=\"flex h-full items-center justify-center\">{error}</div>;\n else if (empty) body = empty;\n\n if (!toolbar) return body;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col gap-4\">\n {toolbar}\n <div className=\"min-h-0 flex-1\">{body}</div>\n </div>\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,sBAAsB,EAAE,SAAS,OAAO,OAAO,YAAwC;CACrG,IAAI,OAAkB;CACtB,IAAI,OAAO,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EAA2C,UAAA;CAAW,CAAA;MAClF,IAAI,OAAO,OAAO;CAEvB,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,SACD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GAAkB,UAAA;EAAU,CAAA,CACxC;;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../src/domains/observability/components/observability-list-body';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/domains/observability/components/observability-list-body.tsx
|
|
3
|
+
/** The body of an observability list page: a toolbar above the list, its error or its empty state. */
|
|
4
|
+
function ObservabilityListBody({ toolbar, error, empty, children }) {
|
|
5
|
+
let body = children;
|
|
6
|
+
if (error) body = /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: "flex h-full items-center justify-center",
|
|
8
|
+
children: error
|
|
9
|
+
});
|
|
10
|
+
else if (empty) body = empty;
|
|
11
|
+
if (!toolbar) return body;
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: "flex h-full min-h-0 flex-col gap-4",
|
|
14
|
+
children: [toolbar, /* @__PURE__ */ jsx("div", {
|
|
15
|
+
className: "min-h-0 flex-1",
|
|
16
|
+
children: body
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ObservabilityListBody };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=observability-list-body.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-list-body.es.js","names":[],"sources":["../../../../src/domains/observability/components/observability-list-body.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport type ObservabilityListBodyProps = {\n /** Controls above the list (filters, columns…). */\n toolbar?: ReactNode;\n /** The list failed to load. Takes precedence over `empty` and `children`. */\n error?: ReactNode;\n /** The full-page empty state. Takes precedence over `children`. */\n empty?: ReactNode;\n children: ReactNode;\n};\n\n/** The body of an observability list page: a toolbar above the list, its error or its empty state. */\nexport function ObservabilityListBody({ toolbar, error, empty, children }: ObservabilityListBodyProps) {\n let body: ReactNode = children;\n if (error) body = <div className=\"flex h-full items-center justify-center\">{error}</div>;\n else if (empty) body = empty;\n\n if (!toolbar) return body;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col gap-4\">\n {toolbar}\n <div className=\"min-h-0 flex-1\">{body}</div>\n </div>\n );\n}\n"],"mappings":";;;AAaA,SAAgB,sBAAsB,EAAE,SAAS,OAAO,OAAO,YAAwC;CACrG,IAAI,OAAkB;CACtB,IAAI,OAAO,OAAO,oBAAC,OAAD;EAAK,WAAU;EAA2C,UAAA;CAAW,CAAA;MAClF,IAAI,OAAO,OAAO;CAEvB,IAAI,CAAC,SAAS,OAAO;CAErB,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG,SACD,oBAAC,OAAD;GAAK,WAAU;GAAkB,UAAA;EAAU,CAAA,CACxC;;AAET"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_domains_observability_hooks_use_observability_views = require("../hooks/use-observability-views.cjs.js");
|
|
3
|
+
const require_domains_traces_components_traces_spans_switch = require("../../traces/components/traces-spans-switch.cjs.js");
|
|
4
|
+
const require_PageLayout = require("../../../PageLayout-02XlfbOU.cjs");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
//#region src/domains/observability/components/observability-page-layout.tsx
|
|
7
|
+
/**
|
|
8
|
+
* The header shared by the traces, spans and threads pages: breadcrumbs plus the view switch pinned
|
|
9
|
+
* under them. Router-agnostic: the host passes the current view, navigation and its page body.
|
|
10
|
+
*/
|
|
11
|
+
function ObservabilityPageLayout({ current, features, onViewChange, breadcrumbs, children }) {
|
|
12
|
+
const { views, isLoading, showSwitch } = require_domains_observability_hooks_use_observability_views.useObservabilityViews({
|
|
13
|
+
current,
|
|
14
|
+
features
|
|
15
|
+
});
|
|
16
|
+
let actionRow;
|
|
17
|
+
if (isLoading) actionRow = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_traces_spans_switch.TracesSpansSwitchSkeleton, {});
|
|
18
|
+
else if (showSwitch) actionRow = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_domains_traces_components_traces_spans_switch.TracesSpansSwitch, {
|
|
19
|
+
current,
|
|
20
|
+
views,
|
|
21
|
+
onViewChange
|
|
22
|
+
});
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PageLayout.PageLayout, {
|
|
24
|
+
breadcrumbs: breadcrumbs({
|
|
25
|
+
current,
|
|
26
|
+
isLoading,
|
|
27
|
+
showSwitch
|
|
28
|
+
}),
|
|
29
|
+
actionRow,
|
|
30
|
+
children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.ObservabilityPageLayout = ObservabilityPageLayout;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=observability-page-layout.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-page-layout.cjs.js","names":["useObservabilityViews","TracesSpansSwitchSkeleton","TracesSpansSwitch","PageLayout"],"sources":["../../../../src/domains/observability/components/observability-page-layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useObservabilityViews } from '../hooks/use-observability-views';\nimport type { ObservabilityViewsState } from '../hooks/use-observability-views';\nimport type { TracesExplorerFeatures } from '@/domains/traces/components/traces-explorer/traces-explorer-context';\nimport { TracesSpansSwitch, TracesSpansSwitchSkeleton } from '@/domains/traces/components/traces-spans-switch';\nimport type { ObservabilityView } from '@/domains/traces/components/traces-spans-switch';\nimport { PageLayout } from '@/ds/components/PageLayout';\n\nexport type ObservabilityBreadcrumbsState = Pick<ObservabilityViewsState, 'isLoading' | 'showSwitch'> & {\n current: ObservabilityView;\n};\n\nexport type ObservabilityPageLayoutProps = {\n current: ObservabilityView;\n features?: TracesExplorerFeatures;\n onViewChange: (view: ObservabilityView) => void;\n /** The host's breadcrumbs. They can name the current view when the switch does not show it. */\n breadcrumbs: (state: ObservabilityBreadcrumbsState) => ReactNode;\n children: ReactNode;\n};\n\n/**\n * The header shared by the traces, spans and threads pages: breadcrumbs plus the view switch pinned\n * under them. Router-agnostic: the host passes the current view, navigation and its page body.\n */\nexport function ObservabilityPageLayout({\n current,\n features,\n onViewChange,\n breadcrumbs,\n children,\n}: ObservabilityPageLayoutProps) {\n const { views, isLoading, showSwitch } = useObservabilityViews({ current, features });\n\n // While loading, hold the switch's place so it does not push the page down when it lands.\n let actionRow: ReactNode;\n if (isLoading) actionRow = <TracesSpansSwitchSkeleton />;\n else if (showSwitch) actionRow = <TracesSpansSwitch current={current} views={views} onViewChange={onViewChange} />;\n\n return (\n <PageLayout breadcrumbs={breadcrumbs({ current, isLoading, showSwitch })} actionRow={actionRow}>\n {children}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAyBA,SAAgB,wBAAwB,EACtC,SACA,UACA,cACA,aACA,YAC+B;CAC/B,MAAM,EAAE,OAAO,WAAW,eAAeA,4DAAAA,sBAAsB;EAAE;EAAS;CAAS,CAAC;CAGpF,IAAI;CACJ,IAAI,WAAW,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAACC,sDAAAA,2BAAD,CAA4B,CAAA;MAClD,IAAI,YAAY,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAACC,sDAAAA,mBAAD;EAA4B;EAAgB;EAAqB;CAAe,CAAA;CAEjH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;EAAY,aAAa,YAAY;GAAE;GAAS;GAAW;EAAW,CAAC;EAAc;EAClF;CACS,CAAA;AAEhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../src/domains/observability/components/observability-page-layout';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useObservabilityViews } from "../hooks/use-observability-views.es.js";
|
|
2
|
+
import { TracesSpansSwitch, TracesSpansSwitchSkeleton } from "../../traces/components/traces-spans-switch.es.js";
|
|
3
|
+
import { t as PageLayout } from "../../../PageLayout-CVmOGfaQ.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/domains/observability/components/observability-page-layout.tsx
|
|
6
|
+
/**
|
|
7
|
+
* The header shared by the traces, spans and threads pages: breadcrumbs plus the view switch pinned
|
|
8
|
+
* under them. Router-agnostic: the host passes the current view, navigation and its page body.
|
|
9
|
+
*/
|
|
10
|
+
function ObservabilityPageLayout({ current, features, onViewChange, breadcrumbs, children }) {
|
|
11
|
+
const { views, isLoading, showSwitch } = useObservabilityViews({
|
|
12
|
+
current,
|
|
13
|
+
features
|
|
14
|
+
});
|
|
15
|
+
let actionRow;
|
|
16
|
+
if (isLoading) actionRow = /* @__PURE__ */ jsx(TracesSpansSwitchSkeleton, {});
|
|
17
|
+
else if (showSwitch) actionRow = /* @__PURE__ */ jsx(TracesSpansSwitch, {
|
|
18
|
+
current,
|
|
19
|
+
views,
|
|
20
|
+
onViewChange
|
|
21
|
+
});
|
|
22
|
+
return /* @__PURE__ */ jsx(PageLayout, {
|
|
23
|
+
breadcrumbs: breadcrumbs({
|
|
24
|
+
current,
|
|
25
|
+
isLoading,
|
|
26
|
+
showSwitch
|
|
27
|
+
}),
|
|
28
|
+
actionRow,
|
|
29
|
+
children
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ObservabilityPageLayout };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=observability-page-layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-page-layout.es.js","names":[],"sources":["../../../../src/domains/observability/components/observability-page-layout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useObservabilityViews } from '../hooks/use-observability-views';\nimport type { ObservabilityViewsState } from '../hooks/use-observability-views';\nimport type { TracesExplorerFeatures } from '@/domains/traces/components/traces-explorer/traces-explorer-context';\nimport { TracesSpansSwitch, TracesSpansSwitchSkeleton } from '@/domains/traces/components/traces-spans-switch';\nimport type { ObservabilityView } from '@/domains/traces/components/traces-spans-switch';\nimport { PageLayout } from '@/ds/components/PageLayout';\n\nexport type ObservabilityBreadcrumbsState = Pick<ObservabilityViewsState, 'isLoading' | 'showSwitch'> & {\n current: ObservabilityView;\n};\n\nexport type ObservabilityPageLayoutProps = {\n current: ObservabilityView;\n features?: TracesExplorerFeatures;\n onViewChange: (view: ObservabilityView) => void;\n /** The host's breadcrumbs. They can name the current view when the switch does not show it. */\n breadcrumbs: (state: ObservabilityBreadcrumbsState) => ReactNode;\n children: ReactNode;\n};\n\n/**\n * The header shared by the traces, spans and threads pages: breadcrumbs plus the view switch pinned\n * under them. Router-agnostic: the host passes the current view, navigation and its page body.\n */\nexport function ObservabilityPageLayout({\n current,\n features,\n onViewChange,\n breadcrumbs,\n children,\n}: ObservabilityPageLayoutProps) {\n const { views, isLoading, showSwitch } = useObservabilityViews({ current, features });\n\n // While loading, hold the switch's place so it does not push the page down when it lands.\n let actionRow: ReactNode;\n if (isLoading) actionRow = <TracesSpansSwitchSkeleton />;\n else if (showSwitch) actionRow = <TracesSpansSwitch current={current} views={views} onViewChange={onViewChange} />;\n\n return (\n <PageLayout breadcrumbs={breadcrumbs({ current, isLoading, showSwitch })} actionRow={actionRow}>\n {children}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,wBAAwB,EACtC,SACA,UACA,cACA,aACA,YAC+B;CAC/B,MAAM,EAAE,OAAO,WAAW,eAAe,sBAAsB;EAAE;EAAS;CAAS,CAAC;CAGpF,IAAI;CACJ,IAAI,WAAW,YAAY,oBAAC,2BAAD,CAA4B,CAAA;MAClD,IAAI,YAAY,YAAY,oBAAC,mBAAD;EAA4B;EAAgB;EAAqB;CAAe,CAAA;CAEjH,OACE,oBAAC,YAAD;EAAY,aAAa,YAAY;GAAE;GAAS;GAAW;EAAW,CAAC;EAAc;EAClF;CACS,CAAA;AAEhB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_trace_filters = require("../../../trace-filters-Dye2hTh3.cjs");
|
|
3
|
+
const require_domains_traces_components_traces_explorer_traces_explorer_actions = require("../../traces/components/traces-explorer/traces-explorer-actions.cjs.js");
|
|
4
|
+
const require_domains_traces_hooks_use_traces_list_source = require("../../traces/hooks/use-traces-list-source.cjs.js");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
//#region src/domains/observability/hooks/use-observability-list-filters.ts
|
|
7
|
+
var DEFAULT_DATE_PRESET = require_domains_traces_components_traces_explorer_traces_explorer_actions.DEFAULT_TRACES_FILTERS.datePreset;
|
|
8
|
+
/**
|
|
9
|
+
* Like the traces list with delta polling: a timer or a window focus would reload every loaded page
|
|
10
|
+
* and reset the cursor chain, so an observability list only reloads to recover from a transient failure.
|
|
11
|
+
*/
|
|
12
|
+
var observabilityListQueryOptions = {
|
|
13
|
+
refetchInterval: ({ state }) => require_domains_traces_hooks_use_traces_list_source.recoveryRefetchInterval(state.error),
|
|
14
|
+
refetchOnWindowFocus: false
|
|
15
|
+
};
|
|
16
|
+
/** The time range, filter and sort state of a spans or threads list. */
|
|
17
|
+
function useObservabilityListFilters() {
|
|
18
|
+
const [dates, setDates] = (0, react.useState)({ datePreset: DEFAULT_DATE_PRESET });
|
|
19
|
+
const [tokens, setTokens] = (0, react.useState)([]);
|
|
20
|
+
const [groups, setGroups] = (0, react.useState)([]);
|
|
21
|
+
const [sort, setSort] = (0, react.useState)("desc");
|
|
22
|
+
const { datePreset, dateFrom, dateTo } = dates;
|
|
23
|
+
const fromMs = dateFrom?.getTime();
|
|
24
|
+
const toMs = dateTo?.getTime();
|
|
25
|
+
const timeRange = (0, react.useMemo)(() => {
|
|
26
|
+
const window = require_domains_traces_components_traces_explorer_traces_explorer_actions.resolveTracesDateWindow(datePreset, fromMs === void 0 ? void 0 : new Date(fromMs), toMs === void 0 ? void 0 : new Date(toMs));
|
|
27
|
+
return require_trace_filters.resolveTraceQueryTimeRange(window.dateFrom, window.dateTo, /* @__PURE__ */ new Date());
|
|
28
|
+
}, [
|
|
29
|
+
datePreset,
|
|
30
|
+
fromMs,
|
|
31
|
+
toMs
|
|
32
|
+
]);
|
|
33
|
+
const onDatePresetChange = (preset) => setDates((current) => preset === "custom" ? {
|
|
34
|
+
...current,
|
|
35
|
+
datePreset: preset
|
|
36
|
+
} : { datePreset: preset });
|
|
37
|
+
const onDateChange = (date, end) => setDates((current) => {
|
|
38
|
+
if (current.datePreset !== "custom") return current;
|
|
39
|
+
return end === "from" ? {
|
|
40
|
+
...current,
|
|
41
|
+
dateFrom: date
|
|
42
|
+
} : {
|
|
43
|
+
...current,
|
|
44
|
+
dateTo: date
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
const onDateRangeChange = (from, to) => setDates((current) => current.datePreset === "custom" ? {
|
|
48
|
+
...current,
|
|
49
|
+
dateFrom: from,
|
|
50
|
+
dateTo: to
|
|
51
|
+
} : current);
|
|
52
|
+
const onFiltersChange = (nextTokens, nextGroups) => {
|
|
53
|
+
setTokens(nextTokens);
|
|
54
|
+
setGroups(nextGroups);
|
|
55
|
+
};
|
|
56
|
+
const contentFiltersApplied = tokens.length > 0 || groups.length > 0;
|
|
57
|
+
return {
|
|
58
|
+
datePreset,
|
|
59
|
+
dateFrom,
|
|
60
|
+
dateTo,
|
|
61
|
+
timeRange,
|
|
62
|
+
tokens,
|
|
63
|
+
groups,
|
|
64
|
+
sort,
|
|
65
|
+
setSort,
|
|
66
|
+
onDatePresetChange,
|
|
67
|
+
onDateChange,
|
|
68
|
+
onDateRangeChange,
|
|
69
|
+
onFiltersChange,
|
|
70
|
+
contentFiltersApplied,
|
|
71
|
+
filtersApplied: contentFiltersApplied || datePreset !== DEFAULT_DATE_PRESET
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
exports.observabilityListQueryOptions = observabilityListQueryOptions;
|
|
76
|
+
exports.useObservabilityListFilters = useObservabilityListFilters;
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=use-observability-list-filters.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-observability-list-filters.cjs.js","names":["DEFAULT_TRACES_FILTERS","recoveryRefetchInterval","useState","useMemo","resolveTracesDateWindow","resolveTraceQueryTimeRange"],"sources":["../../../../src/domains/observability/hooks/use-observability-list-filters.ts"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport {\n DEFAULT_TRACES_FILTERS,\n resolveTracesDateWindow,\n} from '@/domains/traces/components/traces-explorer/traces-explorer-actions';\nimport { recoveryRefetchInterval } from '@/domains/traces/hooks/use-traces-list-source';\nimport { resolveTraceQueryTimeRange } from '@/domains/traces/trace-query-filters';\nimport type { TraceFilterGroup, TraceFilterToken } from '@/domains/traces/trace-query-filters';\nimport type { TraceDatePreset } from '@/domains/traces/types';\nimport type { DataListSort } from '@/ds/components/DataList/data-list-sortable-top-cell';\n\n// Same window as /traces, so switching between the pages keeps the time chip identical.\nconst DEFAULT_DATE_PRESET: TraceDatePreset = DEFAULT_TRACES_FILTERS.datePreset;\n\ntype DateState = { datePreset: TraceDatePreset; dateFrom?: Date; dateTo?: Date };\n\n/**\n * Like the traces list with delta polling: a timer or a window focus would reload every loaded page\n * and reset the cursor chain, so an observability list only reloads to recover from a transient failure.\n */\nexport const observabilityListQueryOptions = {\n refetchInterval: ({ state }: { state: { error: unknown } }) => recoveryRefetchInterval(state.error),\n refetchOnWindowFocus: false,\n};\n\n/** The time range, filter and sort state of a spans or threads list. */\nexport function useObservabilityListFilters() {\n const [dates, setDates] = useState<DateState>({ datePreset: DEFAULT_DATE_PRESET });\n const [tokens, setTokens] = useState<TraceFilterToken[]>([]);\n const [groups, setGroups] = useState<TraceFilterGroup[]>([]);\n const [sort, setSort] = useState<DataListSort>('desc');\n\n const { datePreset, dateFrom, dateTo } = dates;\n const fromMs = dateFrom?.getTime();\n const toMs = dateTo?.getTime();\n // Rolling presets are resolved against \"now\" only when the range changes, so the query key\n // (and the cursors issued for it) stays stable while the list scrolls.\n const timeRange = useMemo(() => {\n const window = resolveTracesDateWindow(\n datePreset,\n fromMs === undefined ? undefined : new Date(fromMs),\n toMs === undefined ? undefined : new Date(toMs),\n );\n return resolveTraceQueryTimeRange(window.dateFrom, window.dateTo, new Date());\n }, [datePreset, fromMs, toMs]);\n\n // Switching to `custom` keeps the current dates so the picker opens on them; any other preset drops them.\n const onDatePresetChange = (preset: TraceDatePreset) =>\n setDates(current => (preset === 'custom' ? { ...current, datePreset: preset } : { datePreset: preset }));\n // The picker can report a date right after switching away from `custom`; those are ignored.\n const onDateChange = (date: Date | undefined, end: 'from' | 'to') =>\n setDates(current => {\n if (current.datePreset !== 'custom') return current;\n return end === 'from' ? { ...current, dateFrom: date } : { ...current, dateTo: date };\n });\n const onDateRangeChange = (from: Date | undefined, to: Date | undefined) =>\n setDates(current => (current.datePreset === 'custom' ? { ...current, dateFrom: from, dateTo: to } : current));\n const onFiltersChange = (nextTokens: TraceFilterToken[], nextGroups: TraceFilterGroup[]) => {\n setTokens(nextTokens);\n setGroups(nextGroups);\n };\n\n const contentFiltersApplied = tokens.length > 0 || groups.length > 0;\n const filtersApplied = contentFiltersApplied || datePreset !== DEFAULT_DATE_PRESET;\n\n return {\n datePreset,\n dateFrom,\n dateTo,\n timeRange,\n tokens,\n groups,\n sort,\n setSort,\n onDatePresetChange,\n onDateChange,\n onDateRangeChange,\n onFiltersChange,\n contentFiltersApplied,\n filtersApplied,\n };\n}\n"],"mappings":";;;;;;AAYA,IAAM,sBAAuCA,0EAAAA,uBAAuB;;;;;AAQpE,IAAa,gCAAgC;CAC3C,kBAAkB,EAAE,YAA2CC,oDAAAA,wBAAwB,MAAM,KAAK;CAClG,sBAAsB;AACxB;;AAGA,SAAgB,8BAA8B;CAC5C,MAAM,CAAC,OAAO,aAAA,GAAYC,MAAAA,SAAAA,CAAoB,EAAE,YAAY,oBAAoB,CAAC;CACjF,MAAM,CAAC,QAAQ,cAAA,GAAaA,MAAAA,SAAAA,CAA6B,CAAC,CAAC;CAC3D,MAAM,CAAC,QAAQ,cAAA,GAAaA,MAAAA,SAAAA,CAA6B,CAAC,CAAC;CAC3D,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAuB,MAAM;CAErD,MAAM,EAAE,YAAY,UAAU,WAAW;CACzC,MAAM,SAAS,UAAU,QAAQ;CACjC,MAAM,OAAO,QAAQ,QAAQ;CAG7B,MAAM,aAAA,GAAYC,MAAAA,QAAAA,OAAc;EAC9B,MAAM,SAASC,0EAAAA,wBACb,YACA,WAAW,KAAA,IAAY,KAAA,IAAY,IAAI,KAAK,MAAM,GAClD,SAAS,KAAA,IAAY,KAAA,IAAY,IAAI,KAAK,IAAI,CAChD;EACA,OAAOC,sBAAAA,2BAA2B,OAAO,UAAU,OAAO,wBAAQ,IAAI,KAAK,CAAC;CAC9E,GAAG;EAAC;EAAY;EAAQ;CAAI,CAAC;CAG7B,MAAM,sBAAsB,WAC1B,UAAS,YAAY,WAAW,WAAW;EAAE,GAAG;EAAS,YAAY;CAAO,IAAI,EAAE,YAAY,OAAO,CAAE;CAEzG,MAAM,gBAAgB,MAAwB,QAC5C,UAAS,YAAW;EAClB,IAAI,QAAQ,eAAe,UAAU,OAAO;EAC5C,OAAO,QAAQ,SAAS;GAAE,GAAG;GAAS,UAAU;EAAK,IAAI;GAAE,GAAG;GAAS,QAAQ;EAAK;CACtF,CAAC;CACH,MAAM,qBAAqB,MAAwB,OACjD,UAAS,YAAY,QAAQ,eAAe,WAAW;EAAE,GAAG;EAAS,UAAU;EAAM,QAAQ;CAAG,IAAI,OAAQ;CAC9G,MAAM,mBAAmB,YAAgC,eAAmC;EAC1F,UAAU,UAAU;EACpB,UAAU,UAAU;CACtB;CAEA,MAAM,wBAAwB,OAAO,SAAS,KAAK,OAAO,SAAS;CAGnE,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAhBqB,yBAAyB,eAAe;CAiB/D;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../src/domains/observability/hooks/use-observability-list-filters';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ct as resolveTraceQueryTimeRange } from "../../../trace-filters-B6xAWZLc.js";
|
|
2
|
+
import { DEFAULT_TRACES_FILTERS, resolveTracesDateWindow } from "../../traces/components/traces-explorer/traces-explorer-actions.es.js";
|
|
3
|
+
import { recoveryRefetchInterval } from "../../traces/hooks/use-traces-list-source.es.js";
|
|
4
|
+
import { useMemo, useState } from "react";
|
|
5
|
+
//#region src/domains/observability/hooks/use-observability-list-filters.ts
|
|
6
|
+
var DEFAULT_DATE_PRESET = DEFAULT_TRACES_FILTERS.datePreset;
|
|
7
|
+
/**
|
|
8
|
+
* Like the traces list with delta polling: a timer or a window focus would reload every loaded page
|
|
9
|
+
* and reset the cursor chain, so an observability list only reloads to recover from a transient failure.
|
|
10
|
+
*/
|
|
11
|
+
var observabilityListQueryOptions = {
|
|
12
|
+
refetchInterval: ({ state }) => recoveryRefetchInterval(state.error),
|
|
13
|
+
refetchOnWindowFocus: false
|
|
14
|
+
};
|
|
15
|
+
/** The time range, filter and sort state of a spans or threads list. */
|
|
16
|
+
function useObservabilityListFilters() {
|
|
17
|
+
const [dates, setDates] = useState({ datePreset: DEFAULT_DATE_PRESET });
|
|
18
|
+
const [tokens, setTokens] = useState([]);
|
|
19
|
+
const [groups, setGroups] = useState([]);
|
|
20
|
+
const [sort, setSort] = useState("desc");
|
|
21
|
+
const { datePreset, dateFrom, dateTo } = dates;
|
|
22
|
+
const fromMs = dateFrom?.getTime();
|
|
23
|
+
const toMs = dateTo?.getTime();
|
|
24
|
+
const timeRange = useMemo(() => {
|
|
25
|
+
const window = resolveTracesDateWindow(datePreset, fromMs === void 0 ? void 0 : new Date(fromMs), toMs === void 0 ? void 0 : new Date(toMs));
|
|
26
|
+
return resolveTraceQueryTimeRange(window.dateFrom, window.dateTo, /* @__PURE__ */ new Date());
|
|
27
|
+
}, [
|
|
28
|
+
datePreset,
|
|
29
|
+
fromMs,
|
|
30
|
+
toMs
|
|
31
|
+
]);
|
|
32
|
+
const onDatePresetChange = (preset) => setDates((current) => preset === "custom" ? {
|
|
33
|
+
...current,
|
|
34
|
+
datePreset: preset
|
|
35
|
+
} : { datePreset: preset });
|
|
36
|
+
const onDateChange = (date, end) => setDates((current) => {
|
|
37
|
+
if (current.datePreset !== "custom") return current;
|
|
38
|
+
return end === "from" ? {
|
|
39
|
+
...current,
|
|
40
|
+
dateFrom: date
|
|
41
|
+
} : {
|
|
42
|
+
...current,
|
|
43
|
+
dateTo: date
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const onDateRangeChange = (from, to) => setDates((current) => current.datePreset === "custom" ? {
|
|
47
|
+
...current,
|
|
48
|
+
dateFrom: from,
|
|
49
|
+
dateTo: to
|
|
50
|
+
} : current);
|
|
51
|
+
const onFiltersChange = (nextTokens, nextGroups) => {
|
|
52
|
+
setTokens(nextTokens);
|
|
53
|
+
setGroups(nextGroups);
|
|
54
|
+
};
|
|
55
|
+
const contentFiltersApplied = tokens.length > 0 || groups.length > 0;
|
|
56
|
+
return {
|
|
57
|
+
datePreset,
|
|
58
|
+
dateFrom,
|
|
59
|
+
dateTo,
|
|
60
|
+
timeRange,
|
|
61
|
+
tokens,
|
|
62
|
+
groups,
|
|
63
|
+
sort,
|
|
64
|
+
setSort,
|
|
65
|
+
onDatePresetChange,
|
|
66
|
+
onDateChange,
|
|
67
|
+
onDateRangeChange,
|
|
68
|
+
onFiltersChange,
|
|
69
|
+
contentFiltersApplied,
|
|
70
|
+
filtersApplied: contentFiltersApplied || datePreset !== DEFAULT_DATE_PRESET
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { observabilityListQueryOptions, useObservabilityListFilters };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=use-observability-list-filters.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-observability-list-filters.es.js","names":[],"sources":["../../../../src/domains/observability/hooks/use-observability-list-filters.ts"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport {\n DEFAULT_TRACES_FILTERS,\n resolveTracesDateWindow,\n} from '@/domains/traces/components/traces-explorer/traces-explorer-actions';\nimport { recoveryRefetchInterval } from '@/domains/traces/hooks/use-traces-list-source';\nimport { resolveTraceQueryTimeRange } from '@/domains/traces/trace-query-filters';\nimport type { TraceFilterGroup, TraceFilterToken } from '@/domains/traces/trace-query-filters';\nimport type { TraceDatePreset } from '@/domains/traces/types';\nimport type { DataListSort } from '@/ds/components/DataList/data-list-sortable-top-cell';\n\n// Same window as /traces, so switching between the pages keeps the time chip identical.\nconst DEFAULT_DATE_PRESET: TraceDatePreset = DEFAULT_TRACES_FILTERS.datePreset;\n\ntype DateState = { datePreset: TraceDatePreset; dateFrom?: Date; dateTo?: Date };\n\n/**\n * Like the traces list with delta polling: a timer or a window focus would reload every loaded page\n * and reset the cursor chain, so an observability list only reloads to recover from a transient failure.\n */\nexport const observabilityListQueryOptions = {\n refetchInterval: ({ state }: { state: { error: unknown } }) => recoveryRefetchInterval(state.error),\n refetchOnWindowFocus: false,\n};\n\n/** The time range, filter and sort state of a spans or threads list. */\nexport function useObservabilityListFilters() {\n const [dates, setDates] = useState<DateState>({ datePreset: DEFAULT_DATE_PRESET });\n const [tokens, setTokens] = useState<TraceFilterToken[]>([]);\n const [groups, setGroups] = useState<TraceFilterGroup[]>([]);\n const [sort, setSort] = useState<DataListSort>('desc');\n\n const { datePreset, dateFrom, dateTo } = dates;\n const fromMs = dateFrom?.getTime();\n const toMs = dateTo?.getTime();\n // Rolling presets are resolved against \"now\" only when the range changes, so the query key\n // (and the cursors issued for it) stays stable while the list scrolls.\n const timeRange = useMemo(() => {\n const window = resolveTracesDateWindow(\n datePreset,\n fromMs === undefined ? undefined : new Date(fromMs),\n toMs === undefined ? undefined : new Date(toMs),\n );\n return resolveTraceQueryTimeRange(window.dateFrom, window.dateTo, new Date());\n }, [datePreset, fromMs, toMs]);\n\n // Switching to `custom` keeps the current dates so the picker opens on them; any other preset drops them.\n const onDatePresetChange = (preset: TraceDatePreset) =>\n setDates(current => (preset === 'custom' ? { ...current, datePreset: preset } : { datePreset: preset }));\n // The picker can report a date right after switching away from `custom`; those are ignored.\n const onDateChange = (date: Date | undefined, end: 'from' | 'to') =>\n setDates(current => {\n if (current.datePreset !== 'custom') return current;\n return end === 'from' ? { ...current, dateFrom: date } : { ...current, dateTo: date };\n });\n const onDateRangeChange = (from: Date | undefined, to: Date | undefined) =>\n setDates(current => (current.datePreset === 'custom' ? { ...current, dateFrom: from, dateTo: to } : current));\n const onFiltersChange = (nextTokens: TraceFilterToken[], nextGroups: TraceFilterGroup[]) => {\n setTokens(nextTokens);\n setGroups(nextGroups);\n };\n\n const contentFiltersApplied = tokens.length > 0 || groups.length > 0;\n const filtersApplied = contentFiltersApplied || datePreset !== DEFAULT_DATE_PRESET;\n\n return {\n datePreset,\n dateFrom,\n dateTo,\n timeRange,\n tokens,\n groups,\n sort,\n setSort,\n onDatePresetChange,\n onDateChange,\n onDateRangeChange,\n onFiltersChange,\n contentFiltersApplied,\n filtersApplied,\n };\n}\n"],"mappings":";;;;;AAYA,IAAM,sBAAuC,uBAAuB;;;;;AAQpE,IAAa,gCAAgC;CAC3C,kBAAkB,EAAE,YAA2C,wBAAwB,MAAM,KAAK;CAClG,sBAAsB;AACxB;;AAGA,SAAgB,8BAA8B;CAC5C,MAAM,CAAC,OAAO,YAAY,SAAoB,EAAE,YAAY,oBAAoB,CAAC;CACjF,MAAM,CAAC,QAAQ,aAAa,SAA6B,CAAC,CAAC;CAC3D,MAAM,CAAC,QAAQ,aAAa,SAA6B,CAAC,CAAC;CAC3D,MAAM,CAAC,MAAM,WAAW,SAAuB,MAAM;CAErD,MAAM,EAAE,YAAY,UAAU,WAAW;CACzC,MAAM,SAAS,UAAU,QAAQ;CACjC,MAAM,OAAO,QAAQ,QAAQ;CAG7B,MAAM,YAAY,cAAc;EAC9B,MAAM,SAAS,wBACb,YACA,WAAW,KAAA,IAAY,KAAA,IAAY,IAAI,KAAK,MAAM,GAClD,SAAS,KAAA,IAAY,KAAA,IAAY,IAAI,KAAK,IAAI,CAChD;EACA,OAAO,2BAA2B,OAAO,UAAU,OAAO,wBAAQ,IAAI,KAAK,CAAC;CAC9E,GAAG;EAAC;EAAY;EAAQ;CAAI,CAAC;CAG7B,MAAM,sBAAsB,WAC1B,UAAS,YAAY,WAAW,WAAW;EAAE,GAAG;EAAS,YAAY;CAAO,IAAI,EAAE,YAAY,OAAO,CAAE;CAEzG,MAAM,gBAAgB,MAAwB,QAC5C,UAAS,YAAW;EAClB,IAAI,QAAQ,eAAe,UAAU,OAAO;EAC5C,OAAO,QAAQ,SAAS;GAAE,GAAG;GAAS,UAAU;EAAK,IAAI;GAAE,GAAG;GAAS,QAAQ;EAAK;CACtF,CAAC;CACH,MAAM,qBAAqB,MAAwB,OACjD,UAAS,YAAY,QAAQ,eAAe,WAAW;EAAE,GAAG;EAAS,UAAU;EAAM,QAAQ;CAAG,IAAI,OAAQ;CAC9G,MAAM,mBAAmB,YAAgC,eAAmC;EAC1F,UAAU,UAAU;EACpB,UAAU,UAAU;CACtB;CAEA,MAAM,wBAAwB,OAAO,SAAS,KAAK,OAAO,SAAS;CAGnE,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAhBqB,yBAAyB,eAAe;CAiB/D;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _mastra_react_hooks_capabilities = require("@mastra/react/hooks/capabilities");
|
|
3
|
+
//#region src/domains/observability/hooks/use-observability-views.ts
|
|
4
|
+
/**
|
|
5
|
+
* The observability views a host can switch between. Reads the capabilities directly, so it works
|
|
6
|
+
* outside a `TracesExplorer` (e.g. in a layout shared by the traces, spans and threads pages).
|
|
7
|
+
*/
|
|
8
|
+
function useObservabilityViews({ current, features }) {
|
|
9
|
+
const spanQuery = (0, _mastra_react_hooks_capabilities.useSpanQueryAvailable)();
|
|
10
|
+
const threadQuery = (0, _mastra_react_hooks_capabilities.useThreadQueryAvailable)();
|
|
11
|
+
const views = ["traces"];
|
|
12
|
+
if (spanQuery.enabled && features?.spanQuery === true) views.push("spans");
|
|
13
|
+
if (threadQuery.enabled && features?.threadQuery === true) views.push("threads");
|
|
14
|
+
const isLoading = spanQuery.isLoading || threadQuery.isLoading;
|
|
15
|
+
return {
|
|
16
|
+
views,
|
|
17
|
+
isLoading,
|
|
18
|
+
showSwitch: !isLoading && views.length > 1 && views.includes(current)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.useObservabilityViews = useObservabilityViews;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=use-observability-views.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-observability-views.cjs.js","names":["useSpanQueryAvailable","useThreadQueryAvailable"],"sources":["../../../../src/domains/observability/hooks/use-observability-views.ts"],"sourcesContent":["import { useSpanQueryAvailable, useThreadQueryAvailable } from '@/domains/capabilities';\nimport type { TracesExplorerFeatures } from '@/domains/traces/components/traces-explorer/traces-explorer-context';\nimport type { ObservabilityView } from '@/domains/traces/components/traces-spans-switch';\n\nexport type UseObservabilityViewsArgs = {\n /** The view the host is showing. */\n current: ObservabilityView;\n /** Host switches: a spans or threads view is offered only when its flag is `true` and the server supports it. */\n features?: TracesExplorerFeatures;\n};\n\nexport type ObservabilityViewsState = {\n /** The views to offer, in order. Traces is always first. */\n views: ObservabilityView[];\n /** The store capabilities that decide the views are still loading. */\n isLoading: boolean;\n /** More than one view is available and the current one is among them. */\n showSwitch: boolean;\n};\n\n/**\n * The observability views a host can switch between. Reads the capabilities directly, so it works\n * outside a `TracesExplorer` (e.g. in a layout shared by the traces, spans and threads pages).\n */\nexport function useObservabilityViews({ current, features }: UseObservabilityViewsArgs): ObservabilityViewsState {\n const spanQuery = useSpanQueryAvailable();\n const threadQuery = useThreadQueryAvailable();\n\n const views: ObservabilityView[] = ['traces'];\n if (spanQuery.enabled && features?.spanQuery === true) views.push('spans');\n if (threadQuery.enabled && features?.threadQuery === true) views.push('threads');\n\n const isLoading = spanQuery.isLoading || threadQuery.isLoading;\n const showSwitch = !isLoading && views.length > 1 && views.includes(current);\n\n return { views, isLoading, showSwitch };\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,sBAAsB,EAAE,SAAS,YAAgE;CAC/G,MAAM,aAAA,GAAYA,iCAAAA,sBAAAA,CAAsB;CACxC,MAAM,eAAA,GAAcC,iCAAAA,wBAAAA,CAAwB;CAE5C,MAAM,QAA6B,CAAC,QAAQ;CAC5C,IAAI,UAAU,WAAW,UAAU,cAAc,MAAM,MAAM,KAAK,OAAO;CACzE,IAAI,YAAY,WAAW,UAAU,gBAAgB,MAAM,MAAM,KAAK,SAAS;CAE/E,MAAM,YAAY,UAAU,aAAa,YAAY;CAGrD,OAAO;EAAE;EAAO;EAAW,YAFR,CAAC,aAAa,MAAM,SAAS,KAAK,MAAM,SAAS,OAAO;CAErC;AACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../src/domains/observability/hooks/use-observability-views';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useSpanQueryAvailable, useThreadQueryAvailable } from "../../capabilities.es.js";
|
|
2
|
+
//#region src/domains/observability/hooks/use-observability-views.ts
|
|
3
|
+
/**
|
|
4
|
+
* The observability views a host can switch between. Reads the capabilities directly, so it works
|
|
5
|
+
* outside a `TracesExplorer` (e.g. in a layout shared by the traces, spans and threads pages).
|
|
6
|
+
*/
|
|
7
|
+
function useObservabilityViews({ current, features }) {
|
|
8
|
+
const spanQuery = useSpanQueryAvailable();
|
|
9
|
+
const threadQuery = useThreadQueryAvailable();
|
|
10
|
+
const views = ["traces"];
|
|
11
|
+
if (spanQuery.enabled && features?.spanQuery === true) views.push("spans");
|
|
12
|
+
if (threadQuery.enabled && features?.threadQuery === true) views.push("threads");
|
|
13
|
+
const isLoading = spanQuery.isLoading || threadQuery.isLoading;
|
|
14
|
+
return {
|
|
15
|
+
views,
|
|
16
|
+
isLoading,
|
|
17
|
+
showSwitch: !isLoading && views.length > 1 && views.includes(current)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { useObservabilityViews };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=use-observability-views.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-observability-views.es.js","names":[],"sources":["../../../../src/domains/observability/hooks/use-observability-views.ts"],"sourcesContent":["import { useSpanQueryAvailable, useThreadQueryAvailable } from '@/domains/capabilities';\nimport type { TracesExplorerFeatures } from '@/domains/traces/components/traces-explorer/traces-explorer-context';\nimport type { ObservabilityView } from '@/domains/traces/components/traces-spans-switch';\n\nexport type UseObservabilityViewsArgs = {\n /** The view the host is showing. */\n current: ObservabilityView;\n /** Host switches: a spans or threads view is offered only when its flag is `true` and the server supports it. */\n features?: TracesExplorerFeatures;\n};\n\nexport type ObservabilityViewsState = {\n /** The views to offer, in order. Traces is always first. */\n views: ObservabilityView[];\n /** The store capabilities that decide the views are still loading. */\n isLoading: boolean;\n /** More than one view is available and the current one is among them. */\n showSwitch: boolean;\n};\n\n/**\n * The observability views a host can switch between. Reads the capabilities directly, so it works\n * outside a `TracesExplorer` (e.g. in a layout shared by the traces, spans and threads pages).\n */\nexport function useObservabilityViews({ current, features }: UseObservabilityViewsArgs): ObservabilityViewsState {\n const spanQuery = useSpanQueryAvailable();\n const threadQuery = useThreadQueryAvailable();\n\n const views: ObservabilityView[] = ['traces'];\n if (spanQuery.enabled && features?.spanQuery === true) views.push('spans');\n if (threadQuery.enabled && features?.threadQuery === true) views.push('threads');\n\n const isLoading = spanQuery.isLoading || threadQuery.isLoading;\n const showSwitch = !isLoading && views.length > 1 && views.includes(current);\n\n return { views, isLoading, showSwitch };\n}\n"],"mappings":";;;;;;AAwBA,SAAgB,sBAAsB,EAAE,SAAS,YAAgE;CAC/G,MAAM,YAAY,sBAAsB;CACxC,MAAM,cAAc,wBAAwB;CAE5C,MAAM,QAA6B,CAAC,QAAQ;CAC5C,IAAI,UAAU,WAAW,UAAU,cAAc,MAAM,MAAM,KAAK,OAAO;CACzE,IAAI,YAAY,WAAW,UAAU,gBAAgB,MAAM,MAAM,KAAK,SAAS;CAE/E,MAAM,YAAY,UAAU,aAAa,YAAY;CAGrD,OAAO;EAAE;EAAO;EAAW,YAFR,CAAC,aAAa,MAAM,SAAS,KAAK,MAAM,SAAS,OAAO;CAErC;AACxC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/domains/observability/observability-crumbs.ts
|
|
3
|
+
var OBSERVABILITY_VIEW_LABELS = {
|
|
4
|
+
traces: "Traces",
|
|
5
|
+
spans: "Spans",
|
|
6
|
+
threads: "Threads"
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The crumb naming the current view after the root "Traces" crumb, or `undefined` when none is needed:
|
|
10
|
+
* on the traces page, while the views load, or when the switch already shows which view is open.
|
|
11
|
+
*/
|
|
12
|
+
function observabilityViewCrumbLabel({ current, isLoading, showSwitch }) {
|
|
13
|
+
if (isLoading || showSwitch || current === "traces") return void 0;
|
|
14
|
+
return OBSERVABILITY_VIEW_LABELS[current];
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.OBSERVABILITY_VIEW_LABELS = OBSERVABILITY_VIEW_LABELS;
|
|
18
|
+
exports.observabilityViewCrumbLabel = observabilityViewCrumbLabel;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=observability-crumbs.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-crumbs.cjs.js","names":[],"sources":["../../../src/domains/observability/observability-crumbs.ts"],"sourcesContent":["import type { ObservabilityBreadcrumbsState } from './components/observability-page-layout';\nimport type { ObservabilityView } from '@/domains/traces/components/traces-spans-switch';\n\nexport const OBSERVABILITY_VIEW_LABELS: Record<ObservabilityView, string> = {\n traces: 'Traces',\n spans: 'Spans',\n threads: 'Threads',\n};\n\n/**\n * The crumb naming the current view after the root \"Traces\" crumb, or `undefined` when none is needed:\n * on the traces page, while the views load, or when the switch already shows which view is open.\n */\nexport function observabilityViewCrumbLabel({\n current,\n isLoading,\n showSwitch,\n}: ObservabilityBreadcrumbsState): string | undefined {\n if (isLoading || showSwitch || current === 'traces') return undefined;\n return OBSERVABILITY_VIEW_LABELS[current];\n}\n"],"mappings":";;AAGA,IAAa,4BAA+D;CAC1E,QAAQ;CACR,OAAO;CACP,SAAS;AACX;;;;;AAMA,SAAgB,4BAA4B,EAC1C,SACA,WACA,cACoD;CACpD,IAAI,aAAa,cAAc,YAAY,UAAU,OAAO,KAAA;CAC5D,OAAO,0BAA0B;AACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../src/domains/observability/observability-crumbs';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/domains/observability/observability-crumbs.ts
|
|
2
|
+
var OBSERVABILITY_VIEW_LABELS = {
|
|
3
|
+
traces: "Traces",
|
|
4
|
+
spans: "Spans",
|
|
5
|
+
threads: "Threads"
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The crumb naming the current view after the root "Traces" crumb, or `undefined` when none is needed:
|
|
9
|
+
* on the traces page, while the views load, or when the switch already shows which view is open.
|
|
10
|
+
*/
|
|
11
|
+
function observabilityViewCrumbLabel({ current, isLoading, showSwitch }) {
|
|
12
|
+
if (isLoading || showSwitch || current === "traces") return void 0;
|
|
13
|
+
return OBSERVABILITY_VIEW_LABELS[current];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { OBSERVABILITY_VIEW_LABELS, observabilityViewCrumbLabel };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=observability-crumbs.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-crumbs.es.js","names":[],"sources":["../../../src/domains/observability/observability-crumbs.ts"],"sourcesContent":["import type { ObservabilityBreadcrumbsState } from './components/observability-page-layout';\nimport type { ObservabilityView } from '@/domains/traces/components/traces-spans-switch';\n\nexport const OBSERVABILITY_VIEW_LABELS: Record<ObservabilityView, string> = {\n traces: 'Traces',\n spans: 'Spans',\n threads: 'Threads',\n};\n\n/**\n * The crumb naming the current view after the root \"Traces\" crumb, or `undefined` when none is needed:\n * on the traces page, while the views load, or when the switch already shows which view is open.\n */\nexport function observabilityViewCrumbLabel({\n current,\n isLoading,\n showSwitch,\n}: ObservabilityBreadcrumbsState): string | undefined {\n if (isLoading || showSwitch || current === 'traces') return undefined;\n return OBSERVABILITY_VIEW_LABELS[current];\n}\n"],"mappings":";AAGA,IAAa,4BAA+D;CAC1E,QAAQ;CACR,OAAO;CACP,SAAS;AACX;;;;;AAMA,SAAgB,4BAA4B,EAC1C,SACA,WACA,cACoD;CACpD,IAAI,aAAa,cAAc,YAAY,UAAU,OAAO,KAAA;CAC5D,OAAO,0BAA0B;AACnC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/domains/observability/observability-selection-params.ts
|
|
3
|
+
/** The open span, read from the same `traceId` + `spanId` params as the traces page. */
|
|
4
|
+
function readSpanSelection(params) {
|
|
5
|
+
const traceId = params.get("traceId");
|
|
6
|
+
const spanId = params.get("spanId");
|
|
7
|
+
return traceId && spanId ? {
|
|
8
|
+
traceId,
|
|
9
|
+
spanId
|
|
10
|
+
} : void 0;
|
|
11
|
+
}
|
|
12
|
+
/** A copy of `params` with the span selection set, or cleared when `selection` is undefined. */
|
|
13
|
+
function withSpanSelection(params, selection) {
|
|
14
|
+
const next = new URLSearchParams(params);
|
|
15
|
+
if (selection) {
|
|
16
|
+
next.set("traceId", selection.traceId);
|
|
17
|
+
next.set("spanId", selection.spanId);
|
|
18
|
+
} else {
|
|
19
|
+
next.delete("traceId");
|
|
20
|
+
next.delete("spanId");
|
|
21
|
+
}
|
|
22
|
+
return next;
|
|
23
|
+
}
|
|
24
|
+
/** The search for opening a span inside its trace on the traces page. */
|
|
25
|
+
function spanTraceSearch({ traceId, spanId }) {
|
|
26
|
+
return new URLSearchParams({
|
|
27
|
+
traceId,
|
|
28
|
+
spanId
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** The open thread, read from the `threadId` param. */
|
|
32
|
+
function readThreadSelection(params) {
|
|
33
|
+
return params.get("threadId") ?? void 0;
|
|
34
|
+
}
|
|
35
|
+
/** A copy of `params` with the thread selection set, or cleared when `threadId` is undefined. */
|
|
36
|
+
function withThreadSelection(params, threadId) {
|
|
37
|
+
const next = new URLSearchParams(params);
|
|
38
|
+
if (threadId) next.set("threadId", threadId);
|
|
39
|
+
else next.delete("threadId");
|
|
40
|
+
return next;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.readSpanSelection = readSpanSelection;
|
|
44
|
+
exports.readThreadSelection = readThreadSelection;
|
|
45
|
+
exports.spanTraceSearch = spanTraceSearch;
|
|
46
|
+
exports.withSpanSelection = withSpanSelection;
|
|
47
|
+
exports.withThreadSelection = withThreadSelection;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=observability-selection-params.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-selection-params.cjs.js","names":[],"sources":["../../../src/domains/observability/observability-selection-params.ts"],"sourcesContent":["import type { SpanSelection } from '@/domains/spans/components/span-detail-panel';\n\n/** The open span, read from the same `traceId` + `spanId` params as the traces page. */\nexport function readSpanSelection(params: URLSearchParams): SpanSelection | undefined {\n const traceId = params.get('traceId');\n const spanId = params.get('spanId');\n return traceId && spanId ? { traceId, spanId } : undefined;\n}\n\n/** A copy of `params` with the span selection set, or cleared when `selection` is undefined. */\nexport function withSpanSelection(params: URLSearchParams, selection: SpanSelection | undefined): URLSearchParams {\n const next = new URLSearchParams(params);\n if (selection) {\n next.set('traceId', selection.traceId);\n next.set('spanId', selection.spanId);\n } else {\n next.delete('traceId');\n next.delete('spanId');\n }\n return next;\n}\n\n/** The search for opening a span inside its trace on the traces page. */\nexport function spanTraceSearch({ traceId, spanId }: SpanSelection): URLSearchParams {\n return new URLSearchParams({ traceId, spanId });\n}\n\n/** The open thread, read from the `threadId` param. */\nexport function readThreadSelection(params: URLSearchParams): string | undefined {\n return params.get('threadId') ?? undefined;\n}\n\n/** A copy of `params` with the thread selection set, or cleared when `threadId` is undefined. */\nexport function withThreadSelection(params: URLSearchParams, threadId: string | undefined): URLSearchParams {\n const next = new URLSearchParams(params);\n if (threadId) next.set('threadId', threadId);\n else next.delete('threadId');\n return next;\n}\n"],"mappings":";;;AAGA,SAAgB,kBAAkB,QAAoD;CACpF,MAAM,UAAU,OAAO,IAAI,SAAS;CACpC,MAAM,SAAS,OAAO,IAAI,QAAQ;CAClC,OAAO,WAAW,SAAS;EAAE;EAAS;CAAO,IAAI,KAAA;AACnD;;AAGA,SAAgB,kBAAkB,QAAyB,WAAuD;CAChH,MAAM,OAAO,IAAI,gBAAgB,MAAM;CACvC,IAAI,WAAW;EACb,KAAK,IAAI,WAAW,UAAU,OAAO;EACrC,KAAK,IAAI,UAAU,UAAU,MAAM;CACrC,OAAO;EACL,KAAK,OAAO,SAAS;EACrB,KAAK,OAAO,QAAQ;CACtB;CACA,OAAO;AACT;;AAGA,SAAgB,gBAAgB,EAAE,SAAS,UAA0C;CACnF,OAAO,IAAI,gBAAgB;EAAE;EAAS;CAAO,CAAC;AAChD;;AAGA,SAAgB,oBAAoB,QAA6C;CAC/E,OAAO,OAAO,IAAI,UAAU,KAAK,KAAA;AACnC;;AAGA,SAAgB,oBAAoB,QAAyB,UAA+C;CAC1G,MAAM,OAAO,IAAI,gBAAgB,MAAM;CACvC,IAAI,UAAU,KAAK,IAAI,YAAY,QAAQ;MACtC,KAAK,OAAO,UAAU;CAC3B,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../src/domains/observability/observability-selection-params';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/domains/observability/observability-selection-params.ts
|
|
2
|
+
/** The open span, read from the same `traceId` + `spanId` params as the traces page. */
|
|
3
|
+
function readSpanSelection(params) {
|
|
4
|
+
const traceId = params.get("traceId");
|
|
5
|
+
const spanId = params.get("spanId");
|
|
6
|
+
return traceId && spanId ? {
|
|
7
|
+
traceId,
|
|
8
|
+
spanId
|
|
9
|
+
} : void 0;
|
|
10
|
+
}
|
|
11
|
+
/** A copy of `params` with the span selection set, or cleared when `selection` is undefined. */
|
|
12
|
+
function withSpanSelection(params, selection) {
|
|
13
|
+
const next = new URLSearchParams(params);
|
|
14
|
+
if (selection) {
|
|
15
|
+
next.set("traceId", selection.traceId);
|
|
16
|
+
next.set("spanId", selection.spanId);
|
|
17
|
+
} else {
|
|
18
|
+
next.delete("traceId");
|
|
19
|
+
next.delete("spanId");
|
|
20
|
+
}
|
|
21
|
+
return next;
|
|
22
|
+
}
|
|
23
|
+
/** The search for opening a span inside its trace on the traces page. */
|
|
24
|
+
function spanTraceSearch({ traceId, spanId }) {
|
|
25
|
+
return new URLSearchParams({
|
|
26
|
+
traceId,
|
|
27
|
+
spanId
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** The open thread, read from the `threadId` param. */
|
|
31
|
+
function readThreadSelection(params) {
|
|
32
|
+
return params.get("threadId") ?? void 0;
|
|
33
|
+
}
|
|
34
|
+
/** A copy of `params` with the thread selection set, or cleared when `threadId` is undefined. */
|
|
35
|
+
function withThreadSelection(params, threadId) {
|
|
36
|
+
const next = new URLSearchParams(params);
|
|
37
|
+
if (threadId) next.set("threadId", threadId);
|
|
38
|
+
else next.delete("threadId");
|
|
39
|
+
return next;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { readSpanSelection, readThreadSelection, spanTraceSearch, withSpanSelection, withThreadSelection };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=observability-selection-params.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability-selection-params.es.js","names":[],"sources":["../../../src/domains/observability/observability-selection-params.ts"],"sourcesContent":["import type { SpanSelection } from '@/domains/spans/components/span-detail-panel';\n\n/** The open span, read from the same `traceId` + `spanId` params as the traces page. */\nexport function readSpanSelection(params: URLSearchParams): SpanSelection | undefined {\n const traceId = params.get('traceId');\n const spanId = params.get('spanId');\n return traceId && spanId ? { traceId, spanId } : undefined;\n}\n\n/** A copy of `params` with the span selection set, or cleared when `selection` is undefined. */\nexport function withSpanSelection(params: URLSearchParams, selection: SpanSelection | undefined): URLSearchParams {\n const next = new URLSearchParams(params);\n if (selection) {\n next.set('traceId', selection.traceId);\n next.set('spanId', selection.spanId);\n } else {\n next.delete('traceId');\n next.delete('spanId');\n }\n return next;\n}\n\n/** The search for opening a span inside its trace on the traces page. */\nexport function spanTraceSearch({ traceId, spanId }: SpanSelection): URLSearchParams {\n return new URLSearchParams({ traceId, spanId });\n}\n\n/** The open thread, read from the `threadId` param. */\nexport function readThreadSelection(params: URLSearchParams): string | undefined {\n return params.get('threadId') ?? undefined;\n}\n\n/** A copy of `params` with the thread selection set, or cleared when `threadId` is undefined. */\nexport function withThreadSelection(params: URLSearchParams, threadId: string | undefined): URLSearchParams {\n const next = new URLSearchParams(params);\n if (threadId) next.set('threadId', threadId);\n else next.delete('threadId');\n return next;\n}\n"],"mappings":";;AAGA,SAAgB,kBAAkB,QAAoD;CACpF,MAAM,UAAU,OAAO,IAAI,SAAS;CACpC,MAAM,SAAS,OAAO,IAAI,QAAQ;CAClC,OAAO,WAAW,SAAS;EAAE;EAAS;CAAO,IAAI,KAAA;AACnD;;AAGA,SAAgB,kBAAkB,QAAyB,WAAuD;CAChH,MAAM,OAAO,IAAI,gBAAgB,MAAM;CACvC,IAAI,WAAW;EACb,KAAK,IAAI,WAAW,UAAU,OAAO;EACrC,KAAK,IAAI,UAAU,UAAU,MAAM;CACrC,OAAO;EACL,KAAK,OAAO,SAAS;EACrB,KAAK,OAAO,QAAQ;CACtB;CACA,OAAO;AACT;;AAGA,SAAgB,gBAAgB,EAAE,SAAS,UAA0C;CACnF,OAAO,IAAI,gBAAgB;EAAE;EAAS;CAAO,CAAC;AAChD;;AAGA,SAAgB,oBAAoB,QAA6C;CAC/E,OAAO,OAAO,IAAI,UAAU,KAAK,KAAA;AACnC;;AAGA,SAAgB,oBAAoB,QAAyB,UAA+C;CAC1G,MAAM,OAAO,IAAI,gBAAgB,MAAM;CACvC,IAAI,UAAU,KAAK,IAAI,YAAY,QAAQ;MACtC,KAAK,OAAO,UAAU;CAC3B,OAAO;AACT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_domains_observability_components_observability_capability_gate = require("./observability/components/observability-capability-gate.cjs.js");
|
|
3
|
+
const require_domains_observability_components_observability_list_body = require("./observability/components/observability-list-body.cjs.js");
|
|
4
|
+
const require_domains_observability_hooks_use_observability_views = require("./observability/hooks/use-observability-views.cjs.js");
|
|
5
|
+
const require_domains_observability_components_observability_page_layout = require("./observability/components/observability-page-layout.cjs.js");
|
|
6
|
+
const require_domains_observability_hooks_use_observability_list_filters = require("./observability/hooks/use-observability-list-filters.cjs.js");
|
|
7
|
+
const require_domains_observability_observability_crumbs = require("./observability/observability-crumbs.cjs.js");
|
|
8
|
+
const require_domains_observability_observability_selection_params = require("./observability/observability-selection-params.cjs.js");
|
|
9
|
+
exports.OBSERVABILITY_VIEW_LABELS = require_domains_observability_observability_crumbs.OBSERVABILITY_VIEW_LABELS;
|
|
10
|
+
exports.ObservabilityCapabilityGate = require_domains_observability_components_observability_capability_gate.ObservabilityCapabilityGate;
|
|
11
|
+
exports.ObservabilityListBody = require_domains_observability_components_observability_list_body.ObservabilityListBody;
|
|
12
|
+
exports.ObservabilityPageLayout = require_domains_observability_components_observability_page_layout.ObservabilityPageLayout;
|
|
13
|
+
exports.observabilityListQueryOptions = require_domains_observability_hooks_use_observability_list_filters.observabilityListQueryOptions;
|
|
14
|
+
exports.observabilityViewCrumbLabel = require_domains_observability_observability_crumbs.observabilityViewCrumbLabel;
|
|
15
|
+
exports.readSpanSelection = require_domains_observability_observability_selection_params.readSpanSelection;
|
|
16
|
+
exports.readThreadSelection = require_domains_observability_observability_selection_params.readThreadSelection;
|
|
17
|
+
exports.spanTraceSearch = require_domains_observability_observability_selection_params.spanTraceSearch;
|
|
18
|
+
exports.useObservabilityListFilters = require_domains_observability_hooks_use_observability_list_filters.useObservabilityListFilters;
|
|
19
|
+
exports.useObservabilityViews = require_domains_observability_hooks_use_observability_views.useObservabilityViews;
|
|
20
|
+
exports.withSpanSelection = require_domains_observability_observability_selection_params.withSpanSelection;
|
|
21
|
+
exports.withThreadSelection = require_domains_observability_observability_selection_params.withThreadSelection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../src/domains/observability/index';
|