package components import ( "fmt" "github.com/starfleetcptn/gomft/internal/db" "context" ) type JobFormData struct { Job *db.Job Configs []db.TransferConfig IsNew bool } func getJobFormTitle(isNew bool) string { if isNew { return "New Job" } return "Edit Job" } func getJobTitle(isNew bool) string { if isNew { return "Create New Job" } return "Edit Job" } // configSelected checks if a config ID is selected for a job func configSelected(job *db.Job, configID uint) bool { if job.ConfigIDs != "" { // If ConfigIDs is populated, only check against those IDs for _, id := range job.GetConfigIDsList() { if id == configID { return true } } return false } else { // If ConfigIDs is empty, fall back to checking the primary ConfigID return job.ConfigID == configID } } templ configSearchScript() { } templ JobForm(ctx context.Context, data JobFormData) { @LayoutWithContext(getJobFormTitle(data.IsNew), ctx) { @configSearchScript()

{ getJobTitle(data.IsNew) }

Configure your scheduled transfer job

if data.IsNew {

Descriptive name for this job (optional). If not provided, the config name will be used.

if len(data.Configs) > 0 { for _, config := range data.Configs {
} } else {
No configurations available. Create one
}

Use the arrows to change the order in which configurations will execute.

Use standard cron expression format. Example: */15 * * * * (every 15 minutes)

Jobs that are not enabled will not run automatically on schedule.

Webhook Notifications

The URL where notifications will be sent when jobs run

Used to sign webhook payloads (X-Hub-Signature-256 header)

Additional HTTP headers as JSON

Cancel
} else {

Descriptive name for this job (optional). If not provided, the config name will be used.

if len(data.Configs) > 0 { for _, config := range data.Configs {
} } else {
No configurations available. Create one
}

Use the arrows to change the order in which configurations will execute.

Use standard cron expression format. Example: */15 * * * * (every 15 minutes)

Jobs that are not enabled will not run automatically on schedule.

Webhook Notifications

The URL where notifications will be sent when jobs run

Used to sign webhook payloads (X-Hub-Signature-256 header)

Additional HTTP headers as JSON

Cancel
}

Jobs will run according to their schedule and execute the selected transfer configurations in the order specified

Need help with cron expressions? Try crontab.guru
} }