feat: async tenant provisioning with polling UX
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:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user