@burdenoff/microfe-sandbox 2026.510.113
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/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +21253 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +1595 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +692 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +55214 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/sandbox/AdminRoutes.d.ts +12 -0
- package/dist/sandbox/AdminRoutes.d.ts.map +1 -0
- package/dist/sandbox/AdminRoutes.js +45 -0
- package/dist/sandbox/AdminRoutes.js.map +1 -0
- package/dist/sandbox/SandboxAdminRoot.d.ts +21 -0
- package/dist/sandbox/SandboxAdminRoot.d.ts.map +1 -0
- package/dist/sandbox/SandboxAdminRoot.js +55 -0
- package/dist/sandbox/SandboxAdminRoot.js.map +1 -0
- package/dist/sandbox/SandboxRoot.d.ts +31 -0
- package/dist/sandbox/SandboxRoot.d.ts.map +1 -0
- package/dist/sandbox/SandboxRoot.js +61 -0
- package/dist/sandbox/SandboxRoot.js.map +1 -0
- package/dist/sandbox/SandboxRoutes.d.ts +18 -0
- package/dist/sandbox/SandboxRoutes.d.ts.map +1 -0
- package/dist/sandbox/UserRoutes.d.ts +11 -0
- package/dist/sandbox/UserRoutes.d.ts.map +1 -0
- package/dist/sandbox/UserRoutes.js +57 -0
- package/dist/sandbox/UserRoutes.js.map +1 -0
- package/dist/sandbox/components/ContainerImagePicker.d.ts +24 -0
- package/dist/sandbox/components/ContainerImagePicker.d.ts.map +1 -0
- package/dist/sandbox/components/CountdownTimer.d.ts +9 -0
- package/dist/sandbox/components/CountdownTimer.d.ts.map +1 -0
- package/dist/sandbox/components/CountdownTimer.js +75 -0
- package/dist/sandbox/components/CountdownTimer.js.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.d.ts +8 -0
- package/dist/sandbox/components/ExportSandboxesDialog.d.ts.map +1 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js +130 -0
- package/dist/sandbox/components/ExportSandboxesDialog.js.map +1 -0
- package/dist/sandbox/components/ExtendTTLModal.d.ts +10 -0
- package/dist/sandbox/components/ExtendTTLModal.d.ts.map +1 -0
- package/dist/sandbox/components/ExtendTTLModal.js +109 -0
- package/dist/sandbox/components/ExtendTTLModal.js.map +1 -0
- package/dist/sandbox/components/PageLayout.d.ts +39 -0
- package/dist/sandbox/components/PageLayout.d.ts.map +1 -0
- package/dist/sandbox/components/PageLayout.js +75 -0
- package/dist/sandbox/components/PageLayout.js.map +1 -0
- package/dist/sandbox/components/ResourceDisplay.d.ts +17 -0
- package/dist/sandbox/components/ResourceDisplay.d.ts.map +1 -0
- package/dist/sandbox/components/ResourceDisplay.js +69 -0
- package/dist/sandbox/components/ResourceDisplay.js.map +1 -0
- package/dist/sandbox/components/RouteUtils.d.ts +28 -0
- package/dist/sandbox/components/RouteUtils.d.ts.map +1 -0
- package/dist/sandbox/components/RouteUtils.js +68 -0
- package/dist/sandbox/components/RouteUtils.js.map +1 -0
- package/dist/sandbox/components/SandboxActivityTab.d.ts +14 -0
- package/dist/sandbox/components/SandboxActivityTab.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxActivityTab.js +83 -0
- package/dist/sandbox/components/SandboxActivityTab.js.map +1 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts +16 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.js +103 -0
- package/dist/sandbox/components/SandboxAgentAppPanel.js.map +1 -0
- package/dist/sandbox/components/SandboxTypeIcon.d.ts +15 -0
- package/dist/sandbox/components/SandboxTypeIcon.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxTypeIcon.js +52 -0
- package/dist/sandbox/components/SandboxTypeIcon.js.map +1 -0
- package/dist/sandbox/components/SandboxTypeSelector.d.ts +35 -0
- package/dist/sandbox/components/SandboxTypeSelector.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxUsageBanner.d.ts +16 -0
- package/dist/sandbox/components/SandboxUsageBanner.d.ts.map +1 -0
- package/dist/sandbox/components/SandboxUsageBanner.js +37 -0
- package/dist/sandbox/components/SandboxUsageBanner.js.map +1 -0
- package/dist/sandbox/components/StatusBadge.d.ts +15 -0
- package/dist/sandbox/components/StatusBadge.d.ts.map +1 -0
- package/dist/sandbox/components/StatusBadge.js +86 -0
- package/dist/sandbox/components/StatusBadge.js.map +1 -0
- package/dist/sandbox/components/TagsInput.d.ts +14 -0
- package/dist/sandbox/components/TagsInput.d.ts.map +1 -0
- package/dist/sandbox/components/TagsInput.js +46 -0
- package/dist/sandbox/components/TagsInput.js.map +1 -0
- package/dist/sandbox/components/ui.d.ts +6 -0
- package/dist/sandbox/components/ui.d.ts.map +1 -0
- package/dist/sandbox/components/ui.js +2 -0
- package/dist/sandbox/hooks/useRemainingSeconds.d.ts +12 -0
- package/dist/sandbox/hooks/useRemainingSeconds.d.ts.map +1 -0
- package/dist/sandbox/hooks/useRemainingSeconds.js +23 -0
- package/dist/sandbox/hooks/useRemainingSeconds.js.map +1 -0
- package/dist/sandbox/index.d.ts +30 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +4 -0
- package/dist/sandbox/pages/AdminLandingPage.d.ts +9 -0
- package/dist/sandbox/pages/AdminLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminLandingPage.js +40 -0
- package/dist/sandbox/pages/AdminLandingPage.js.map +1 -0
- package/dist/sandbox/pages/AdminPage.d.ts +2 -0
- package/dist/sandbox/pages/AdminPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminPage.js +448 -0
- package/dist/sandbox/pages/AdminPage.js.map +1 -0
- package/dist/sandbox/pages/AdminTemplatesPage.d.ts +7 -0
- package/dist/sandbox/pages/AdminTemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/AdminTemplatesPage.js +155 -0
- package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts +2 -0
- package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxCreatePage.js +1121 -0
- package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -0
- package/dist/sandbox/pages/SandboxDetailPage.d.ts +6 -0
- package/dist/sandbox/pages/SandboxDetailPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxDetailPage.js +822 -0
- package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -0
- package/dist/sandbox/pages/SandboxLandingPage.d.ts +12 -0
- package/dist/sandbox/pages/SandboxLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.d.ts +6 -0
- package/dist/sandbox/pages/SandboxListPage.d.ts.map +1 -0
- package/dist/sandbox/pages/SandboxListPage.js +820 -0
- package/dist/sandbox/pages/SandboxListPage.js.map +1 -0
- package/dist/sandbox/pages/TemplateDetailPage.d.ts +6 -0
- package/dist/sandbox/pages/TemplateDetailPage.d.ts.map +1 -0
- package/dist/sandbox/pages/TemplateDetailPage.js +691 -0
- package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -0
- package/dist/sandbox/pages/TemplatesPage.d.ts +8 -0
- package/dist/sandbox/pages/TemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserLandingPage.d.ts +9 -0
- package/dist/sandbox/pages/UserLandingPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserLandingPage.js +52 -0
- package/dist/sandbox/pages/UserLandingPage.js.map +1 -0
- package/dist/sandbox/pages/UserTemplatesPage.d.ts +8 -0
- package/dist/sandbox/pages/UserTemplatesPage.d.ts.map +1 -0
- package/dist/sandbox/pages/UserTemplatesPage.js +121 -0
- package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -0
- package/dist/sandbox/providers/SandboxProvider.d.ts +13 -0
- package/dist/sandbox/providers/SandboxProvider.d.ts.map +1 -0
- package/dist/sandbox/providers/SandboxProvider.js +78 -0
- package/dist/sandbox/providers/SandboxProvider.js.map +1 -0
- package/dist/sandbox/store/sandboxStore.d.ts +16 -0
- package/dist/sandbox/store/sandboxStore.d.ts.map +1 -0
- package/dist/sandbox/store/sandboxStore.js +24 -0
- package/dist/sandbox/store/sandboxStore.js.map +1 -0
- package/dist/sandbox/types/index.d.ts +238 -0
- package/dist/sandbox/types/index.d.ts.map +1 -0
- package/dist/sandbox/utils/cn.d.ts +8 -0
- package/dist/sandbox/utils/cn.d.ts.map +1 -0
- package/dist/sandbox/utils/cn.js +10 -0
- package/dist/sandbox/utils/cn.js.map +1 -0
- package/dist/sandbox/utils/formatters.d.ts +7 -0
- package/dist/sandbox/utils/formatters.d.ts.map +1 -0
- package/dist/sandbox/utils/formatters.js +10 -0
- package/dist/sandbox/utils/formatters.js.map +1 -0
- package/dist/sandbox/utils/i18n.d.ts +6 -0
- package/dist/sandbox/utils/i18n.d.ts.map +1 -0
- package/dist/sandbox/utils/i18n.js +15 -0
- package/dist/sandbox/utils/i18n.js.map +1 -0
- package/dist/sandbox/utils/navigation.d.ts +5 -0
- package/dist/sandbox/utils/navigation.d.ts.map +1 -0
- package/dist/sandbox/utils/navigation.js +8 -0
- package/dist/sandbox/utils/navigation.js.map +1 -0
- package/dist/sandbox/utils/sandboxEvents.d.ts +13 -0
- package/dist/sandbox/utils/sandboxEvents.d.ts.map +1 -0
- package/dist/sandbox/utils/sandboxEvents.js +20 -0
- package/dist/sandbox/utils/sandboxEvents.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +107 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateDetailPage.js","names":[],"sources":["../../../src/sandbox/pages/TemplateDetailPage.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Save,\n Loader2,\n AlertCircle,\n CheckCircle2,\n X,\n LayoutTemplate,\n Cpu,\n MemoryStick,\n Timer,\n Info,\n Container,\n Database,\n Plus,\n Trash2,\n Image,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button, Card, CardContent, Badge } from '../components/ui';\nimport { useSandbox } from '../providers/SandboxProvider';\nimport { joinPath } from '../utils/navigation';\nimport { tWithFallback } from '../utils/i18n';\nimport { PageLayout } from '../components/PageLayout';\nimport {\n useGetSandboxTemplateQuery,\n useCreateSandboxTemplateMutation,\n useUpdateSandboxTemplateMutation,\n} from '../../generated/wspace-operations';\nimport type { SandboxTemplateType, EnvVar } from '../types';\n\ntype NotificationType = 'success' | 'error';\ntype StorageMode = 'NONE' | 'EPHEMERAL' | 'PERSISTENT';\n\ninterface ContainerFormData {\n name: string;\n image: string;\n ports: { containerPort: number; name: string }[];\n env: EnvVar[];\n requestsCpu: string;\n requestsMemory: string;\n limitsCpu: string;\n limitsMemory: string;\n}\n\ninterface TemplateFormData {\n name: string;\n description: string;\n template: SandboxTemplateType;\n isDefault: boolean;\n cpuRequest: string;\n cpuLimit: string;\n memoryRequest: string;\n memoryLimit: string;\n ttlSeconds: number;\n containers: ContainerFormData[];\n storageMode: StorageMode;\n storageSizeGi: number;\n storageMountPath: string;\n storageRetainOnDelete: boolean;\n allowedImages: string[];\n}\n\nconst emptyContainer: ContainerFormData = {\n name: '',\n image: '',\n ports: [],\n env: [],\n requestsCpu: '',\n requestsMemory: '',\n limitsCpu: '',\n limitsMemory: '',\n};\n\n/**\n * Template Detail Page\n * Create or edit a sandbox template\n */\nexport function TemplateDetailPage() {\n const { templateId } = useParams<{ templateId: string }>();\n const { basePath = '/', navigate, workspaceId } = useSandbox();\n const { t } = useI18n();\n const isEdit = !!templateId && templateId !== 'new';\n\n const [createTemplate] = useCreateSandboxTemplateMutation();\n const [updateTemplate] = useUpdateSandboxTemplateMutation();\n\n const { data: templateData } = useGetSandboxTemplateQuery({\n variables: { context: { workspaceId }, id: templateId! },\n skip: !isEdit || !templateId || !workspaceId,\n });\n\n const [formData, setFormData] = useState<TemplateFormData>({\n name: '',\n description: '',\n template: 'AI_BUILDER',\n isDefault: false,\n cpuRequest: '500m',\n cpuLimit: '2',\n memoryRequest: '1Gi',\n memoryLimit: '4Gi',\n ttlSeconds: 14400,\n containers: [{ ...emptyContainer, name: 'main' }],\n storageMode: 'NONE',\n storageSizeGi: 10,\n storageMountPath: '/data',\n storageRetainOnDelete: false,\n allowedImages: [],\n });\n\n // Populate form when template data loads for editing\n useEffect(() => {\n const tpl = templateData?.getSandboxTemplate;\n if (tpl) {\n setFormData({\n name: tpl.name ?? '',\n description: tpl.description ?? '',\n template: (tpl.template as SandboxTemplateType) ?? 'AI_BUILDER',\n isDefault: tpl.isDefault ?? false,\n cpuRequest: tpl.resources?.cpuRequest ?? '500m',\n cpuLimit: tpl.resources?.cpuLimit ?? '2',\n memoryRequest: tpl.resources?.memoryRequest ?? '1Gi',\n memoryLimit: tpl.resources?.memoryLimit ?? '4Gi',\n ttlSeconds: tpl.ttlSeconds ?? 14400,\n containers:\n tpl.containers && tpl.containers.length > 0\n ? tpl.containers.map((c: any) => ({\n name: c.name ?? '',\n image: c.image ?? '',\n ports:\n c.ports?.map((p: any) => ({\n containerPort: p.containerPort,\n name: p.name ?? '',\n })) ?? [],\n env: c.env ?? [],\n requestsCpu: c.resources?.requestsCpu ?? '',\n requestsMemory: c.resources?.requestsMemory ?? '',\n limitsCpu: c.resources?.limitsCpu ?? '',\n limitsMemory: c.resources?.limitsMemory ?? '',\n }))\n : [{ ...emptyContainer, name: 'main' }],\n storageMode: tpl.storage?.mode ?? 'NONE',\n storageSizeGi: tpl.storage?.sizeGi ?? 10,\n storageMountPath: tpl.storage?.mountPath ?? '/data',\n storageRetainOnDelete: tpl.storage?.retainOnDelete ?? false,\n allowedImages: tpl.allowedImages ?? [],\n });\n }\n }, [templateData]);\n\n const [errors, setErrors] = useState<Record<string, string>>({});\n const [notification, setNotification] = useState<{\n type: NotificationType;\n message: string;\n } | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const showNotification = (type: NotificationType, message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n const handleInputChange = (field: keyof TemplateFormData, value: string | number | boolean) => {\n setFormData((prev) => ({ ...prev, [field]: value }));\n if (typeof value === 'string' && errors[field as string]) {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[field as string];\n return next;\n });\n }\n };\n\n // Container management\n const addContainer = () => {\n setFormData((prev) => ({\n ...prev,\n containers: [...prev.containers, { ...emptyContainer }],\n }));\n };\n\n const removeContainer = (index: number) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.filter((_, i) => i !== index),\n }));\n };\n\n const updateContainer = (index: number, field: keyof ContainerFormData, value: any) => {\n setFormData((prev) => ({\n ...prev,\n containers: prev.containers.map((c, i) => (i === index ? { ...c, [field]: value } : c)),\n }));\n };\n\n // Allowed images management\n const addAllowedImage = () => {\n setFormData((prev) => ({\n ...prev,\n allowedImages: [...prev.allowedImages, ''],\n }));\n };\n\n const removeAllowedImage = (index: number) => {\n setFormData((prev) => ({\n ...prev,\n allowedImages: prev.allowedImages.filter((_, i) => i !== index),\n }));\n };\n\n const updateAllowedImage = (index: number, value: string) => {\n setFormData((prev) => ({\n ...prev,\n allowedImages: prev.allowedImages.map((img, i) => (i === index ? value : img)),\n }));\n };\n\n const validateForm = (): boolean => {\n const newErrors: Record<string, string> = {};\n if (!formData.name.trim())\n newErrors.name = tWithFallback(t, 'sandbox.template.errors.nameRequired', 'Name is required');\n if (!formData.cpuRequest.trim())\n newErrors.cpuRequest = tWithFallback(\n t,\n 'sandbox.template.errors.cpuRequestRequired',\n 'CPU request is required'\n );\n if (!formData.cpuLimit.trim())\n newErrors.cpuLimit = tWithFallback(\n t,\n 'sandbox.template.errors.cpuLimitRequired',\n 'CPU limit is required'\n );\n if (!formData.memoryRequest.trim())\n newErrors.memoryRequest = tWithFallback(\n t,\n 'sandbox.template.errors.memoryRequestRequired',\n 'Memory request is required'\n );\n if (!formData.memoryLimit.trim())\n newErrors.memoryLimit = tWithFallback(\n t,\n 'sandbox.template.errors.memoryLimitRequired',\n 'Memory limit is required'\n );\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n if (!validateForm()) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.template.errors.fixFormErrors', 'Please fix the form errors')\n );\n return;\n }\n setSubmitting(true);\n try {\n const containers = formData.containers\n .filter((c) => c.name.trim() && c.image.trim())\n .map((c) => ({\n name: c.name,\n image: c.image,\n ports: c.ports.length > 0 ? c.ports : undefined,\n env: c.env.length > 0 ? c.env.filter((e) => e.name.trim()) : undefined,\n resources:\n c.requestsCpu || c.requestsMemory || c.limitsCpu || c.limitsMemory\n ? {\n requestsCpu: c.requestsCpu || undefined,\n requestsMemory: c.requestsMemory || undefined,\n limitsCpu: c.limitsCpu || undefined,\n limitsMemory: c.limitsMemory || undefined,\n }\n : undefined,\n }));\n\n const payload = {\n context: { workspaceId },\n name: formData.name,\n description: formData.description || undefined,\n template: formData.template as any,\n isDefault: formData.isDefault,\n containers,\n resources: {\n cpuRequest: formData.cpuRequest,\n cpuLimit: formData.cpuLimit,\n memoryRequest: formData.memoryRequest,\n memoryLimit: formData.memoryLimit,\n },\n storage: {\n mode: formData.storageMode,\n sizeGi: formData.storageMode !== 'NONE' ? formData.storageSizeGi : undefined,\n mountPath: formData.storageMode !== 'NONE' ? formData.storageMountPath : undefined,\n retainOnDelete:\n formData.storageMode === 'PERSISTENT' ? formData.storageRetainOnDelete : false,\n },\n allowedImages: formData.allowedImages.filter((img) => img.trim()),\n ttlSeconds: formData.ttlSeconds,\n };\n\n if (isEdit) {\n await updateTemplate({\n variables: { input: { id: templateId!, ...payload } },\n });\n } else {\n await createTemplate({\n variables: { input: payload },\n });\n }\n showNotification(\n 'success',\n isEdit\n ? tWithFallback(t, 'sandbox.template.success.updated', 'Template updated!')\n : tWithFallback(t, 'sandbox.template.success.created', 'Template created!')\n );\n setTimeout(() => navigate?.(joinPath(basePath, 'templates')), 1500);\n } catch (err) {\n showNotification(\n 'error',\n tWithFallback(t, 'sandbox.template.errors.saveFailed', 'Failed to save template')\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n const formatTTL = (seconds: number): string => {\n const hours = Math.floor(seconds / 3600);\n const minutes = Math.floor((seconds % 3600) / 60);\n if (hours > 0 && minutes > 0) return `${hours}h ${minutes}m`;\n if (hours > 0) return `${hours}h`;\n return `${minutes}m`;\n };\n\n return (\n <PageLayout showHeader={false}>\n {/* Notification */}\n {notification && (\n <div\n className={`fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n }`}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <AlertCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n <button\n onClick={() => setNotification(null)}\n className=\"ml-2 p-1 rounded-md hover:bg-accent\"\n >\n <X size={16} />\n </button>\n </div>\n )}\n\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n onClick={() => navigate?.(joinPath(basePath, 'templates'))}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all duration-200 hover:scale-110\"\n aria-label={tWithFallback(\n t,\n 'sandbox.template.actions.backToTemplates',\n 'Back to templates'\n )}\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-primary/10\">\n <LayoutTemplate size={24} className=\"text-primary\" />\n </div>\n <h1 className=\"text-2xl sm:text-3xl font-bold\">\n {isEdit\n ? tWithFallback(t, 'sandbox.template.title.edit', 'Edit Template')\n : tWithFallback(t, 'sandbox.template.title.create', 'Create Template')}\n </h1>\n </div>\n </div>\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-6\">\n {/* Basic Info */}\n <Card>\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Info size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.template.sections.info', 'Template Information')}\n </h2>\n\n <div>\n <label htmlFor=\"name\" className=\"block text-sm font-semibold mb-2\">\n Name <span className=\"text-destructive\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"name\"\n value={formData.name}\n onChange={(e) => handleInputChange('name', e.target.value)}\n className={`w-full px-4 py-2.5 border-2 rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.name ? 'border-destructive' : 'border-border focus:border-primary'\n }`}\n placeholder=\"AI Builder - Standard\"\n />\n {errors.name && (\n <p className=\"text-sm text-destructive mt-1 flex items-center gap-1\">\n <AlertCircle size={14} />\n {errors.name}\n </p>\n )}\n </div>\n\n <div>\n <label htmlFor=\"description\" className=\"block text-sm font-semibold mb-2\">\n Description\n </label>\n <textarea\n id=\"description\"\n value={formData.description}\n onChange={(e) => handleInputChange('description', e.target.value)}\n rows={3}\n className=\"w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"Template description...\"\n />\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n <div>\n <label htmlFor=\"template\" className=\"block text-sm font-semibold mb-2\">\n Template Type\n </label>\n <select\n id=\"template\"\n value={formData.template}\n onChange={(e) => handleInputChange('template', e.target.value)}\n className=\"w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n >\n <option value=\"AI_BUILDER\">AI Builder</option>\n <option value=\"WORKFLOW_MULTI_NODE\">Workflow Multi-Node</option>\n <option value=\"MISC_SHELL\">Misc Shell</option>\n <option value=\"CUSTOM\">Custom</option>\n </select>\n </div>\n\n <div className=\"flex items-center gap-3 pt-7\">\n <input\n type=\"checkbox\"\n id=\"isDefault\"\n checked={formData.isDefault}\n onChange={(e) => handleInputChange('isDefault', e.target.checked)}\n className=\"w-4 h-4 rounded border-border text-primary focus:ring-primary/20\"\n />\n <label htmlFor=\"isDefault\" className=\"text-sm font-medium\">\n Set as default template for this type\n </label>\n </div>\n </div>\n </CardContent>\n </Card>\n\n {/* Containers */}\n <Card>\n <CardContent className=\"p-6 space-y-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Container size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.template.sections.containers', 'Default Containers')}\n <Badge variant=\"secondary\">{formData.containers.length}</Badge>\n </h2>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={addContainer}>\n <Plus size={14} />\n Add Container\n </Button>\n </div>\n\n <div className=\"space-y-4\">\n {formData.containers.map((container, cIdx) => (\n <div\n key={cIdx}\n className=\"p-4 rounded-lg border-2 border-border/50 bg-muted/20 space-y-3\"\n >\n <div className=\"flex items-center justify-between\">\n <h3 className=\"font-semibold text-sm\">\n Container #{cIdx + 1}\n {container.name && `: ${container.name}`}\n </h3>\n {formData.containers.length > 1 && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"text-destructive hover:text-destructive h-7 w-7\"\n onClick={() => removeContainer(cIdx)}\n >\n <Trash2 size={14} />\n </Button>\n )}\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-3\">\n <div>\n <label className=\"block text-xs font-semibold mb-1\">Name</label>\n <input\n type=\"text\"\n value={container.name}\n onChange={(e) => updateContainer(cIdx, 'name', e.target.value)}\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"main\"\n />\n </div>\n <div>\n <label className=\"block text-xs font-semibold mb-1\">Image</label>\n <input\n type=\"text\"\n value={container.image}\n onChange={(e) => updateContainer(cIdx, 'image', e.target.value)}\n className=\"w-full px-3 py-2 border-2 border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"harbor-internal.burdenoff.com/sandbox/python:3.12\"\n />\n </div>\n </div>\n\n {/* Per-container resources */}\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-3\">\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">CPU Req</label>\n <input\n type=\"text\"\n value={container.requestsCpu}\n onChange={(e) => updateContainer(cIdx, 'requestsCpu', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"250m\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">CPU Lim</label>\n <input\n type=\"text\"\n value={container.limitsCpu}\n onChange={(e) => updateContainer(cIdx, 'limitsCpu', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"1\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">Mem Req</label>\n <input\n type=\"text\"\n value={container.requestsMemory}\n onChange={(e) => updateContainer(cIdx, 'requestsMemory', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"512Mi\"\n />\n </div>\n <div>\n <label className=\"block text-xs text-muted-foreground mb-1\">Mem Lim</label>\n <input\n type=\"text\"\n value={container.limitsMemory}\n onChange={(e) => updateContainer(cIdx, 'limitsMemory', e.target.value)}\n className=\"w-full px-3 py-1.5 border rounded-lg bg-background text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"2Gi\"\n />\n </div>\n </div>\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n\n {/* Resources */}\n <Card>\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Cpu size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.template.sections.resources', 'Default Pod Resources')}\n </h2>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n <div>\n <label\n htmlFor=\"cpuRequest\"\n className=\"text-sm font-semibold flex items-center gap-2\"\n >\n <Cpu size={14} className=\"text-status-info-text\" /> CPU Request\n </label>\n <input\n type=\"text\"\n id=\"cpuRequest\"\n value={formData.cpuRequest}\n onChange={(e) => handleInputChange('cpuRequest', e.target.value)}\n className={`w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.cpuRequest ? 'border-destructive' : 'border-border focus:border-primary'\n }`}\n placeholder=\"500m\"\n />\n </div>\n <div>\n <label htmlFor=\"cpuLimit\" className=\"text-sm font-semibold flex items-center gap-2\">\n <Cpu size={14} className=\"text-status-info-text\" /> CPU Limit\n </label>\n <input\n type=\"text\"\n id=\"cpuLimit\"\n value={formData.cpuLimit}\n onChange={(e) => handleInputChange('cpuLimit', e.target.value)}\n className={`w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.cpuLimit ? 'border-destructive' : 'border-border focus:border-primary'\n }`}\n placeholder=\"2\"\n />\n </div>\n <div>\n <label\n htmlFor=\"memoryRequest\"\n className=\"text-sm font-semibold flex items-center gap-2\"\n >\n <MemoryStick size={14} className=\"text-accent-purple-subtle\" /> Memory Request\n </label>\n <input\n type=\"text\"\n id=\"memoryRequest\"\n value={formData.memoryRequest}\n onChange={(e) => handleInputChange('memoryRequest', e.target.value)}\n className={`w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.memoryRequest\n ? 'border-destructive'\n : 'border-border focus:border-primary'\n }`}\n placeholder=\"1Gi\"\n />\n </div>\n <div>\n <label\n htmlFor=\"memoryLimit\"\n className=\"text-sm font-semibold flex items-center gap-2\"\n >\n <MemoryStick size={14} className=\"text-accent-purple-subtle\" /> Memory Limit\n </label>\n <input\n type=\"text\"\n id=\"memoryLimit\"\n value={formData.memoryLimit}\n onChange={(e) => handleInputChange('memoryLimit', e.target.value)}\n className={`w-full px-4 py-2.5 mt-2 border-2 rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 transition-all ${\n errors.memoryLimit ? 'border-destructive' : 'border-border focus:border-primary'\n }`}\n placeholder=\"4Gi\"\n />\n </div>\n </div>\n\n {/* TTL */}\n <div>\n <label htmlFor=\"ttlSeconds\" className=\"text-sm font-semibold flex items-center gap-2\">\n <Timer size={14} className=\"text-status-info-text\" /> Default TTL\n <Badge variant=\"outline\" className=\"text-xs ml-auto\">\n {formatTTL(formData.ttlSeconds)}\n </Badge>\n </label>\n <input\n type=\"range\"\n id=\"ttlSeconds\"\n min={600}\n max={86400}\n step={600}\n value={formData.ttlSeconds}\n onChange={(e) => handleInputChange('ttlSeconds', Number(e.target.value))}\n className=\"w-full mt-2 accent-primary\"\n />\n </div>\n </CardContent>\n </Card>\n\n {/* Storage */}\n <Card>\n <CardContent className=\"p-6 space-y-5\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Database size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.template.sections.storage', 'Default Storage')}\n </h2>\n\n <div>\n <label className=\"block text-sm font-semibold mb-3\">Mode</label>\n <div className=\"grid grid-cols-3 gap-3\">\n {(['NONE', 'EPHEMERAL', 'PERSISTENT'] as StorageMode[]).map((mode) => {\n const isSelected = formData.storageMode === mode;\n const labels: Record<StorageMode, string> = {\n NONE: 'None',\n EPHEMERAL: 'Ephemeral',\n PERSISTENT: 'Persistent',\n };\n return (\n <button\n key={mode}\n type=\"button\"\n onClick={() => handleInputChange('storageMode', mode)}\n className={`p-3 rounded-lg border-2 text-left transition-all duration-200 ${\n isSelected\n ? 'border-primary bg-primary/5 shadow-sm'\n : 'border-border hover:border-primary/50 hover:bg-muted/50'\n }`}\n >\n <p className=\"font-medium text-sm\">{labels[mode]}</p>\n </button>\n );\n })}\n </div>\n </div>\n\n {formData.storageMode !== 'NONE' && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-5\">\n <div>\n <label className=\"block text-sm font-semibold mb-2\">Size (GiB)</label>\n <input\n type=\"number\"\n value={formData.storageSizeGi}\n onChange={(e) => handleInputChange('storageSizeGi', Number(e.target.value))}\n min={1}\n max={200}\n className=\"w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-semibold mb-2\">Mount Path</label>\n <input\n type=\"text\"\n value={formData.storageMountPath}\n onChange={(e) => handleInputChange('storageMountPath', e.target.value)}\n className=\"w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"/data\"\n />\n </div>\n {formData.storageMode === 'PERSISTENT' && (\n <div className=\"flex items-center gap-3 sm:col-span-2\">\n <input\n type=\"checkbox\"\n id=\"storageRetainOnDelete\"\n checked={formData.storageRetainOnDelete}\n onChange={(e) => handleInputChange('storageRetainOnDelete', e.target.checked)}\n className=\"w-4 h-4 rounded border-border text-primary focus:ring-primary/20\"\n />\n <label htmlFor=\"storageRetainOnDelete\" className=\"text-sm font-medium\">\n Retain volume data when sandbox is deleted\n </label>\n </div>\n )}\n </div>\n )}\n </CardContent>\n </Card>\n\n {/* Allowed Images */}\n <Card>\n <CardContent className=\"p-6 space-y-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-bold flex items-center gap-2\">\n <Image size={18} className=\"text-primary\" />\n {tWithFallback(t, 'sandbox.template.sections.allowedImages', 'Allowed Images')}\n {formData.allowedImages.length > 0 && (\n <Badge variant=\"secondary\">{formData.allowedImages.length}</Badge>\n )}\n </h2>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={addAllowedImage}>\n <Plus size={14} />\n Add Image\n </Button>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {tWithFallback(\n t,\n 'sandbox.template.allowedImages.hint',\n 'Restrict which container images can be used with this template. Leave empty to allow any image.'\n )}\n </p>\n {formData.allowedImages.map((img, idx) => (\n <div key={idx} className=\"flex items-center gap-2\">\n <input\n type=\"text\"\n value={img}\n onChange={(e) => updateAllowedImage(idx, e.target.value)}\n className=\"flex-1 px-4 py-2 border-2 border-border rounded-lg bg-background text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all\"\n placeholder=\"harbor-internal.burdenoff.com/sandbox/*\"\n />\n <button\n type=\"button\"\n onClick={() => removeAllowedImage(idx)}\n className=\"p-2 text-destructive hover:bg-destructive/10 rounded-lg\"\n >\n <Trash2 size={14} />\n </button>\n </div>\n ))}\n </CardContent>\n </Card>\n\n {/* Actions */}\n <div className=\"flex flex-col sm:flex-row gap-3 pt-2\">\n <Button type=\"submit\" disabled={submitting} size=\"lg\">\n {submitting ? <Loader2 size={18} className=\"animate-spin\" /> : <Save size={18} />}\n {isEdit\n ? tWithFallback(t, 'sandbox.template.actions.saveChanges', 'Save Changes')\n : tWithFallback(t, 'sandbox.template.actions.create', 'Create Template')}\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => navigate?.(joinPath(basePath, 'templates'))}\n disabled={submitting}\n >\n {tWithFallback(t, 'sandbox.template.actions.cancel', 'Cancel')}\n </Button>\n </div>\n </form>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAiEA,IAAM,IAAoC;CACxC,MAAM;CACN,OAAO;CACP,OAAO,EAAE;CACT,KAAK,EAAE;CACP,aAAa;CACb,gBAAgB;CAChB,WAAW;CACX,cAAc;CACf;AAMD,SAAgB,IAAqB;CACnC,IAAM,EAAE,kBAAe,GAAmC,EACpD,EAAE,cAAW,KAAK,aAAU,mBAAgB,GAAY,EACxD,EAAE,SAAM,GAAS,EACjB,IAAS,CAAC,CAAC,KAAc,MAAe,OAExC,CAAC,KAAkB,GAAkC,EACrD,CAAC,KAAkB,GAAkC,EAErD,EAAE,MAAM,MAAiB,EAA2B;EACxD,WAAW;GAAE,SAAS,EAAE,gBAAa;GAAE,IAAI;GAAa;EACxD,MAAM,CAAC,KAAU,CAAC,KAAc,CAAC;EAClC,CAAC,EAEI,CAAC,GAAU,KAAe,EAA2B;EACzD,MAAM;EACN,aAAa;EACb,UAAU;EACV,WAAW;EACX,YAAY;EACZ,UAAU;EACV,eAAe;EACf,aAAa;EACb,YAAY;EACZ,YAAY,CAAC;GAAE,GAAG;GAAgB,MAAM;GAAQ,CAAC;EACjD,aAAa;EACb,eAAe;EACf,kBAAkB;EAClB,uBAAuB;EACvB,eAAe,EAAE;EAClB,CAAC;AAGF,SAAgB;EACd,IAAM,IAAM,GAAc;AAC1B,EAAI,KACF,EAAY;GACV,MAAM,EAAI,QAAQ;GA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GAAD,EAAQ,MAAM,IAAM,CAAA;SACb,CAAA,CACL;UAfI,EAeJ,CACN;OACU;SACT,CAAA;KAGP,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,GAAD;OAAQ,MAAK;OAAS,UAAU;OAAY,MAAK;iBAAjD,CACG,IAAa,kBAAC,GAAD;QAAS,MAAM;QAAI,WAAU;QAAiB,CAAA,GAAG,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EAChF,IACG,EAAc,GAAG,wCAAwC,eAAe,GACxE,EAAc,GAAG,mCAAmC,kBAAkB,CACnE;UACT,kBAAC,GAAD;OACE,MAAK;OACL,SAAQ;OACR,eAAe,IAAW,EAAS,GAAU,YAAY,CAAC;OAC1D,UAAU;iBAET,EAAc,GAAG,mCAAmC,SAAS;OACvD,CAAA,CACL;;KACD;;GACI"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use {@link UserTemplatesPage} or {@link AdminTemplatesPage} instead.
|
|
3
|
+
*
|
|
4
|
+
* Templates Page
|
|
5
|
+
* List and manage sandbox templates
|
|
6
|
+
*/
|
|
7
|
+
export declare function TemplatesPage(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TemplatesPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplatesPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/TemplatesPage.tsx"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,wBAAgB,aAAa,4CA6J5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UserLandingPage
|
|
3
|
+
*
|
|
4
|
+
* Tabbed landing page for the user-facing Sandbox microfrontend.
|
|
5
|
+
* Shows only user-relevant tabs: sandbox list, create, and templates (read-only).
|
|
6
|
+
* The active tab is reflected in the `?tab=` URL search param.
|
|
7
|
+
*/
|
|
8
|
+
export declare function UserLandingPage(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=UserLandingPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserLandingPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/UserLandingPage.tsx"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,wBAAgB,eAAe,4CAoD9B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
+
import { SandboxListPage as t } from "./SandboxListPage.js";
|
|
3
|
+
import { SandboxCreatePage as n } from "./SandboxCreatePage.js";
|
|
4
|
+
import { UserTemplatesPage as r } from "./UserTemplatesPage.js";
|
|
5
|
+
import { useMemo as i } from "react";
|
|
6
|
+
import { useSearchParams as a } from "react-router-dom";
|
|
7
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { Tabs as l } from "@burdenoff/fe-libs/chrome";
|
|
10
|
+
//#region src/sandbox/pages/UserLandingPage.tsx
|
|
11
|
+
function u() {
|
|
12
|
+
let [u, d] = a(), { t: f } = o(), p = i(() => [
|
|
13
|
+
{
|
|
14
|
+
id: "overview",
|
|
15
|
+
label: e(f, "sandbox.userLanding.tabs.overview", "All Sandboxes")
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "create",
|
|
19
|
+
label: e(f, "sandbox.userLanding.tabs.create", "New Sandbox")
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "templates",
|
|
23
|
+
label: e(f, "sandbox.userLanding.tabs.templates", "Templates")
|
|
24
|
+
}
|
|
25
|
+
], [f]), m = u.get("tab"), h = m && p.some((e) => e.id === m) ? m : p[0].id;
|
|
26
|
+
return /* @__PURE__ */ c("div", {
|
|
27
|
+
className: "flex flex-col h-full",
|
|
28
|
+
children: [/* @__PURE__ */ s("div", {
|
|
29
|
+
className: "border-b border-border-subtle px-4 pt-3",
|
|
30
|
+
children: /* @__PURE__ */ s(l, {
|
|
31
|
+
items: p,
|
|
32
|
+
activeTabId: h,
|
|
33
|
+
onTabChange: (e) => {
|
|
34
|
+
let t = new URLSearchParams(u);
|
|
35
|
+
e === p[0].id ? t.delete("tab") : t.set("tab", e), d(t, { replace: !0 });
|
|
36
|
+
},
|
|
37
|
+
variant: "underline"
|
|
38
|
+
})
|
|
39
|
+
}), /* @__PURE__ */ c("div", {
|
|
40
|
+
className: "flex-1 min-h-0 overflow-auto",
|
|
41
|
+
children: [
|
|
42
|
+
h === "overview" && /* @__PURE__ */ s(t, {}),
|
|
43
|
+
h === "create" && /* @__PURE__ */ s(n, {}),
|
|
44
|
+
h === "templates" && /* @__PURE__ */ s(r, {})
|
|
45
|
+
]
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { u as UserLandingPage };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=UserLandingPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserLandingPage.js","names":[],"sources":["../../../src/sandbox/pages/UserLandingPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { Tabs, type TabItem } from '@burdenoff/fe-libs/chrome';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { SandboxListPage } from './SandboxListPage';\nimport { SandboxCreatePage } from './SandboxCreatePage';\nimport { UserTemplatesPage } from './UserTemplatesPage';\nimport { tWithFallback } from '../utils/i18n';\n\n/**\n * UserLandingPage\n *\n * Tabbed landing page for the user-facing Sandbox microfrontend.\n * Shows only user-relevant tabs: sandbox list, create, and templates (read-only).\n * The active tab is reflected in the `?tab=` URL search param.\n */\nexport function UserLandingPage() {\n const [params, setParams] = useSearchParams();\n const { t } = useI18n();\n\n const tabs: TabItem[] = useMemo(\n () => [\n {\n id: 'overview',\n label: tWithFallback(t, 'sandbox.userLanding.tabs.overview', 'All Sandboxes'),\n },\n {\n id: 'create',\n label: tWithFallback(t, 'sandbox.userLanding.tabs.create', 'New Sandbox'),\n },\n {\n id: 'templates',\n label: tWithFallback(t, 'sandbox.userLanding.tabs.templates', 'Templates'),\n },\n ],\n [t]\n );\n\n const rawTab = params.get('tab');\n const activeId = rawTab && tabs.some((t) => t.id === rawTab) ? rawTab : tabs[0].id;\n\n const handleTabChange = (id: string) => {\n const next = new URLSearchParams(params);\n if (id === tabs[0].id) {\n next.delete('tab');\n } else {\n next.set('tab', id);\n }\n setParams(next, { replace: true });\n };\n\n return (\n <div className=\"flex flex-col h-full\">\n <div className=\"border-b border-border-subtle px-4 pt-3\">\n <Tabs\n items={tabs}\n activeTabId={activeId}\n onTabChange={handleTabChange}\n variant=\"underline\"\n />\n </div>\n <div className=\"flex-1 min-h-0 overflow-auto\">\n {activeId === 'overview' && <SandboxListPage />}\n {activeId === 'create' && <SandboxCreatePage />}\n {activeId === 'templates' && <UserTemplatesPage />}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAiBA,SAAgB,IAAkB;CAChC,IAAM,CAAC,GAAQ,KAAa,GAAiB,EACvC,EAAE,SAAM,GAAS,EAEjB,IAAkB,QAChB;EACJ;GACE,IAAI;GACJ,OAAO,EAAc,GAAG,qCAAqC,gBAAgB;GAC9E;EACD;GACE,IAAI;GACJ,OAAO,EAAc,GAAG,mCAAmC,cAAc;GAC1E;EACD;GACE,IAAI;GACJ,OAAO,EAAc,GAAG,sCAAsC,YAAY;GAC3E;EACF,EACD,CAAC,EAAE,CACJ,EAEK,IAAS,EAAO,IAAI,MAAM,EAC1B,IAAW,KAAU,EAAK,MAAM,MAAM,EAAE,OAAO,EAAO,GAAG,IAAS,EAAK,GAAG;AAYhF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IACE,OAAO;IACP,aAAa;IACb,cAhBiB,MAAe;KACtC,IAAM,IAAO,IAAI,gBAAgB,EAAO;AAMxC,KALI,MAAO,EAAK,GAAG,KACjB,EAAK,OAAO,MAAM,GAElB,EAAK,IAAI,OAAO,EAAG,EAErB,EAAU,GAAM,EAAE,SAAS,IAAM,CAAC;;IAU5B,SAAQ;IACR,CAAA;GACE,CAAA,EACN,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,MAAa,cAAc,kBAAC,GAAD,EAAmB,CAAA;IAC9C,MAAa,YAAY,kBAAC,GAAD,EAAqB,CAAA;IAC9C,MAAa,eAAe,kBAAC,GAAD,EAAqB,CAAA;IAC9C;KACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Templates Page
|
|
3
|
+
* Read-only template catalog for workspace members.
|
|
4
|
+
* Users can browse templates and use them to create sandboxes.
|
|
5
|
+
* Template CRUD (create/edit/delete) is admin-only per spec.
|
|
6
|
+
*/
|
|
7
|
+
export declare function UserTemplatesPage(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=UserTemplatesPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserTemplatesPage.d.ts","sourceRoot":"","sources":["../../../src/sandbox/pages/UserTemplatesPage.tsx"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,wBAAgB,iBAAiB,4CAgJhC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { useSandbox as e } from "../providers/SandboxProvider.js";
|
|
2
|
+
import { joinPath as t } from "../utils/navigation.js";
|
|
3
|
+
import { Badge as n, Button as r, Card as i, CardContent as a } from "../components/ui.js";
|
|
4
|
+
import { tWithFallback as o } from "../utils/i18n.js";
|
|
5
|
+
import { SandboxTypeIcon as s } from "../components/SandboxTypeIcon.js";
|
|
6
|
+
import { EmptyState as c, PageLayout as l } from "../components/PageLayout.js";
|
|
7
|
+
import { useListSandboxTemplatesQuery as u } from "../../generated/wspace-operations.js";
|
|
8
|
+
import { formatTTL as d } from "../utils/formatters.js";
|
|
9
|
+
import { Container as f, LayoutTemplate as p, Loader2 as m, Play as h, Star as g } from "lucide-react";
|
|
10
|
+
import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
11
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
//#region src/sandbox/pages/UserTemplatesPage.tsx
|
|
13
|
+
function b() {
|
|
14
|
+
let { basePath: b = "/", navigate: x, workspaceId: S } = e(), { t: C } = _(), { data: w, loading: T } = u({
|
|
15
|
+
variables: { context: { workspaceId: S } },
|
|
16
|
+
skip: !S
|
|
17
|
+
}), E = w?.listSandboxTemplates?.items ?? [], D = (e) => {
|
|
18
|
+
x?.(t(b, `new?template=${e}`));
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ v(l, {
|
|
21
|
+
title: o(C, "sandbox.userTemplates.title", "Templates"),
|
|
22
|
+
subtitle: o(C, "sandbox.userTemplates.subtitle", "Browse sandbox templates for quick provisioning"),
|
|
23
|
+
icon: /* @__PURE__ */ v(p, { size: 24 }),
|
|
24
|
+
headerContent: /* @__PURE__ */ v(n, {
|
|
25
|
+
variant: "secondary",
|
|
26
|
+
children: o(C, "sandbox.userTemplates.header.count", "{count} templates", { count: E.length })
|
|
27
|
+
}),
|
|
28
|
+
children: T ? /* @__PURE__ */ v("div", {
|
|
29
|
+
className: "flex items-center justify-center min-h-[200px]",
|
|
30
|
+
children: /* @__PURE__ */ v(m, { className: "h-8 w-8 animate-spin text-primary" })
|
|
31
|
+
}) : E.length > 0 ? /* @__PURE__ */ v("div", {
|
|
32
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
33
|
+
children: E.map((e, t) => /* @__PURE__ */ v(i, {
|
|
34
|
+
className: "group hover:shadow-md hover:border-primary/30 transition-all duration-200 animate-in fade-in-0 slide-in-from-bottom-2",
|
|
35
|
+
style: { animationDelay: `${t * 50}ms` },
|
|
36
|
+
children: /* @__PURE__ */ y(a, {
|
|
37
|
+
className: "p-5",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ y("div", {
|
|
40
|
+
className: "flex items-start justify-between mb-3",
|
|
41
|
+
children: [/* @__PURE__ */ y("div", {
|
|
42
|
+
className: "flex items-center gap-3",
|
|
43
|
+
children: [/* @__PURE__ */ v("div", {
|
|
44
|
+
className: "p-2 rounded-lg bg-muted/50",
|
|
45
|
+
children: /* @__PURE__ */ v(s, {
|
|
46
|
+
type: e.template,
|
|
47
|
+
size: 20
|
|
48
|
+
})
|
|
49
|
+
}), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
|
|
50
|
+
className: "flex items-center gap-2",
|
|
51
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
52
|
+
className: "font-semibold",
|
|
53
|
+
children: e.name
|
|
54
|
+
}), e.isDefault && /* @__PURE__ */ y(n, {
|
|
55
|
+
variant: "default",
|
|
56
|
+
className: "gap-1 text-xs bg-status-warning-bg-subtle text-status-warning-text border-border-default",
|
|
57
|
+
children: [/* @__PURE__ */ v(g, { size: 10 }), o(C, "sandbox.userTemplates.badges.default", "Default")]
|
|
58
|
+
})]
|
|
59
|
+
}), /* @__PURE__ */ v(s, {
|
|
60
|
+
type: e.template,
|
|
61
|
+
size: 12,
|
|
62
|
+
showLabel: !0,
|
|
63
|
+
className: "mt-0.5"
|
|
64
|
+
})] })]
|
|
65
|
+
}), /* @__PURE__ */ y(r, {
|
|
66
|
+
variant: "outline",
|
|
67
|
+
size: "sm",
|
|
68
|
+
className: "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 transition-opacity gap-1.5",
|
|
69
|
+
onClick: () => D(e.id),
|
|
70
|
+
"aria-label": o(C, "sandbox.userTemplates.actions.use.ariaLabel", "Use template {name}", { name: e.name }),
|
|
71
|
+
children: [/* @__PURE__ */ v(h, { size: 12 }), o(C, "sandbox.userTemplates.actions.use.label", "Use")]
|
|
72
|
+
})]
|
|
73
|
+
}),
|
|
74
|
+
e.description && /* @__PURE__ */ v("p", {
|
|
75
|
+
className: "text-sm text-muted-foreground mb-3 line-clamp-2",
|
|
76
|
+
children: e.description
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ y("div", {
|
|
79
|
+
className: "flex flex-wrap items-center gap-2",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ y(n, {
|
|
82
|
+
variant: "outline",
|
|
83
|
+
className: "text-xs gap-1",
|
|
84
|
+
children: [e.resources?.cpuRequest ?? "?", " CPU"]
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ y(n, {
|
|
87
|
+
variant: "outline",
|
|
88
|
+
className: "text-xs gap-1",
|
|
89
|
+
children: [e.resources?.memoryRequest ?? "?", " mem"]
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ y(n, {
|
|
92
|
+
variant: "outline",
|
|
93
|
+
className: "text-xs gap-1",
|
|
94
|
+
children: [/* @__PURE__ */ v(f, { size: 10 }), o(C, "sandbox.userTemplates.meta.containers", "{count} containers", { count: e.containers?.length ?? 0 })]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ y(n, {
|
|
97
|
+
variant: "outline",
|
|
98
|
+
className: "text-xs gap-1",
|
|
99
|
+
children: [d(e.ttlSeconds), " TTL"]
|
|
100
|
+
}),
|
|
101
|
+
e.storage?.mode && e.storage.mode !== "NONE" && /* @__PURE__ */ y(n, {
|
|
102
|
+
variant: "outline",
|
|
103
|
+
className: "text-xs gap-1",
|
|
104
|
+
children: [e.storage.mode === "EPHEMERAL" ? o(C, "sandbox.userTemplates.storage.ephemeral", "Ephemeral") : o(C, "sandbox.userTemplates.storage.persistent", "Persistent"), e.storage.sizeGi ? ` ${e.storage.sizeGi}Gi` : ""]
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
}, e.id))
|
|
111
|
+
}) : /* @__PURE__ */ v(c, {
|
|
112
|
+
icon: /* @__PURE__ */ v(p, { size: 48 }),
|
|
113
|
+
title: o(C, "sandbox.userTemplates.empty.title", "No templates available"),
|
|
114
|
+
description: o(C, "sandbox.userTemplates.empty.description", "No sandbox templates have been configured yet. Contact your workspace admin to set up templates.")
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { b as UserTemplatesPage };
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=UserTemplatesPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserTemplatesPage.js","names":[],"sources":["../../../src/sandbox/pages/UserTemplatesPage.tsx"],"sourcesContent":["import { LayoutTemplate, Star, Container, Play, Loader2 } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button, Badge, Card, CardContent } from '../components/ui';\nimport { SandboxTypeIcon } from '../components/SandboxTypeIcon';\nimport { useSandbox } from '../providers/SandboxProvider';\nimport { joinPath } from '../utils/navigation';\nimport { formatTTL } from '../utils/formatters';\nimport { tWithFallback } from '../utils/i18n';\nimport { PageLayout, EmptyState } from '../components/PageLayout';\nimport { useListSandboxTemplatesQuery } from '../../generated/wspace-operations';\nimport type { SandboxTemplate } from '../types';\n\n/**\n * User Templates Page\n * Read-only template catalog for workspace members.\n * Users can browse templates and use them to create sandboxes.\n * Template CRUD (create/edit/delete) is admin-only per spec.\n */\nexport function UserTemplatesPage() {\n const { basePath = '/', navigate, workspaceId } = useSandbox();\n const { t } = useI18n();\n const { data, loading } = useListSandboxTemplatesQuery({\n variables: { context: { workspaceId } },\n skip: !workspaceId,\n });\n const templates = (data?.listSandboxTemplates?.items ?? []) as SandboxTemplate[];\n\n const handleUseTemplate = (templateId: string) => {\n navigate?.(joinPath(basePath, `new?template=${templateId}`));\n };\n\n return (\n <PageLayout\n title={tWithFallback(t, 'sandbox.userTemplates.title', 'Templates')}\n subtitle={tWithFallback(\n t,\n 'sandbox.userTemplates.subtitle',\n 'Browse sandbox templates for quick provisioning'\n )}\n icon={<LayoutTemplate size={24} />}\n headerContent={\n <Badge variant=\"secondary\">\n {tWithFallback(t, 'sandbox.userTemplates.header.count', '{count} templates', {\n count: templates.length,\n })}\n </Badge>\n }\n >\n {loading ? (\n <div className=\"flex items-center justify-center min-h-[200px]\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n ) : templates.length > 0 ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {templates.map((template, index) => (\n <Card\n key={template.id}\n className=\"group hover:shadow-md hover:border-primary/30 transition-all duration-200 animate-in fade-in-0 slide-in-from-bottom-2\"\n style={{ animationDelay: `${index * 50}ms` }}\n >\n <CardContent className=\"p-5\">\n <div className=\"flex items-start justify-between mb-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-lg bg-muted/50\">\n <SandboxTypeIcon type={template.template} size={20} />\n </div>\n <div>\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold\">{template.name}</h3>\n {template.isDefault && (\n <Badge\n variant=\"default\"\n className=\"gap-1 text-xs bg-status-warning-bg-subtle text-status-warning-text border-border-default\"\n >\n <Star size={10} />\n {tWithFallback(t, 'sandbox.userTemplates.badges.default', 'Default')}\n </Badge>\n )}\n </div>\n <SandboxTypeIcon\n type={template.template}\n size={12}\n showLabel\n className=\"mt-0.5\"\n />\n </div>\n </div>\n\n {/* Use Template action */}\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 transition-opacity gap-1.5\"\n onClick={() => handleUseTemplate(template.id)}\n aria-label={tWithFallback(\n t,\n 'sandbox.userTemplates.actions.use.ariaLabel',\n 'Use template {name}',\n { name: template.name }\n )}\n >\n <Play size={12} />\n {tWithFallback(t, 'sandbox.userTemplates.actions.use.label', 'Use')}\n </Button>\n </div>\n\n {template.description && (\n <p className=\"text-sm text-muted-foreground mb-3 line-clamp-2\">\n {template.description}\n </p>\n )}\n\n {/* Resources & Info */}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Badge variant=\"outline\" className=\"text-xs gap-1\">\n {template.resources?.cpuRequest ?? '?'} CPU\n </Badge>\n <Badge variant=\"outline\" className=\"text-xs gap-1\">\n {template.resources?.memoryRequest ?? '?'} mem\n </Badge>\n <Badge variant=\"outline\" className=\"text-xs gap-1\">\n <Container size={10} />\n {tWithFallback(\n t,\n 'sandbox.userTemplates.meta.containers',\n '{count} containers',\n { count: template.containers?.length ?? 0 }\n )}\n </Badge>\n <Badge variant=\"outline\" className=\"text-xs gap-1\">\n {formatTTL(template.ttlSeconds)} TTL\n </Badge>\n {template.storage?.mode && template.storage.mode !== 'NONE' && (\n <Badge variant=\"outline\" className=\"text-xs gap-1\">\n {template.storage.mode === 'EPHEMERAL'\n ? tWithFallback(t, 'sandbox.userTemplates.storage.ephemeral', 'Ephemeral')\n : tWithFallback(\n t,\n 'sandbox.userTemplates.storage.persistent',\n 'Persistent'\n )}\n {template.storage.sizeGi ? ` ${template.storage.sizeGi}Gi` : ''}\n </Badge>\n )}\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n ) : (\n <EmptyState\n icon={<LayoutTemplate size={48} />}\n title={tWithFallback(t, 'sandbox.userTemplates.empty.title', 'No templates available')}\n description={tWithFallback(\n t,\n 'sandbox.userTemplates.empty.description',\n 'No sandbox templates have been configured yet. Contact your workspace admin to set up templates.'\n )}\n />\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,IAAoB;CAClC,IAAM,EAAE,cAAW,KAAK,aAAU,mBAAgB,GAAY,EACxD,EAAE,SAAM,GAAS,EACjB,EAAE,SAAM,eAAY,EAA6B;EACrD,WAAW,EAAE,SAAS,EAAE,gBAAa,EAAE;EACvC,MAAM,CAAC;EACR,CAAC,EACI,IAAa,GAAM,sBAAsB,SAAS,EAAE,EAEpD,KAAqB,MAA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|
|
2
|
+
import { SandboxRootProps } from '../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook to access Sandbox context
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSandbox: () => SandboxRootProps;
|
|
8
|
+
/**
|
|
9
|
+
* Provider component for Sandbox microfrontend
|
|
10
|
+
* Sets up routing, context, Apollo Client, and React Query client
|
|
11
|
+
*/
|
|
12
|
+
export declare const SandboxProvider: FC<PropsWithChildren<SandboxRootProps>>;
|
|
13
|
+
//# sourceMappingURL=SandboxProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxProvider.d.ts","sourceRoot":"","sources":["../../../src/sandbox/providers/SandboxProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AASnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAgCjD;;GAEG;AACH,eAAO,MAAM,UAAU,wBAMtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CA4GnE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createContext as e, useContext as t, useMemo as n } from "react";
|
|
2
|
+
import { MemoryRouter as r } from "react-router-dom";
|
|
3
|
+
import { QueryClient as i, QueryClientProvider as a } from "@tanstack/react-query";
|
|
4
|
+
import { ApolloClient as o, HttpLink as s, InMemoryCache as c, from as l } from "@apollo/client";
|
|
5
|
+
import { onError as u } from "@apollo/client/link/error";
|
|
6
|
+
import { ApolloProvider as d } from "@apollo/client/react";
|
|
7
|
+
import { isAuthNetworkError as f, redirectToLogin as p } from "@burdenoff/fe-libs/shared/utils";
|
|
8
|
+
import { PermissionProvider as m } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
10
|
+
//#region src/sandbox/providers/SandboxProvider.tsx
|
|
11
|
+
function g(e = []) {
|
|
12
|
+
return e.some((e) => {
|
|
13
|
+
let t = typeof e.extensions?.code == "string" ? e.extensions.code : "", n = typeof e.extensions?.errorCode == "string" ? e.extensions.errorCode : "", r = (e.message ?? "").toLowerCase();
|
|
14
|
+
return t === "UNAUTHENTICATED" || n === "TOKEN_EXPIRED" || r.includes("token_expired") || r.includes("token expired") || r.includes("session expired") || r.includes("unauthorized") || r.includes("unauthenticated") || r.includes("authentication required") || r.includes("workspace context missing");
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
var _ = e(null), v = () => {
|
|
18
|
+
let e = t(_);
|
|
19
|
+
if (!e) throw Error("useSandbox must be used within SandboxProvider");
|
|
20
|
+
return e;
|
|
21
|
+
}, y = ({ children: e, basePath: t, navigate: v, currentUser: y, workspaceId: b, apiGatewayUrl: x, authToken: S, workspaceToken: C }) => {
|
|
22
|
+
let w = {
|
|
23
|
+
basePath: t,
|
|
24
|
+
navigate: v,
|
|
25
|
+
currentUser: y,
|
|
26
|
+
workspaceId: b,
|
|
27
|
+
apiGatewayUrl: x,
|
|
28
|
+
authToken: S,
|
|
29
|
+
workspaceToken: C
|
|
30
|
+
}, T = n(() => new i({ defaultOptions: { queries: {
|
|
31
|
+
retry: 1,
|
|
32
|
+
refetchOnWindowFocus: !1,
|
|
33
|
+
staleTime: 300 * 1e3
|
|
34
|
+
} } }), []), E = n(() => {
|
|
35
|
+
let e = {};
|
|
36
|
+
S && (e.Authorization = `Bearer ${S}`), C && (e["X-Workspace-Authorization"] = `Bearer ${C}`), b && (e["X-Workspace-ID"] = b);
|
|
37
|
+
let t = new s({
|
|
38
|
+
uri: x ? `${x}/workspaces/graphql` : "/workspaces/graphql",
|
|
39
|
+
headers: Object.keys(e).length > 0 ? e : void 0
|
|
40
|
+
});
|
|
41
|
+
return new o({
|
|
42
|
+
link: l([u(({ error: e }) => {
|
|
43
|
+
if (e) {
|
|
44
|
+
if (g("errors" in e && Array.isArray(e.errors) ? e.errors : [])) {
|
|
45
|
+
p();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
e instanceof Error && f(e) && p();
|
|
49
|
+
}
|
|
50
|
+
}), t]),
|
|
51
|
+
cache: new c(),
|
|
52
|
+
defaultOptions: { watchQuery: { fetchPolicy: "cache-and-network" } }
|
|
53
|
+
});
|
|
54
|
+
}, [
|
|
55
|
+
x,
|
|
56
|
+
S,
|
|
57
|
+
C,
|
|
58
|
+
b
|
|
59
|
+
]), D = /* @__PURE__ */ h(a, {
|
|
60
|
+
client: T,
|
|
61
|
+
children: /* @__PURE__ */ h(_.Provider, {
|
|
62
|
+
value: w,
|
|
63
|
+
children: /* @__PURE__ */ h(m, {
|
|
64
|
+
scopeId: b ?? null,
|
|
65
|
+
gateway: "workspace",
|
|
66
|
+
children: e
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
return t ? D : /* @__PURE__ */ h(d, {
|
|
71
|
+
client: E,
|
|
72
|
+
children: /* @__PURE__ */ h(r, { children: D })
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { y as SandboxProvider, v as useSandbox };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=SandboxProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SandboxProvider.js","names":[],"sources":["../../../src/sandbox/providers/SandboxProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo } from 'react';\nimport { MemoryRouter } from 'react-router-dom';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ApolloClient, InMemoryCache, HttpLink, from } from '@apollo/client';\nimport { onError } from '@apollo/client/link/error';\nimport { ApolloProvider } from '@apollo/client/react';\nimport { isAuthNetworkError, redirectToLogin } from '@burdenoff/fe-libs/shared/utils';\nimport { PermissionProvider } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { SandboxRootProps } from '../types';\n\nfunction hasSessionAuthErrors(\n errors: ReadonlyArray<{ message?: string; extensions?: Record<string, unknown> }> = []\n): boolean {\n return errors.some((error) => {\n const code = typeof error.extensions?.code === 'string' ? error.extensions.code : '';\n const errorCode =\n typeof error.extensions?.errorCode === 'string' ? error.extensions.errorCode : '';\n const message = (error.message ?? '').toLowerCase();\n\n return (\n code === 'UNAUTHENTICATED' ||\n errorCode === 'TOKEN_EXPIRED' ||\n message.includes('token_expired') ||\n message.includes('token expired') ||\n message.includes('session expired') ||\n message.includes('unauthorized') ||\n message.includes('unauthenticated') ||\n message.includes('authentication required') ||\n message.includes('workspace context missing')\n );\n });\n}\n\n/**\n * Context value for Sandbox microfrontend\n */\ntype SandboxContextValue = SandboxRootProps;\n\nconst SandboxContext = createContext<SandboxContextValue | null>(null);\n\n/**\n * Hook to access Sandbox context\n */\nexport const useSandbox = () => {\n const context = useContext(SandboxContext);\n if (!context) {\n throw new Error('useSandbox must be used within SandboxProvider');\n }\n return context;\n};\n\n/**\n * Provider component for Sandbox microfrontend\n * Sets up routing, context, Apollo Client, and React Query client\n */\nexport const SandboxProvider: FC<PropsWithChildren<SandboxRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n workspaceId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n}) => {\n const contextValue: SandboxContextValue = {\n basePath,\n navigate,\n currentUser,\n workspaceId,\n apiGatewayUrl,\n authToken,\n workspaceToken,\n };\n\n // Create QueryClient instance (memoized to avoid recreation on re-renders)\n const queryClient = useMemo(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n retry: 1,\n refetchOnWindowFocus: false,\n staleTime: 5 * 60 * 1000, // 5 minutes\n },\n },\n }),\n []\n );\n\n // Create ApolloClient instance (memoized, recreated when context changes)\n // Auth tokens are sent to the PUBLIC GATEWAY only (never to downstream services).\n // The gateway validates tokens, strips them, and injects context headers\n // (x-actor-id, x-workspace-id, etc.) for downstream subgraph services.\n const apolloClient = useMemo(() => {\n const headers: Record<string, string> = {};\n\n // Auth tokens — consumed by the gateway, never forwarded to subgraphs\n if (authToken) headers['Authorization'] = `Bearer ${authToken}`;\n if (workspaceToken) headers['X-Workspace-Authorization'] = `Bearer ${workspaceToken}`;\n\n // Context headers — forwarded by the gateway to downstream subgraphs.\n // X-Workspace-ID is the primary workspace context and is always sent.\n // This ensures workspace isolation works even when the workspace token\n // issuance fails (gateway uses this header as fallback context).\n if (workspaceId) headers['X-Workspace-ID'] = workspaceId;\n\n const httpLink = new HttpLink({\n uri: apiGatewayUrl ? `${apiGatewayUrl}/workspaces/graphql` : '/workspaces/graphql',\n headers: Object.keys(headers).length > 0 ? headers : undefined,\n });\n\n const errorLink = onError(({ error }) => {\n if (!error) return;\n\n const graphQLErrors = 'errors' in error && Array.isArray(error.errors) ? error.errors : [];\n\n if (hasSessionAuthErrors(graphQLErrors)) {\n redirectToLogin();\n return;\n }\n\n if (error instanceof Error && isAuthNetworkError(error)) {\n redirectToLogin();\n }\n });\n\n return new ApolloClient({\n link: from([errorLink, httpLink]),\n cache: new InMemoryCache(),\n defaultOptions: {\n watchQuery: {\n fetchPolicy: 'cache-and-network',\n },\n },\n });\n }, [apiGatewayUrl, authToken, workspaceToken, workspaceId]);\n\n // Wrap content with QueryClientProvider and Context.Provider\n const content = (\n <QueryClientProvider client={queryClient}>\n <SandboxContext.Provider value={contextValue}>\n <PermissionProvider scopeId={workspaceId ?? null} gateway=\"workspace\">\n {children}\n </PermissionProvider>\n </SandboxContext.Provider>\n </QueryClientProvider>\n );\n\n // When integrated into a shell (basePath provided), the shell already has a router\n // and ApolloProvider so we don't create another one. When standalone (no basePath),\n // use MemoryRouter and ApolloProvider.\n if (basePath) {\n // Integrated mode: shell already has BrowserRouter and ApolloProvider, don't create nested ones\n return content;\n }\n\n // Standalone mode: create MemoryRouter and ApolloProvider for independent operation\n return (\n <ApolloProvider client={apolloClient}>\n <MemoryRouter>{content}</MemoryRouter>\n </ApolloProvider>\n );\n};\n"],"m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AAY;AAClC,WAIL;SAAI,EAFkB,YAAY,KAAS,MAAM,QAAQ,EAAM,OAAO,GAAG,EAAM,SAAS,EAAE,CAEnD,EAAE;AACvC,SAAiB;AACjB;;AAGF,KAAI,aAAiB,SAAS,EAAmB,EAAM,IACrD,GAAiB;;KAEnB,EAGuB,EAAS,CAAC;GACjC,OAAO,IAAI,GAAe;GAC1B,gBAAgB,EACd,YAAY,EACV,aAAa,qBACd,EACF;GACF,CAAC;IACD;EAAC;EAAe;EAAW;EAAgB;EAAY,CAAC,EAGrD,IACJ,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,EAAe,UAAhB;GAAyB,OAAO;aAC9B,kBAAC,GAAD;IAAoB,SAAS,KAAe;IAAM,SAAQ;IACvD;IACkB,CAAA;GACG,CAAA;EACN,CAAA;AAYxB,QANI,IAEK,IAKP,kBAAC,GAAD;EAAgB,QAAQ;YACtB,kBAAC,GAAD,EAAA,UAAe,GAAuB,CAAA;EACvB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Sandbox, SandboxTemplate, SandboxFilter, SandboxView } from '../types';
|
|
2
|
+
|
|
3
|
+
interface SandboxState {
|
|
4
|
+
selectedSandbox: Sandbox | null;
|
|
5
|
+
viewMode: SandboxView;
|
|
6
|
+
selectedTemplate: SandboxTemplate | null;
|
|
7
|
+
sandboxFilter: SandboxFilter;
|
|
8
|
+
setSelectedSandbox: (sandbox: Sandbox | null) => void;
|
|
9
|
+
setViewMode: (mode: SandboxView) => void;
|
|
10
|
+
updateFilter: (filter: Partial<SandboxFilter>) => void;
|
|
11
|
+
resetFilter: () => void;
|
|
12
|
+
setSelectedTemplate: (template: SandboxTemplate | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const useSandboxStore: import('zustand').UseBoundStore<import('zustand').StoreApi<SandboxState>>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=sandboxStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandboxStore.d.ts","sourceRoot":"","sources":["../../../src/sandbox/store/sandboxStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErF,UAAU,YAAY;IAEpB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,WAAW,CAAC;IACtB,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;IAGzC,aAAa,EAAE,aAAa,CAAC;IAG7B,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;IACtD,WAAW,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IACzC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IACvD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mBAAmB,EAAE,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;CACjE;AAQD,eAAO,MAAM,eAAe,2EAgBzB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { create as e } from "zustand";
|
|
2
|
+
//#region src/sandbox/store/sandboxStore.ts
|
|
3
|
+
var t = {
|
|
4
|
+
search: "",
|
|
5
|
+
template: "all",
|
|
6
|
+
status: "all"
|
|
7
|
+
}, n = e((e) => ({
|
|
8
|
+
selectedSandbox: null,
|
|
9
|
+
viewMode: "list",
|
|
10
|
+
selectedTemplate: null,
|
|
11
|
+
sandboxFilter: t,
|
|
12
|
+
setSelectedSandbox: (t) => e({ selectedSandbox: t }),
|
|
13
|
+
setViewMode: (t) => e({ viewMode: t }),
|
|
14
|
+
updateFilter: (t) => e((e) => ({ sandboxFilter: {
|
|
15
|
+
...e.sandboxFilter,
|
|
16
|
+
...t
|
|
17
|
+
} })),
|
|
18
|
+
resetFilter: () => e({ sandboxFilter: t }),
|
|
19
|
+
setSelectedTemplate: (t) => e({ selectedTemplate: t })
|
|
20
|
+
}));
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as useSandboxStore };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=sandboxStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandboxStore.js","names":[],"sources":["../../../src/sandbox/store/sandboxStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport type { Sandbox, SandboxTemplate, SandboxFilter, SandboxView } from '../types';\n\ninterface SandboxState {\n // View state\n selectedSandbox: Sandbox | null;\n viewMode: SandboxView;\n selectedTemplate: SandboxTemplate | null;\n\n // Filters\n sandboxFilter: SandboxFilter;\n\n // Actions\n setSelectedSandbox: (sandbox: Sandbox | null) => void;\n setViewMode: (mode: SandboxView) => void;\n updateFilter: (filter: Partial<SandboxFilter>) => void;\n resetFilter: () => void;\n setSelectedTemplate: (template: SandboxTemplate | null) => void;\n}\n\nconst defaultFilter: SandboxFilter = {\n search: '',\n template: 'all',\n status: 'all',\n};\n\nexport const useSandboxStore = create<SandboxState>((set) => ({\n // Initial state\n selectedSandbox: null,\n viewMode: 'list',\n selectedTemplate: null,\n sandboxFilter: defaultFilter,\n\n // Actions\n setSelectedSandbox: (sandbox) => set({ selectedSandbox: sandbox }),\n setViewMode: (mode) => set({ viewMode: mode }),\n updateFilter: (filter) =>\n set((state) => ({\n sandboxFilter: { ...state.sandboxFilter, ...filter },\n })),\n resetFilter: () => set({ sandboxFilter: defaultFilter }),\n setSelectedTemplate: (template) => set({ selectedTemplate: template }),\n}));\n"],"mappings":";;AAoBA,IAAM,IAA+B;CACnC,QAAQ;CACR,UAAU;CACV,QAAQ;CACT,EAEY,IAAkB,GAAsB,OAAS;CAE5D,iBAAiB;CACjB,UAAU;CACV,kBAAkB;CAClB,eAAe;CAGf,qBAAqB,MAAY,EAAI,EAAE,iBAAiB,GAAS,CAAC;CAClE,cAAc,MAAS,EAAI,EAAE,UAAU,GAAM,CAAC;CAC9C,eAAe,MACb,GAAK,OAAW,EACd,eAAe;EAAE,GAAG,EAAM;EAAe,GAAG;EAAQ,EACrD,EAAE;CACL,mBAAmB,EAAI,EAAE,eAAe,GAAe,CAAC;CACxD,sBAAsB,MAAa,EAAI,EAAE,kBAAkB,GAAU,CAAC;CACvE,EAAE"}
|