feat(frontend): backup jobs page

This commit is contained in:
Nicolas Meienberger
2025-11-01 17:09:43 +01:00
parent d81f3653ec
commit 18115b374c
19 changed files with 459 additions and 38 deletions

View File

@@ -1,5 +1,7 @@
import { type } from "arktype";
import { describeRoute, resolver } from "hono-openapi";
import { volumeSchema } from "../volumes/volume.dto";
import { repositorySchema } from "../repositories/repositories.dto";
const retentionPolicySchema = type({
keepLast: "number?",
@@ -58,7 +60,12 @@ export const listBackupSchedulesDto = describeRoute({
/**
* Get a single backup schedule
*/
export const getBackupScheduleResponse = backupScheduleSchema;
export const getBackupScheduleResponse = backupScheduleSchema.and(
type({
volume: volumeSchema,
repository: repositorySchema,
}),
);
export type GetBackupScheduleDto = typeof getBackupScheduleResponse.infer;

View File

@@ -34,6 +34,10 @@ const listSchedules = async () => {
const getSchedule = async (scheduleId: number) => {
const schedule = await db.query.backupSchedulesTable.findFirst({
where: eq(volumesTable.id, scheduleId),
with: {
volume: true,
repository: true,
},
});
if (!schedule) {

View File

@@ -7,7 +7,7 @@ import {
import { type } from "arktype";
import { describeRoute, resolver } from "hono-openapi";
const repositorySchema = type({
export const repositorySchema = type({
id: "string",
name: "string",
type: type.valueOf(REPOSITORY_BACKENDS),

View File

@@ -2,7 +2,7 @@ import { BACKEND_STATUS, BACKEND_TYPES, volumeConfigSchema } from "@ironmount/sc
import { type } from "arktype";
import { describeRoute, resolver } from "hono-openapi";
const volumeSchema = type({
export const volumeSchema = type({
id: "number",
name: "string",
path: "string",