feat: add server upgrade action — force-pull latest images and re-provision
Restart only stops/starts existing containers with the same image. The new upgrade action removes server + UI containers, force-pulls the latest Docker images, then re-provisions (preserving app containers, volumes, and networks). Available to both vendor (tenant detail) and tenant admin (dashboard). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,14 @@ export function useRestartServer() {
|
||||
});
|
||||
}
|
||||
|
||||
export function useUpgradeServer() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation<void, Error, void>({
|
||||
mutationFn: () => api.post('/tenant/server/upgrade'),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['tenant', 'dashboard'] }),
|
||||
});
|
||||
}
|
||||
|
||||
export function useTenantLicense() {
|
||||
return useQuery<TenantLicenseData>({
|
||||
queryKey: ['tenant', 'license'],
|
||||
|
||||
@@ -62,6 +62,14 @@ export function useRestartServer() {
|
||||
});
|
||||
}
|
||||
|
||||
export function useUpgradeServer() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation<void, Error, string>({
|
||||
mutationFn: (id) => api.post(`/vendor/tenants/${id}/upgrade`),
|
||||
onSuccess: (_, id) => qc.invalidateQueries({ queryKey: ['vendor', 'tenants', id] }),
|
||||
});
|
||||
}
|
||||
|
||||
export function useRenewLicense() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation<LicenseResponse, Error, string>({
|
||||
|
||||
Reference in New Issue
Block a user