feat: AutoSSL certificate management tool with Web UI
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
timeout: 60000,
|
||||
})
|
||||
|
||||
export interface Certificate {
|
||||
id: number
|
||||
domain: string
|
||||
email: string
|
||||
provider: string
|
||||
challenge_type: string
|
||||
dns_provider: string
|
||||
dns_config: string
|
||||
status: string
|
||||
cert_url: string
|
||||
expires_at: string | null
|
||||
last_renewed_at: string | null
|
||||
error_message: string
|
||||
auto_renew: boolean
|
||||
renew_days: number
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface Stats {
|
||||
total: number
|
||||
active: number
|
||||
expired: number
|
||||
errors: number
|
||||
}
|
||||
|
||||
export interface CreateCertRequest {
|
||||
domain: string
|
||||
email: string
|
||||
provider?: string
|
||||
challenge_type?: string
|
||||
dns_provider?: string
|
||||
dns_config?: string
|
||||
auto_renew?: boolean
|
||||
renew_days?: number
|
||||
}
|
||||
|
||||
export const certApi = {
|
||||
list: () => api.get<Certificate[]>('/certificates'),
|
||||
get: (id: number) => api.get<Certificate>(`/certificates/${id}`),
|
||||
create: (data: CreateCertRequest) => api.post<Certificate>('/certificates', data),
|
||||
update: (id: number, data: Partial<Certificate>) => api.put<Certificate>(`/certificates/${id}`, data),
|
||||
delete: (id: number) => api.delete(`/certificates/${id}`),
|
||||
renew: (id: number) => api.post(`/certificates/${id}/renew`),
|
||||
files: (id: number) => api.get(`/certificates/${id}/files`),
|
||||
checkRenewals: () => api.get('/renewals/check'),
|
||||
stats: () => api.get<Stats>('/stats'),
|
||||
}
|
||||
Reference in New Issue
Block a user