feat(scheduler): добавить расписание бэкапов и автообновление сертификатов
Docker images / prepare-release (push) Successful in 6s
Docker images / backend-image (push) Successful in 2m13s
Docker images / frontend-image (push) Successful in 2m11s
Docker images / updater-image (push) Successful in 50s
Docker images / notify-webhook (push) Has been skipped
Docker images / publish-release (push) Successful in 8s
Docker images / prepare-release (push) Successful in 6s
Docker images / backend-image (push) Successful in 2m13s
Docker images / frontend-image (push) Successful in 2m11s
Docker images / updater-image (push) Successful in 50s
Docker images / notify-webhook (push) Has been skipped
Docker images / publish-release (push) Successful in 8s
This commit is contained in:
+16
-1
@@ -1,4 +1,5 @@
|
||||
import { requestJson } from "@/shared/api/http-client"
|
||||
import type { BackupScheduleSettingsDto } from "@mmapp/contracts/backups"
|
||||
|
||||
export type BackupItem = {
|
||||
id: string
|
||||
@@ -7,7 +8,7 @@ export type BackupItem = {
|
||||
filename: string
|
||||
sizeBytes: number
|
||||
createdAt: string
|
||||
kind: "manual"
|
||||
kind: "manual" | "auto"
|
||||
notes?: string
|
||||
}
|
||||
|
||||
@@ -66,3 +67,17 @@ export async function getBackupJob(baseUrl: string, jobId: string): Promise<Back
|
||||
export async function deleteBackup(baseUrl: string, id: string): Promise<void> {
|
||||
await requestJson<void>(baseUrl, `/api/backups/${id}`, { method: "DELETE" })
|
||||
}
|
||||
|
||||
export async function getBackupScheduleSettings(baseUrl: string): Promise<BackupScheduleSettingsDto> {
|
||||
return requestJson<BackupScheduleSettingsDto>(baseUrl, "/api/backups/schedule")
|
||||
}
|
||||
|
||||
export async function putBackupScheduleSettings(
|
||||
baseUrl: string,
|
||||
payload: Partial<BackupScheduleSettingsDto>,
|
||||
): Promise<BackupScheduleSettingsDto> {
|
||||
return requestJson<BackupScheduleSettingsDto>(baseUrl, "/api/backups/schedule", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import type {
|
||||
AcmeCloudflareSettingsDto,
|
||||
CertificateIssueJob,
|
||||
CertificateIssueRequest,
|
||||
CertificateRenewSettingsDto,
|
||||
CertificatesListResponse,
|
||||
} from "@mmapp/contracts/certificates"
|
||||
import { requestJson } from "@/shared/api/http-client"
|
||||
@@ -58,3 +59,21 @@ export async function testAcmeSettings(
|
||||
body: JSON.stringify(payload ?? {}),
|
||||
})
|
||||
}
|
||||
|
||||
export async function getCertificateRenewSettings(baseUrl: string): Promise<CertificateRenewSettingsDto> {
|
||||
return requestJson<CertificateRenewSettingsDto>(baseUrl, "/api/certificates/renew-settings")
|
||||
}
|
||||
|
||||
export async function putCertificateRenewSettings(
|
||||
baseUrl: string,
|
||||
payload: {
|
||||
enabled?: boolean
|
||||
intervalSec?: number
|
||||
renewBeforeDays?: number
|
||||
},
|
||||
): Promise<CertificateRenewSettingsDto> {
|
||||
return requestJson<CertificateRenewSettingsDto>(baseUrl, "/api/certificates/renew-settings", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user