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 scheduleBuilderScript() { } templ formValidationScript() { } templ JobForm(ctx context.Context, data JobFormData) { @LayoutWithContext(getJobFormTitle(data.IsNew), ctx) { @configSearchScript() @scheduleBuilderScript() @formValidationScript()

{ getJobTitle(data.IsNew) }

Configure your scheduled file transfer job using the form below

Job Information

Jobs run on a schedule and can include one or more transfer configurations. Select which configurations to run and in what order.

if data.IsNew {

Job Details

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

The schedule will be converted to a cron expression. Learn more

Disabled jobs won't run automatically but can still be triggered manually.

Transfer Configurations

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.

Cancel
} else {

Job Details

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

The schedule will be converted to a cron expression. Learn more

Disabled jobs won't run automatically but can still be triggered manually.

Transfer Configurations

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.

Cancel
}
Scheduling Tips

Choose from simple interval, daily, weekly, or monthly schedules. For advanced scheduling needs, select "Custom" and use cron expression format. Jobs can run multiple configurations in sequence, useful for multi-step transfer workflows.

} }