All files / src/utils/workflow scheduleOptions.tsx

0% Statements 0/2
100% Branches 0/0
100% Functions 0/0
0% Lines 0/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73                                                                                                                                                 
import { InputTypes } from "../../types/inputs/index.ts";
 
export const scheduleOptions = [
  {
    id: "one_off",
    label: "Run once",
    options: [],
  },
  {
    id: "cron",
    label: "CRON",
    options: [
      {
        id: "cron",
        label: (
          <>
            Cron Schedule (See{" "}
            <a
              href="https://crontab.guru/#*/2_*_*_*_*"
              rel="noreferrer"
              target="_blank"
              className="text-violet-500">
              Docs
            </a>
            )
          </>
        ),
        inputType: InputTypes.CRON,
        placeholder: "Enter Cron Schedule",
      },
      {
        id: "duration",
        label: "Stop after (in seconds)",
        inputType: InputTypes.TEXT,
        placeholder: "Enter Duration (in seconds)",
        type: "number",
        length: 200,
        suffix: (
          <p className="text-xs text-gray-500 italic">
            Keeping this empty will keep it alive
          </p>
        ),
      },
    ],
  },
  {
    id: "interval",
    label: "Regular Intervals",
    options: [
      {
        id: "interval",
        label: "Interval (in seconds)",
        type: "number",
        inputType: InputTypes.TEXT,
        placeholder: "Enter Interval in seconds",
      },
      {
        id: "duration",
        label: "Stop after (in seconds)",
        inputType: InputTypes.TEXT,
        placeholder: "Enter Duration (in seconds)",
        type: "number",
        length: 200,
        suffix: (
          <p className="text-xs text-gray-500 italic">
            Keeping this empty will keep it alive
          </p>
        ),
      },
    ],
  },
];