mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-09 21:45:17 +00:00
- Introduced new fields in the schedule schema: `serviceName`, `scheduleType`, and `script`, allowing for more flexible schedule configurations. - Updated the `HandleSchedules` component to incorporate the new fields, enhancing user input options for schedule creation and updates. - Refactored the `ShowSchedules` component to support the new `scheduleType` and display relevant information based on the selected type. - Improved API handling for schedule creation and updates to accommodate the new fields, ensuring proper validation and error handling. - Added a new `ShowSchedulesModal` component for better integration of schedule viewing in server settings, enhancing user experience.
29 lines
854 B
TypeScript
29 lines
854 B
TypeScript
import { useState } from "react";
|
|
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
|
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
|
import { ShowSchedules } from "@/components/dashboard/application/schedules/show-schedules";
|
|
|
|
interface Props {
|
|
serverId: string;
|
|
}
|
|
|
|
export const ShowSchedulesModal = ({ serverId }: Props) => {
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
|
|
return (
|
|
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
|
<DialogTrigger asChild>
|
|
<DropdownMenuItem
|
|
className="w-full cursor-pointer "
|
|
onSelect={(e) => e.preventDefault()}
|
|
>
|
|
Show Schedules
|
|
</DropdownMenuItem>
|
|
</DialogTrigger>
|
|
<DialogContent className="sm:max-w-5xl overflow-y-auto max-h-screen ">
|
|
<ShowSchedules id={serverId} scheduleType="server" />
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
};
|