Skip to content

Commit e548a9d

Browse files
committed
feat(certificates): Add per-cert renewal and auto-renew controls
Clicking a certificate now opens a details view showing its deployment link, with actions to renew it immediately or toggle auto-renewal. Each card exposes a quick renew shortcut, and deployments gain a Renew SSL action that renews all their certificates at once.
1 parent 1e3737b commit e548a9d

3 files changed

Lines changed: 384 additions & 10 deletions

File tree

src/services/api.ts

100644100755
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,25 @@ export const networksApi = {
157157

158158
export const certificatesApi = {
159159
list: () => apiClient.get<{ certificates: Certificate[] }>("/certificates"),
160+
get: (domain: string) => apiClient.get<{ certificate: Certificate }>(`/certificates/${encodeURIComponent(domain)}`),
160161
request: (domain: string) =>
161162
apiClient.post<{ message: string; result: any }>("/certificates", {
162163
domain,
163164
}),
164165
renew: () => apiClient.post<{ message: string; result: any }>("/certificates/renew"),
165-
delete: (domain: string) => apiClient.delete(`/certificates/${domain}`),
166+
renewOne: (domain: string) =>
167+
apiClient.post<{ message: string; domain: string; result: any }>(
168+
`/certificates/${encodeURIComponent(domain)}/renew`,
169+
),
170+
setAutoRenew: (domain: string, autoRenew: boolean) =>
171+
apiClient.patch<{ domain: string; auto_renew: boolean }>(`/certificates/${encodeURIComponent(domain)}/auto-renew`, {
172+
auto_renew: autoRenew,
173+
}),
174+
renewDeployment: (name: string) =>
175+
apiClient.post<{ message: string; deployment: string; result: any }>(
176+
`/deployments/${encodeURIComponent(name)}/certificates/renew`,
177+
),
178+
delete: (domain: string) => apiClient.delete(`/certificates/${encodeURIComponent(domain)}`),
166179
};
167180

168181
export const proxyApi = {

0 commit comments

Comments
 (0)