mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-29 16:22:16 +00:00
Add schedule logs feature and enhance schedule management
- Introduced a new component `ShowSchedulesLogs` to display logs for each schedule, allowing users to view deployment logs associated with their schedules. - Updated the `ShowSchedules` component to integrate the new logs feature, providing a button to access logs for each schedule. - Enhanced the `schedule` schema by adding an `appName` column to better identify applications associated with schedules. - Updated the API to support fetching deployments with their associated schedules, improving data retrieval for the frontend. - Implemented utility functions for managing schedule-related operations, including creating and removing deployments linked to schedules.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { schedules } from "../db/schema/schedule";
|
||||
import { db } from "../db";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { TRPCError } from "@trpc/server";
|
||||
|
||||
export const findScheduleById = async (scheduleId: string) => {
|
||||
const schedule = await db.query.schedules.findFirst({
|
||||
where: eq(schedules.scheduleId, scheduleId),
|
||||
with: {
|
||||
application: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!schedule) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
message: "Schedule not found",
|
||||
});
|
||||
}
|
||||
return schedule;
|
||||
};
|
||||
Reference in New Issue
Block a user