feat: add restart server action for vendor and tenant
Some checks failed
CI / build (push) Failing after 36s
CI / docker (push) Has been skipped

Vendor: POST /api/vendor/tenants/{id}/restart (platform:admin scope)
Tenant: POST /api/tenant/server/restart (tenant:manage scope)

Both call TenantProvisioner.stop() then start() on the server + UI
containers. Restart button on vendor TenantDetailPage (Actions card)
and tenant TenantDashboardPage (Server card). Allowed in any status
including PROVISIONING.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-10 17:21:14 +02:00
parent 252c18bcff
commit 7e7a07470b
8 changed files with 96 additions and 3 deletions

View File

@@ -10,6 +10,14 @@ export function useTenantDashboard() {
});
}
export function useRestartServer() {
const qc = useQueryClient();
return useMutation<void, Error, void>({
mutationFn: () => api.post('/tenant/server/restart'),
onSuccess: () => qc.invalidateQueries({ queryKey: ['tenant', 'dashboard'] }),
});
}
export function useTenantLicense() {
return useQuery<TenantLicenseData>({
queryKey: ['tenant', 'license'],

View File

@@ -54,6 +54,14 @@ export function useDeleteTenant() {
});
}
export function useRestartServer() {
const qc = useQueryClient();
return useMutation<void, Error, string>({
mutationFn: (id) => api.post(`/vendor/tenants/${id}/restart`),
onSuccess: (_, id) => qc.invalidateQueries({ queryKey: ['vendor', 'tenants', id] }),
});
}
export function useRenewLicense() {
const qc = useQueryClient();
return useMutation<LicenseResponse, Error, string>({