@burdenoff/microfe-sandbox 2026.625.3 → 2026.626.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/sandbox/components/SandboxActivityTab.js +26 -23
- package/dist/sandbox/components/SandboxActivityTab.js.map +1 -1
- package/dist/sandbox/pages/AdminPage.js +327 -291
- package/dist/sandbox/pages/AdminPage.js.map +1 -1
- package/dist/sandbox/pages/AdminTemplatesPage.js +137 -132
- package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxCreatePage.js +300 -297
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -1
- package/dist/sandbox/pages/SandboxDetailPage.js +422 -382
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -1
- package/dist/sandbox/pages/SandboxListPage.js +301 -297
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -1
- package/dist/sandbox/pages/TemplateDetailPage.js +249 -245
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -1
- package/dist/sandbox/pages/UserTemplatesPage.js +26 -25
- package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -4,8 +4,9 @@ import { gql as i } from "@apollo/client";
|
|
|
4
4
|
import { useApolloClient as a } from "@apollo/client/react";
|
|
5
5
|
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { IllustratedEmptyState as l } from "@burdenoff/fe-libs/ui";
|
|
7
8
|
//#region src/sandbox/components/SandboxActivityTab.tsx
|
|
8
|
-
var
|
|
9
|
+
var u = i`
|
|
9
10
|
query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {
|
|
10
11
|
getRecentSandboxActivity(context: $context, limit: $limit) {
|
|
11
12
|
items {
|
|
@@ -21,43 +22,45 @@ var l = i`
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
`;
|
|
24
|
-
function
|
|
25
|
-
let { t:
|
|
25
|
+
function d({ sandboxId: i, workspaceId: d, pageSize: f = 50 }) {
|
|
26
|
+
let { t: p } = o(), m = a(), [h, g] = r(null), [_, v] = r(null);
|
|
26
27
|
t(() => {
|
|
27
28
|
let e = !1;
|
|
28
|
-
return
|
|
29
|
-
query:
|
|
29
|
+
return m.query({
|
|
30
|
+
query: u,
|
|
30
31
|
variables: {
|
|
31
|
-
context: { workspaceId:
|
|
32
|
-
limit:
|
|
32
|
+
context: { workspaceId: d },
|
|
33
|
+
limit: f
|
|
33
34
|
},
|
|
34
35
|
fetchPolicy: "network-only"
|
|
35
36
|
}).then((t) => {
|
|
36
|
-
e ||
|
|
37
|
+
e || g((t.data?.getRecentSandboxActivity?.items ?? []).filter((e) => e.sandboxId === i));
|
|
37
38
|
}).catch((t) => {
|
|
38
|
-
e ||
|
|
39
|
+
e || v(t instanceof Error ? t.message : String(t));
|
|
39
40
|
}), () => {
|
|
40
41
|
e = !0;
|
|
41
42
|
};
|
|
42
43
|
}, [
|
|
43
|
-
|
|
44
|
+
m,
|
|
44
45
|
i,
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
d,
|
|
47
|
+
f
|
|
47
48
|
]);
|
|
48
|
-
let
|
|
49
|
-
return
|
|
49
|
+
let y = n(() => h?.slice().sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()) ?? null, [h]);
|
|
50
|
+
return _ ? /* @__PURE__ */ s("p", {
|
|
50
51
|
className: "text-sm text-status-error-text",
|
|
51
|
-
children: e(
|
|
52
|
-
}) :
|
|
52
|
+
children: e(p, "sandbox.activity.loadFailed", "Couldn't load activity.")
|
|
53
|
+
}) : y == null ? /* @__PURE__ */ s("p", {
|
|
53
54
|
className: "text-sm text-text-secondary",
|
|
54
55
|
children: "…"
|
|
55
|
-
}) :
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
}) : y.length === 0 ? /* @__PURE__ */ s(l, {
|
|
57
|
+
illustration: "empty-notifications",
|
|
58
|
+
className: "py-6",
|
|
59
|
+
title: e(p, "sandbox.activity.empty", "No activity yet."),
|
|
60
|
+
description: e(p, "sandbox.activity.emptyDescription", "Actions on this sandbox — starts, stops, TTL extensions and script runs — will show up here as they happen.")
|
|
58
61
|
}) : /* @__PURE__ */ s("ul", {
|
|
59
62
|
className: "divide-y divide-border-subtle",
|
|
60
|
-
children:
|
|
63
|
+
children: y.map((t) => /* @__PURE__ */ c("li", {
|
|
61
64
|
className: "py-3",
|
|
62
65
|
children: [/* @__PURE__ */ s("div", {
|
|
63
66
|
className: "text-sm font-medium text-text-primary",
|
|
@@ -65,17 +68,17 @@ function u({ sandboxId: i, workspaceId: u, pageSize: d = 50 }) {
|
|
|
65
68
|
}), /* @__PURE__ */ c("div", {
|
|
66
69
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
67
70
|
children: [
|
|
68
|
-
e(
|
|
71
|
+
e(p, "sandbox.activity.actor", `by ${t.actorId}`, { actor: t.actorId }),
|
|
69
72
|
" ",
|
|
70
73
|
"·",
|
|
71
74
|
" ",
|
|
72
|
-
e(
|
|
75
|
+
e(p, "sandbox.activity.atTime", `at ${new Date(t.createdAt).toLocaleString()}`, { time: new Date(t.createdAt).toLocaleString() })
|
|
73
76
|
]
|
|
74
77
|
})]
|
|
75
78
|
}, t.id))
|
|
76
79
|
});
|
|
77
80
|
}
|
|
78
81
|
//#endregion
|
|
79
|
-
export {
|
|
82
|
+
export { d as SandboxActivityTab };
|
|
80
83
|
|
|
81
84
|
//# sourceMappingURL=SandboxActivityTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxActivityTab.js","names":[],"sources":["../../../src/sandbox/components/SandboxActivityTab.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\nconst RECENT_ACTIVITY = gql`\n query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {\n getRecentSandboxActivity(context: $context, limit: $limit) {\n items {\n id\n action\n sandboxName\n sandboxId\n actorId\n status\n createdAt\n }\n total\n }\n }\n`;\n\ninterface ActivityItem {\n id: string;\n action: string;\n sandboxName: string;\n sandboxId?: string | null;\n actorId: string;\n status: string;\n createdAt: string;\n}\n\ninterface Props {\n sandboxId: string;\n workspaceId: string;\n pageSize?: number;\n}\n\n/**\n * Activity / audit feed scoped to a single sandbox. Reuses the existing\n * `getRecentSandboxActivity` admin query and filters client-side by sandboxId\n * so no new backend query is needed for the v0.3.0 cycle. Server-side scoping\n * will move to a dedicated `getSandboxAuditLog(sandboxId)` query in a follow-up.\n */\nexport function SandboxActivityTab({ sandboxId, workspaceId, pageSize = 50 }: Props) {\n const { t } = useI18n();\n const client = useApolloClient();\n const [items, setItems] = useState<ActivityItem[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n client\n .query<{ getRecentSandboxActivity: { items: ActivityItem[] } }>({\n query: RECENT_ACTIVITY,\n variables: { context: { workspaceId }, limit: pageSize },\n fetchPolicy: 'network-only',\n })\n .then((res: { data?: { getRecentSandboxActivity?: { items?: ActivityItem[] } } }) => {\n if (cancelled) return;\n const all: ActivityItem[] = res.data?.getRecentSandboxActivity?.items ?? [];\n setItems(all.filter((entry: ActivityItem) => entry.sandboxId === sandboxId));\n })\n .catch((err: unknown) => {\n if (cancelled) return;\n setError(err instanceof Error ? err.message : String(err));\n });\n return () => {\n cancelled = true;\n };\n }, [client, sandboxId, workspaceId, pageSize]);\n\n const sorted = useMemo(\n () =>\n items\n ?.slice()\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) ?? null,\n [items]\n );\n\n if (error) {\n return (\n <p className=\"text-sm text-status-error-text\">\n {tWithFallback(t, 'sandbox.activity.loadFailed', \"Couldn't load activity.\")}\n </p>\n );\n }\n if (sorted == null) {\n return <p className=\"text-sm text-text-secondary\">…</p>;\n }\n if (sorted.length === 0) {\n return (\n <
|
|
1
|
+
{"version":3,"file":"SandboxActivityTab.js","names":[],"sources":["../../../src/sandbox/components/SandboxActivityTab.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { tWithFallback } from '../utils/i18n';\n\nconst RECENT_ACTIVITY = gql`\n query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {\n getRecentSandboxActivity(context: $context, limit: $limit) {\n items {\n id\n action\n sandboxName\n sandboxId\n actorId\n status\n createdAt\n }\n total\n }\n }\n`;\n\ninterface ActivityItem {\n id: string;\n action: string;\n sandboxName: string;\n sandboxId?: string | null;\n actorId: string;\n status: string;\n createdAt: string;\n}\n\ninterface Props {\n sandboxId: string;\n workspaceId: string;\n pageSize?: number;\n}\n\n/**\n * Activity / audit feed scoped to a single sandbox. Reuses the existing\n * `getRecentSandboxActivity` admin query and filters client-side by sandboxId\n * so no new backend query is needed for the v0.3.0 cycle. Server-side scoping\n * will move to a dedicated `getSandboxAuditLog(sandboxId)` query in a follow-up.\n */\nexport function SandboxActivityTab({ sandboxId, workspaceId, pageSize = 50 }: Props) {\n const { t } = useI18n();\n const client = useApolloClient();\n const [items, setItems] = useState<ActivityItem[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n client\n .query<{ getRecentSandboxActivity: { items: ActivityItem[] } }>({\n query: RECENT_ACTIVITY,\n variables: { context: { workspaceId }, limit: pageSize },\n fetchPolicy: 'network-only',\n })\n .then((res: { data?: { getRecentSandboxActivity?: { items?: ActivityItem[] } } }) => {\n if (cancelled) return;\n const all: ActivityItem[] = res.data?.getRecentSandboxActivity?.items ?? [];\n setItems(all.filter((entry: ActivityItem) => entry.sandboxId === sandboxId));\n })\n .catch((err: unknown) => {\n if (cancelled) return;\n setError(err instanceof Error ? err.message : String(err));\n });\n return () => {\n cancelled = true;\n };\n }, [client, sandboxId, workspaceId, pageSize]);\n\n const sorted = useMemo(\n () =>\n items\n ?.slice()\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) ?? null,\n [items]\n );\n\n if (error) {\n return (\n <p className=\"text-sm text-status-error-text\">\n {tWithFallback(t, 'sandbox.activity.loadFailed', \"Couldn't load activity.\")}\n </p>\n );\n }\n if (sorted == null) {\n return <p className=\"text-sm text-text-secondary\">…</p>;\n }\n if (sorted.length === 0) {\n return (\n <IllustratedEmptyState\n illustration=\"empty-notifications\"\n className=\"py-6\"\n title={tWithFallback(t, 'sandbox.activity.empty', 'No activity yet.')}\n description={tWithFallback(\n t,\n 'sandbox.activity.emptyDescription',\n 'Actions on this sandbox — starts, stops, TTL extensions and script runs — will show up here as they happen.'\n )}\n />\n );\n }\n\n return (\n <ul className=\"divide-y divide-border-subtle\">\n {sorted.map((entry) => (\n <li key={entry.id} className=\"py-3\">\n <div className=\"text-sm font-medium text-text-primary\">{entry.action}</div>\n <div className=\"mt-0.5 text-xs text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.actor', `by ${entry.actorId}`, {\n actor: entry.actorId,\n })}{' '}\n ·{' '}\n {tWithFallback(\n t,\n 'sandbox.activity.atTime',\n `at ${new Date(entry.createdAt).toLocaleString()}`,\n {\n time: new Date(entry.createdAt).toLocaleString(),\n }\n )}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;AAOA,IAAM,IAAkB,CAAG;;;;;;;;;;;;;;;;AAuC3B,SAAgB,EAAmB,EAAE,cAAW,gBAAa,cAAW,MAAa;CACnF,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,GAAiB,EAC1B,CAAC,GAAO,KAAY,EAAgC,KAAK,EACzD,CAAC,GAAO,KAAY,EAAwB,KA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