feat: async tenant provisioning with polling UX
Some checks failed
CI / build (push) Failing after 39s
CI / docker (push) Has been skipped

Backend: extract Docker provisioning into @Async method so the API
returns immediately with status=PROVISIONING. The tenant record, Logto
org, admin user, and license are created synchronously; container
provisioning, health check, license push, and OIDC config happen in a
background thread.

Frontend: navigate to tenant detail page immediately after creation.
Detail page polls every 3s while status=PROVISIONING and shows a
spinner indicator. Toast notification when provisioning completes.
Fixes #52.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-10 17:14:26 +02:00
parent 269c679e9c
commit 252c18bcff
4 changed files with 72 additions and 22 deletions

View File

@@ -10,11 +10,15 @@ export function useVendorTenants() {
});
}
export function useVendorTenant(id: string | null) {
export function useVendorTenant(
id: string | null,
options?: { refetchInterval?: number | false | ((query: { state: { data: VendorTenantDetail | undefined } }) => number | false) },
) {
return useQuery<VendorTenantDetail>({
queryKey: ['vendor', 'tenants', id],
queryFn: () => api.get(`/vendor/tenants/${id}`),
enabled: !!id,
refetchInterval: options?.refetchInterval as any,
});
}