@wso2/am-core-ui 0.0.18 → 0.0.19

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 (45) hide show
  1. package/dist/APIKeysManager-C0phJriD.js +241 -0
  2. package/dist/CatalogKindListing-DtFI2YMG.js +118 -0
  3. package/dist/CodeBlock-mB_Loq7I.js +21736 -0
  4. package/dist/EnvironmentCard-09h1XRxx.js +310 -0
  5. package/dist/EnvironmentSelector-B7Bl93s2.js +48 -0
  6. package/dist/MCPLogo-D9IJzzl7.js +30 -0
  7. package/dist/PolicyListSection-o4k9e8XO.js +2475 -0
  8. package/dist/ResourceListShell-Cx6mdeqv.js +463 -0
  9. package/dist/SwaggerSpecViewer-BvkhoKsi.js +106 -0
  10. package/dist/clipboard-YAzStmkw.js +23 -0
  11. package/dist/debounce-BV83M53b.js +208 -0
  12. package/dist/format-BEZZRyE2.js +29 -0
  13. package/dist/formatDistanceToNow-TErllcH8.js +100 -0
  14. package/dist/gatewayScripts-D8O45W8u.js +72 -0
  15. package/dist/highlight-BsUzxSR3.js +454 -0
  16. package/dist/index-B52h3RHg.js +1290 -0
  17. package/dist/index-BP5drcF2.js +1265 -0
  18. package/dist/index-BZ4vxviI.js +7981 -0
  19. package/dist/index-B_Z0MwXk.js +25012 -0
  20. package/dist/index-BfjzUWDa.js +1397 -0
  21. package/dist/{index-DYV1jEai.js → index-BnV-PkwM.js} +22 -20
  22. package/dist/index-CGDYgUCH.js +711 -0
  23. package/dist/index-COt7nJIf.js +2286 -0
  24. package/dist/index-CWZjOy1h.js +2247 -0
  25. package/dist/index-CezvogTQ.js +116 -0
  26. package/dist/index-CgCWbWzN.js +2342 -0
  27. package/dist/index-CjCkcuuI.js +322 -0
  28. package/dist/index-CjXvuf9m.js +1354 -0
  29. package/dist/index-DD4qF7gq.js +2340 -0
  30. package/dist/index-DeQ-9KTC.js +737 -0
  31. package/dist/index-Df6OBy4E.js +3041 -0
  32. package/dist/index-KRsV2L4V.js +1564 -0
  33. package/dist/index-PUuASE1F.js +2507 -0
  34. package/dist/index-PWsNvJB-.js +546 -0
  35. package/dist/index-UqDmyMSA.js +119 -0
  36. package/dist/index-_0Pj_ZtW.js +459 -0
  37. package/dist/{index-CnXsN5I3.js → index-sr-mWz4T.js} +31 -30
  38. package/dist/index.d.ts +496 -200
  39. package/dist/index.js +462 -439
  40. package/dist/llmProviderPayload-CzihkdNa.js +332 -0
  41. package/dist/schemas-DFScWdSL.js +2969 -0
  42. package/package.json +1 -1
  43. package/dist/index-B47EJCom.js +0 -236
  44. package/dist/index-Bl1Y7Sro.js +0 -3037
  45. package/dist/index-DlS9Lybj.js +0 -80691
@@ -0,0 +1,116 @@
1
+ import { jsx as a, jsxs as C } from "react/jsx-runtime";
2
+ import { useMemo as l, useCallback as m, useState as F, useEffect as G } from "react";
3
+ import { useParams as Y, useSearchParams as q } from "react-router-dom";
4
+ import { aS as X, T as r, aV as Z, aW as J, P as K, O as Q, aU as $ } from "./index-B_Z0MwXk.js";
5
+ import "react/compiler-runtime";
6
+ import "@tanstack/react-query";
7
+ import { Stack as ee, Select as se, MenuItem as ae, Checkbox as te, ListItemText as oe, InputAdornment as ne, IconButton as A, CircularProgress as re } from "@wso2/oxygen-ui";
8
+ import { Filter as le, SortDesc as ce, SortAsc as ie, RefreshCcw as me, Logs as de } from "@wso2/oxygen-ui-icons-react";
9
+ import { E as ge } from "./EnvironmentSelector-B7Bl93s2.js";
10
+ const he = ["DEBUG", "INFO", "WARN", "ERROR"], ue = [{
11
+ value: r.TEN_MINUTES,
12
+ label: "10 Minutes"
13
+ }, {
14
+ value: r.THIRTY_MINUTES,
15
+ label: "30 Minutes"
16
+ }, {
17
+ value: r.ONE_HOUR,
18
+ label: "1 Hour"
19
+ }, {
20
+ value: r.SIX_HOURS,
21
+ label: "6 Hours"
22
+ }, {
23
+ value: r.TWELVE_HOURS,
24
+ label: "12 Hours"
25
+ }, {
26
+ value: r.ONE_DAY,
27
+ label: "1 Day"
28
+ }, {
29
+ value: r.SEVEN_DAYS,
30
+ label: "7 Days"
31
+ }], pe = 300, Le = 2e3, w = () => {
32
+ const {
33
+ agentId: p,
34
+ orgId: L,
35
+ projectId: S,
36
+ envId: R
37
+ } = Y(), [s, n] = q(), {
38
+ customStartTime: g,
39
+ customEndTime: h,
40
+ hasCustomRange: c,
41
+ handleCustomRangeApply: D
42
+ } = X(s, n), u = l(() => c ? void 0 : Object.values(r).includes(s.get("timeRange") ?? "") ? s.get("timeRange") : r.ONE_HOUR, [s, c]), o = l(() => s.get("sortOrder") || "desc", [s]), d = l(() => s.get("search") || "", [s]), i = l(() => {
43
+ const e = s.get("logLevels");
44
+ return e ? e.split(",").filter(Boolean) : [];
45
+ }, [s]), x = m((e) => {
46
+ const t = new URLSearchParams(s);
47
+ e.length === 0 ? t.delete("logLevels") : t.set("logLevels", e.join(",")), n(t);
48
+ }, [s, n]), [E, v] = F(d), T = l(() => Z.debounce((e) => v(e), Le), [v]);
49
+ G(() => {
50
+ T(d);
51
+ }, [T, d]);
52
+ const M = l(() => ({
53
+ environmentName: R ?? "",
54
+ timeRange: u,
55
+ startTime: c ? g : void 0,
56
+ endTime: c ? h : void 0,
57
+ sortOrder: o,
58
+ searchPhrase: E,
59
+ logLevels: i.length > 0 ? i : void 0
60
+ }), [R, u, c, g, h, o, E, i]), z = l(() => ({
61
+ agentName: p,
62
+ orgName: L,
63
+ projName: S
64
+ }), [p, L, S]), {
65
+ logs: y,
66
+ error: H,
67
+ isLoading: j,
68
+ isRefetching: O,
69
+ refetch: f,
70
+ isLoadingOlder: I,
71
+ isLoadingNewer: N,
72
+ loadOlder: P,
73
+ loadNewer: _,
74
+ hasMoreOlder: U,
75
+ hasMoreNewer: b
76
+ } = J(z, M, {
77
+ refetchInterval: !1,
78
+ pageSize: pe
79
+ }), k = m(() => {
80
+ f();
81
+ }, [f]), V = m((e) => {
82
+ const t = new URLSearchParams(s);
83
+ t.set("search", e), n(t);
84
+ }, [s, n]), W = m((e) => {
85
+ const t = new URLSearchParams(s);
86
+ t.set("timeRange", e), t.delete("startTime"), t.delete("endTime"), n(t);
87
+ }, [s, n]), B = m((e) => {
88
+ const t = new URLSearchParams(s);
89
+ t.set("sortOrder", e), n(t);
90
+ }, [s, n]);
91
+ return /* @__PURE__ */ a(K, { title: "Runtime Logs", disableIcon: !0, actions: /* @__PURE__ */ C(ee, { direction: "row", spacing: 2, alignItems: "center", flexWrap: "wrap", children: [
92
+ /* @__PURE__ */ a(ge, {}),
93
+ /* @__PURE__ */ a(se, { size: "small", variant: "outlined", multiple: !0, value: i, onChange: (e) => x(e.target.value), displayEmpty: !0, renderValue: (e) => e.length === 0 ? "All Levels" : e.join(", "), startAdornment: /* @__PURE__ */ a(ne, { position: "start", children: /* @__PURE__ */ a(le, { size: 16 }) }), sx: {
94
+ minWidth: 150
95
+ }, children: he.map((e) => /* @__PURE__ */ C(ae, { value: e, children: [
96
+ /* @__PURE__ */ a(te, { checked: i.includes(e), size: "small" }),
97
+ /* @__PURE__ */ a(oe, { primary: e })
98
+ ] }, e)) }),
99
+ /* @__PURE__ */ a($, { preset: u, customStart: g, customEnd: h, options: ue, onPresetChange: W, onCustomRangeApply: D }),
100
+ /* @__PURE__ */ a(A, { size: "small", onClick: () => B(o === "desc" ? "asc" : "desc"), "aria-label": o === "desc" ? "Sort ascending" : "Sort descending", children: o === "desc" ? /* @__PURE__ */ a(ce, { size: 16 }) : /* @__PURE__ */ a(ie, { size: 16 }) }),
101
+ /* @__PURE__ */ a(A, { size: "small", disabled: O, onClick: k, "aria-label": "Refresh", children: O ? /* @__PURE__ */ a(re, { size: 16 }) : /* @__PURE__ */ a(me, { size: 16 }) })
102
+ ] }), children: /* @__PURE__ */ a(Q, { logs: y, isLoading: j, error: H, isLoadingUp: o === "asc" ? N : I, isLoadingDown: o === "asc" ? I : N, hasMoreUp: o === "asc" ? b : U, hasMoreDown: o === "asc" ? U : b, onLoadUp: o === "asc" ? _ : P, onLoadDown: o === "asc" ? P : _, onSearch: V, search: d }) });
103
+ }, Pe = {
104
+ title: "Runtime Logs",
105
+ description: "A page component for Logs",
106
+ icon: de,
107
+ path: "/logs",
108
+ component: w,
109
+ levels: {
110
+ component: w
111
+ }
112
+ };
113
+ export {
114
+ w as LogsComponent,
115
+ Pe as metaData
116
+ };