Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
fix: swarm source directory override
Kyle Mendell6ce55cf013d1
diff --git a/backend/internal/huma/handlers/swarm.go b/backend/internal/huma/handlers/swarm.goindex e5ef500d5..38e997b67 100644--- a/backend/internal/huma/handlers/swarm.go+++ b/backend/internal/huma/handlers/swarm.go@@ -1132,7 +1132,7 @@ func (h *SwarmHandler) ListStacks(ctx context.Context, input *ListSwarmStacksInp}params := buildSwarmQueryParams(input.Search, input.Sort, input.Order, input.Start, input.Limit)- items, paginationResp, err := h.swarmService.ListStacksPaginated(ctx, params)+ items, paginationResp, err := h.swarmService.ListStacksPaginated(ctx, input.EnvironmentID, params)if err != nil {return nil, mapSwarmServiceError(err, (&common.SwarmStackListError{Err: err}).Error())}diff --git a/backend/internal/services/settings_service.go b/backend/internal/services/settings_service.goindex f765d2ef0..de874bd05 100644--- a/backend/internal/services/settings_service.go+++ b/backend/internal/services/settings_service.go@@ -334,9 +334,14 @@ func (s *SettingsService) isEnvOverrideActiveInternal(key string) bool {}func (s *SettingsService) GetSettings(ctx context.Context) (*models.Settings, error) {+ settings := s.getEffectiveSettingsConfig(ctx)+ return settings, nil+}++func (s *SettingsService) getEffectiveSettingsConfig(ctx context.Context) *models.Settings {settings := s.GetSettingsConfig().Clone()s.applyEnvOverrides(ctx, settings)- return settings, nil+ return settings}// MigrateOidcConfigToFields migrates the legacy JSON authOidcConfig to individual fields,@@ -881,7 +886,7 @@ func (s *SettingsService) setupInstanceID(ctx context.Context) error {}func (s *SettingsService) GetBoolSetting(ctx context.Context, key string, defaultValue bool) bool {- cfg := s.GetSettingsConfig()+ cfg := s.getEffectiveSettingsConfig(ctx)val, _, _, err := cfg.FieldByKey(key)if err != nil || val == "" {return defaultValue@@ -894,7 +899,7 @@ func (s *SettingsService) GetBoolSetting(ctx context.Context, key string, defaul}func (s *SettingsService) GetIntSetting(ctx context.Context, key string, defaultValue int) int {- cfg := s.GetSettingsConfig()+ cfg := s.getEffectiveSettingsConfig(ctx)val, _, _, err := cfg.FieldByKey(key)if err != nil || val == "" {return defaultValue@@ -907,7 +912,7 @@ func (s *SettingsService) GetIntSetting(ctx context.Context, key string, default}func (s *SettingsService) GetStringSetting(ctx context.Context, key, defaultValue string) string {- cfg := s.GetSettingsConfig()+ cfg := s.getEffectiveSettingsConfig(ctx)val, _, _, err := cfg.FieldByKey(key)if err != nil || val == "" {return defaultValuediff --git a/backend/internal/services/settings_service_test.go b/backend/internal/services/settings_service_test.goindex e132dd467..369d0f363 100644--- a/backend/internal/services/settings_service_test.go+++ b/backend/internal/services/settings_service_test.go@@ -275,6 +275,22 @@ func TestSettingsService_GetSettings_EnvOverride_TrivyRuntimeSecurity(t *testingrequire.True(t, settings2.TrivyPrivileged.IsTrue())}+func TestSettingsService_GetStringSetting_EnvOverride_SwarmStackSourcesDirectory(t *testing.T) {+ ctx := context.Background()+ db := setupSettingsTestDB(t)++ svc, err := NewSettingsService(ctx, db)+ require.NoError(t, err)+ require.NoError(t, svc.UpdateSetting(ctx, "swarmStackSourcesDirectory", "/tmp/swarm-from-db"))++ require.Equal(t, "/tmp/swarm-from-db", svc.GetStringSetting(ctx, "swarmStackSourcesDirectory", "/fallback"))++ t.Setenv("SWARM_STACK_SOURCES_DIRECTORY", "/mnt/swarm-from-env")++ require.Equal(t, "/mnt/swarm-from-env", svc.GetStringSetting(ctx, "swarmStackSourcesDirectory", "/fallback"))+ require.Equal(t, "/tmp/swarm-from-db", svc.GetSettingsConfig().SwarmStackSourcesDirectory.Value)+}+func TestSettingsService_isEnvOverrideActiveInternal(t *testing.T) {ctx := context.Background()db := setupSettingsTestDB(t)diff --git a/backend/internal/services/swarm_service.go b/backend/internal/services/swarm_service.goindex 918d097fb..74c6aedb3 100644--- a/backend/internal/services/swarm_service.go+++ b/backend/internal/services/swarm_service.go@@ -748,7 +748,7 @@ func (s *SwarmService) ListTasksPaginated(ctx context.Context, params paginationreturn result.Items, paginationResp, nil}-func (s *SwarmService) ListStacksPaginated(ctx context.Context, params pagination.QueryParams) ([]swarmtypes.StackSummary, pagination.Response, error) {+func (s *SwarmService) ListStacksPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]swarmtypes.StackSummary, pagination.Response, error) {if err := s.ensureSwarmManagerInternal(ctx); err != nil {return nil, pagination.Response{}, err}@@ -793,6 +793,18 @@ func (s *SwarmService) ListStacksPaginated(ctx context.Context, params paginatio}}+ persistedStacks, err := s.listPersistedStackSourcesInternal(ctx, environmentID)+ if err != nil {+ return nil, pagination.Response{}, err+ }+ for stackName, persisted := range persistedStacks {+ if _, exists := stacks[stackName]; exists {+ continue+ }+ stack := persisted+ stacks[stackName] = &stack+ }+items := make([]swarmtypes.StackSummary, 0, len(stacks))for _, stack := range stacks {items = append(items, *stack)@@ -1226,7 +1238,6 @@ func (s *SwarmService) ListNodeTasksPaginated(ctx context.Context, nodeID string}func (s *SwarmService) GetStack(ctx context.Context, environmentID, stackName string) (*swarmtypes.StackInspect, error) {- _ = environmentIDif err := s.ensureSwarmManagerInternal(ctx); err != nil {return nil, err}@@ -1241,7 +1252,21 @@ func (s *SwarmService) GetStack(ctx context.Context, environmentID, stackName streturn nil, err}if len(services) == 0 {- return nil, cerrdefs.ErrNotFound+ persisted, err := s.getPersistedStackSourceSummaryInternal(ctx, environmentID, stackName)+ if err != nil {+ if cerrdefs.IsNotFound(err) {+ return nil, cerrdefs.ErrNotFound+ }+ return nil, err+ }++ return &swarmtypes.StackInspect{+ Name: persisted.Name,+ Namespace: persisted.Namespace,+ Services: persisted.Services,+ CreatedAt: persisted.CreatedAt,+ UpdatedAt: persisted.UpdatedAt,+ }, nil}createdAt := services[0].CreatedAt@@ -1302,6 +1327,83 @@ func (s *SwarmService) GetStackSource(ctx context.Context, environmentID, stackN}, nil}+func (s *SwarmService) listPersistedStackSourcesInternal(ctx context.Context, environmentID string) (map[string]swarmtypes.StackSummary, error) {+ _, environmentDir, err := s.resolveSwarmStackSourceEnvironmentDirInternal(ctx, environmentID)+ if err != nil {+ return nil, err+ }++ entries, err := os.ReadDir(environmentDir)+ if err != nil {+ if errors.Is(err, os.ErrNotExist) {+ return map[string]swarmtypes.StackSummary{}, nil+ }+ return nil, fmt.Errorf("failed to list swarm stack source directories: %w", err)+ }++ stacks := make(map[string]swarmtypes.StackSummary, len(entries))+ for _, entry := range entries {+ if !entry.IsDir() {+ continue+ }++ summary, err := s.buildPersistedStackSourceSummaryInternal(filepath.Join(environmentDir, entry.Name()), entry.Name())+ if err != nil {+ if cerrdefs.IsNotFound(err) {+ continue+ }+ return nil, err+ }++ stacks[summary.Name] = *summary+ }++ return stacks, nil+}++func (s *SwarmService) getPersistedStackSourceSummaryInternal(ctx context.Context, environmentID, stackName string) (*swarmtypes.StackSummary, error) {+ _, stackSourceDir, err := s.resolveSwarmStackSourceDirInternal(ctx, environmentID, stackName)+ if err != nil {+ return nil, err+ }++ return s.buildPersistedStackSourceSummaryInternal(stackSourceDir, stackName)+}++func (s *SwarmService) buildPersistedStackSourceSummaryInternal(stackSourceDir, stackName string) (*swarmtypes.StackSummary, error) {+ composeInfo, err := os.Stat(filepath.Join(stackSourceDir, swarmStackComposeFilename))+ if err != nil {+ if errors.Is(err, os.ErrNotExist) {+ return nil, cerrdefs.ErrNotFound+ }+ return nil, fmt.Errorf("failed to stat swarm stack compose source: %w", err)+ }++ createdAt := composeInfo.ModTime()+ updatedAt := composeInfo.ModTime()++ envInfo, err := os.Stat(filepath.Join(stackSourceDir, swarmStackEnvFilename))+ if err == nil {+ if envInfo.ModTime().Before(createdAt) {+ createdAt = envInfo.ModTime()+ }+ if envInfo.ModTime().After(updatedAt) {+ updatedAt = envInfo.ModTime()+ }+ } else if !errors.Is(err, os.ErrNotExist) {+ return nil, fmt.Errorf("failed to stat swarm stack env source: %w", err)+ }++ return &swarmtypes.StackSummary{+ ID: stackName,+ Name: stackName,+ Namespace: stackName,+ Services: 0,+ CreatedAt: createdAt,+ UpdatedAt: updatedAt,+ }, nil+}+func (s *SwarmService) RemoveStack(ctx context.Context, environmentID, stackName string) error {if err := s.ensureSwarmManagerInternal(ctx); err != nil {return err@@ -1322,7 +1424,14 @@ func (s *SwarmService) RemoveStack(ctx context.Context, environmentID, stackNamereturn err}if len(services) == 0 {- return cerrdefs.ErrNotFound+ if _, err := s.getPersistedStackSourceSummaryInternal(ctx, environmentID, stackName); err != nil {+ if cerrdefs.IsNotFound(err) {+ return cerrdefs.ErrNotFound+ }+ return err+ }++ return s.deleteStackSourceInternal(ctx, environmentID, stackName)}serviceIDs := make(map[string]struct{}, len(services))@@ -1978,6 +2087,20 @@ func (s *SwarmService) resolveSwarmStackSourceDirInternal(ctx context.Context, ereturn "", "", errors.New("invalid stack name")}+ rootDir, environmentDir, err := s.resolveSwarmStackSourceEnvironmentDirInternal(ctx, environmentID)+ if err != nil {+ return "", "", err+ }++ stackSourceDir := filepath.Clean(filepath.Join(environmentDir, normalizedStackName))+ if !appfs.IsSafeSubdirectory(rootDir, stackSourceDir) {+ return "", "", errors.New("swarm stack source path escapes storage root")+ }++ return rootDir, stackSourceDir, nil+}++func (s *SwarmService) resolveSwarmStackSourceEnvironmentDirInternal(ctx context.Context, environmentID string) (string, string, error) {normalizedEnvironmentID := appfs.SanitizeProjectName(normalizeSwarmEnvironmentIDInternal(environmentID))if normalizedEnvironmentID == "" || strings.Trim(normalizedEnvironmentID, "_") == "" {normalizedEnvironmentID = "0"@@ -1989,12 +2112,12 @@ func (s *SwarmService) resolveSwarmStackSourceDirInternal(ctx context.Context, e}rootDir := appfs.ResolveConfiguredContainerDirectory(configuredRootDir, defaultSwarmStackSourceRootDir)- stackSourceDir := filepath.Clean(filepath.Join(rootDir, normalizedEnvironmentID, normalizedStackName))- if !appfs.IsSafeSubdirectory(rootDir, stackSourceDir) {- return "", "", errors.New("swarm stack source path escapes storage root")+ environmentDir := filepath.Clean(filepath.Join(rootDir, normalizedEnvironmentID))+ if !appfs.IsSafeSubdirectory(rootDir, environmentDir) {+ return "", "", errors.New("swarm stack source environment path escapes storage root")}- return rootDir, stackSourceDir, nil+ return rootDir, environmentDir, nil}func (s *SwarmService) ensureSwarmManagerInternal(ctx context.Context) error {diff --git a/frontend/src/routes/(app)/swarm/stacks/[name]/+page.svelte b/frontend/src/routes/(app)/swarm/stacks/[name]/+page.svelteindex f0bfc5949..4dfebdffa 100644--- a/frontend/src/routes/(app)/swarm/stacks/[name]/+page.svelte+++ b/frontend/src/routes/(app)/swarm/stacks/[name]/+page.svelte@@ -2,38 +2,52 @@import { goto } from '$app/navigation';import { ArcaneButton } from '$lib/components/arcane-button/index.js';import { TabBar, type TabItem } from '$lib/components/tab-bar';+ import CodeEditor from '$lib/components/code-editor/editor.svelte';+ import * as Card from '$lib/components/ui/card';import * as Tabs from '$lib/components/ui/tabs';import { useEnvironmentRefresh } from '$lib/hooks/use-environment-refresh.svelte';- import { LayersIcon, DockIcon, JobsIcon, TrashIcon, EditIcon } from '$lib/icons';+ import { LayersIcon, DockIcon, JobsIcon, TrashIcon, EditIcon, FileTextIcon, CodeIcon } from '$lib/icons';import { ResourcePageLayout, type ActionButton, type StatCardConfig } from '$lib/layouts/index.js';import { m } from '$lib/paraglide/messages';import { swarmService } from '$lib/services/swarm-service';import { handleApiResultWithCallbacks } from '$lib/utils/api.util';- import { parallelRefresh } from '$lib/utils/refresh.util';import { tryCatch } from '$lib/utils/try-catch';+ import { onMount } from 'svelte';import { untrack } from 'svelte';import { toast } from 'svelte-sonner';import { openConfirmDialog } from '$lib/components/confirm-dialog';import SwarmServicesTable from '../../services/services-table.svelte';import SwarmTasksTable from '../../tasks/tasks-table.svelte';+ import type { SwarmStackSource } from '$lib/types/swarm.type';let { data } = $props();let stack = $state(untrack(() => data.stack));let services = $state(untrack(() => data.services));let tasks = $state(untrack(() => data.tasks));+ let source = $state<SwarmStackSource | null>(untrack(() => data.source));+ let sourceState = $state<'loading' | 'available' | 'missing' | 'forbidden' | 'error'>(untrack(() => data.sourceState));let servicesRequestOptions = $state(untrack(() => data.servicesRequestOptions));let tasksRequestOptions = $state(untrack(() => data.tasksRequestOptions));- let selectedTab = $state<'services' | 'tasks'>('services');+ type StackTab = 'services' | 'tasks' | 'source';+ let selectedTab = $state<StackTab>(+ untrack(() => ((data.stack?.services ?? 0) > 0 ? 'services' : data.sourceState !== 'forbidden' ? 'source' : 'services'))+ );let isLoading = $state({ refresh: false, remove: false });const stackName = $derived(stack?.name ?? data.stackName);+ const hasLiveStack = $derived((stack?.services ?? 0) > 0);+ const canViewSource = $derived(sourceState !== 'forbidden');const tabItems = $derived<TabItem[]>([- { value: 'services', label: m.swarm_services_title(), icon: DockIcon },- { value: 'tasks', label: m.swarm_tasks_title(), icon: JobsIcon }+ ...(hasLiveStack ? [{ value: 'services', label: m.swarm_services_title(), icon: DockIcon }] : []),+ ...(hasLiveStack ? [{ value: 'tasks', label: m.swarm_tasks_title(), icon: JobsIcon }] : []),+ ...(canViewSource ? [{ value: 'source', label: 'Source', icon: FileTextIcon }] : [])]);const totalServices = $derived(services?.pagination?.totalItems ?? services?.data?.length ?? 0);const totalTasks = $derived(tasks?.pagination?.totalItems ?? tasks?.data?.length ?? 0);+ const stackSubtitle = $derived(+ hasLiveStack ? m.swarm_stack_namespace({ namespace: stack?.namespace ?? stackName }) : `Saved source for ${stackName}`+ );async function fetchStackServices(options: typeof servicesRequestOptions) {return swarmService.getStackServices(stackName, options);@@ -43,37 +57,75 @@return swarmService.getStackTasks(stackName, options);}+ async function refreshSource(showErrorToast = false) {+ try {+ source = await swarmService.getStackSource(stackName);+ sourceState = 'available';+ } catch (err: any) {+ if (err?.status === 404) {+ source = null;+ sourceState = 'missing';+ return;+ }+ if (err?.status === 403) {+ source = null;+ sourceState = 'forbidden';+ return;+ }++ source = null;+ sourceState = 'error';+ if (showErrorToast) {+ toast.error(m.common_refresh_failed({ resource: `saved source (${stackName})` }));+ }+ }+ }+async function refresh() {- await parallelRefresh(- {- stack: {- fetch: () => swarmService.getStack(stackName),- onSuccess: (value) => {- stack = value;- },- errorMessage: m.common_refresh_failed({ resource: `${m.swarm_stack()} "${stackName}"` })- },- services: {- fetch: () => swarmService.getStackServices(stackName, servicesRequestOptions),- onSuccess: (value) => {- services = value;- },- errorMessage: m.common_refresh_failed({ resource: `${m.swarm_services_title()} (${stackName})` })- },- tasks: {- fetch: () => swarmService.getStackTasks(stackName, tasksRequestOptions),- onSuccess: (value) => {- tasks = value;- },- errorMessage: m.common_refresh_failed({ resource: `${m.swarm_tasks_title()} (${stackName})` })- }- },- (v) => (isLoading.refresh = v)- );+ isLoading.refresh = true;+ try {+ const [stackResult, servicesResult, tasksResult] = await Promise.allSettled([+ swarmService.getStack(stackName),+ swarmService.getStackServices(stackName, servicesRequestOptions),+ swarmService.getStackTasks(stackName, tasksRequestOptions)+ ]);++ if (stackResult.status === 'fulfilled') {+ stack = stackResult.value;+ } else {+ toast.error(m.common_refresh_failed({ resource: `${m.swarm_stack()} "${stackName}"` }));+ }++ if (servicesResult.status === 'fulfilled') {+ services = servicesResult.value;+ } else {+ toast.error(m.common_refresh_failed({ resource: `${m.swarm_services_title()} (${stackName})` }));+ }++ if (tasksResult.status === 'fulfilled') {+ tasks = tasksResult.value;+ } else {+ toast.error(m.common_refresh_failed({ resource: `${m.swarm_tasks_title()} (${stackName})` }));+ }+ await refreshSource(true);+ } finally {+ isLoading.refresh = false;+ }}useEnvironmentRefresh(refresh);+ onMount(() => {+ void refreshSource();+ });++ $effect(() => {+ const validTabs = tabItems.map((item) => item.value as StackTab);+ if (validTabs.length > 0 && !validTabs.includes(selectedTab)) {+ selectedTab = validTabs[0];+ }+ });+function handleDelete() {openConfirmDialog({title: m.common_delete_title({ resource: m.swarm_stack() }),@@ -140,21 +192,23 @@]);</script>-<ResourcePageLayout- title={stackName}- subtitle={m.swarm_stack_namespace({ namespace: stack?.namespace ?? stackName })}- icon={LayersIcon}- {actionButtons}- {statCards}->+<ResourcePageLayout title={stackName} subtitle={stackSubtitle} icon={LayersIcon} {actionButtons} {statCards}>{#snippet mainContent()}- <div class="space-y-4">- <Tabs.Root value={selectedTab}>+ <div class="flex min-h-[calc(100vh-18rem)] flex-col gap-4">+ {#if !hasLiveStack && canViewSource}+ <Card.Root variant="subtle">+ <Card.Content class="p-4 text-sm">+ This stack is not currently deployed, but Arcane still found its saved source files.+ </Card.Content>+ </Card.Root>+ {/if}++ <Tabs.Root value={selectedTab} class="flex min-h-0 flex-1 flex-col"><div class="w-fit pb-3">- <TabBar items={tabItems} value={selectedTab} onValueChange={(value) => (selectedTab = value as 'services' | 'tasks')} />+ <TabBar items={tabItems} value={selectedTab} onValueChange={(value) => (selectedTab = value as StackTab)} /></div>- <Tabs.Content value="services">+ <Tabs.Content value="services" class="min-h-0 flex-1"><SwarmServicesTablebind:servicesbind:requestOptions={servicesRequestOptions}@@ -162,7 +216,7 @@persistKey={`arcane-swarm-stack-services-table-${stackName}`}/></Tabs.Content>- <Tabs.Content value="tasks">+ <Tabs.Content value="tasks" class="min-h-0 flex-1"><SwarmTasksTablebind:tasksbind:requestOptions={tasksRequestOptions}@@ -170,6 +224,79 @@persistKey={`arcane-swarm-stack-tasks-table-${stackName}`}/></Tabs.Content>+ <Tabs.Content value="source" class="flex min-h-0 flex-1 flex-col">+ {#if sourceState === 'available' && source}+ <div class="grid min-h-0 flex-1 auto-rows-fr gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]">+ <Card.Root class="flex min-h-0 min-w-0 flex-col overflow-hidden">+ <Card.Header icon={CodeIcon} class="flex-shrink-0">+ <Card.Title>+ <h2>{m.common_docker_compose()}</h2>+ </Card.Title>+ </Card.Header>+ <Card.Content class="relative z-0 flex min-h-0 flex-1 flex-col overflow-visible p-0">+ <div class="absolute inset-0 min-h-0 w-full min-w-0 rounded-b-xl">+ <CodeEditor+ value={source.composeContent}+ language="yaml"+ readOnly={true}+ fontSize="13px"+ fileId={`swarm-stack-source:${stackName}:compose.yaml`}+ />+ </div>+ </Card.Content>+ </Card.Root>++ <Card.Root class="flex min-h-0 min-w-0 flex-col overflow-hidden">+ <Card.Header icon={FileTextIcon} class="flex-shrink-0">+ <Card.Title>+ <h2>{m.environment_file()}</h2>+ </Card.Title>+ </Card.Header>+ <Card.Content class="relative z-0 flex min-h-0 flex-1 flex-col overflow-visible p-0">+ {#if source.envContent?.trim()}+ <div class="absolute inset-0 min-h-0 w-full min-w-0 rounded-b-xl">+ <CodeEditor+ value={source.envContent}+ language="env"+ readOnly={true}+ fontSize="13px"+ fileId={`swarm-stack-source:${stackName}:.env`}+ />+ </div>+ {:else}+ <div class="text-muted-foreground flex flex-1 items-center justify-center p-6 text-center text-sm">+ No saved `.env` file was stored for this stack.+ </div>+ {/if}+ </Card.Content>+ </Card.Root>+ </div>+ {:else if sourceState === 'loading'}+ <Card.Root variant="subtle">+ <Card.Content class="text-muted-foreground p-6 text-center text-sm">Loading saved source...</Card.Content>+ </Card.Root>+ {:else if sourceState === 'missing'}+ <Card.Root variant="subtle">+ <Card.Content class="p-6 text-sm">+ <div class="space-y-2">+ <p class="font-medium">{m.common_not_found_title({ resource: 'Saved source' })}</p>+ <p class="text-muted-foreground">+ {m.common_not_found_description({ resource: 'saved source' })}+ </p>+ </div>+ </Card.Content>+ </Card.Root>+ {:else if sourceState === 'error'}+ <Card.Root variant="subtle">+ <Card.Content class="p-6 text-sm">+ <div class="space-y-2">+ <p class="font-medium">{m.common_action_failed()}</p>+ <p class="text-muted-foreground">Arcane couldn’t load the saved source files for this stack.</p>+ </div>+ </Card.Content>+ </Card.Root>+ {/if}+ </Tabs.Content></Tabs.Root></div>{/snippet}diff --git a/frontend/src/routes/(app)/swarm/stacks/[name]/+page.ts b/frontend/src/routes/(app)/swarm/stacks/[name]/+page.tsindex 3e153106b..cfb4eb0ef 100644--- a/frontend/src/routes/(app)/swarm/stacks/[name]/+page.ts+++ b/frontend/src/routes/(app)/swarm/stacks/[name]/+page.ts@@ -4,6 +4,8 @@ import type { SearchPaginationSortRequest } from '$lib/types/pagination.type';import { resolveInitialTableRequest } from '$lib/utils/table-persistence.util';import type { PageLoad } from './$types';+type StackSourceState = 'loading' | 'available' | 'missing' | 'forbidden' | 'error';+export const load: PageLoad = async ({ params }) => {const stackName = decodeURIComponent(params.name);const servicesRequestOptions = resolveInitialTableRequest(`arcane-swarm-stack-services-table-${stackName}`, {@@ -39,6 +41,8 @@ export const load: PageLoad = async ({ params }) => {stackName,services,tasks,+ source: null,+ sourceState: 'loading' as StackSourceState,servicesRequestOptions,tasksRequestOptions};