Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
import { queryKeys } from '#lib/query/query-keys.js';
import { environmentManagementService } from '#lib/services/env-mgmt-service.js';
import { gitOpsSyncService } from '#lib/services/gitops-sync-service.js';
import type { SearchPaginationSortRequest } from '#lib/types/shared.js';
import { resolveInitialTableRequest } from '#lib/utils/tables.js';
import type { PageLoad } from './$types';
export const load: PageLoad = async ({ params, parent }) => {
const { queryClient } = await parent();
const environmentId = params.id;
const syncRequestOptions = resolveInitialTableRequest('arcane-gitops-syncs-table', {
pagination: {
page: 1,
limit: 20
},
sort: {
column: 'name',
direction: 'asc'
}
} satisfies SearchPaginationSortRequest);
const [environment, syncs] = await Promise.all([
queryClient.query({
queryKey: queryKeys.environments.detail(environmentId),
queryFn: () => environmentManagementService.get(environmentId)
}),
queryClient.query({
queryKey: queryKeys.gitOpsSyncs.list(environmentId, syncRequestOptions),
queryFn: () => gitOpsSyncService.getSyncs(environmentId, syncRequestOptions)
})
]);
return { environment, environmentId, syncs, syncRequestOptions };
};