package common import ( "fmt" "github.com/starfleetcptn/gomft/internal/db" ) templ NameField() {

Choose a descriptive name to identify this configuration.

} templ FilePatternFields() {

Glob pattern for files to transfer. Leave empty to transfer all files.

Pattern for output filename. Use variables like ${`filename`}, ${`timestamp`}, ${`date`}

Available variables:

• ${`filename`} - Original filename without extension (e.g., "report") • ${`ext`} - Original file extension (e.g., "csv") • ${`date:format`} - Current date using Go's time format: - 2006-01-02 → YYYY-MM-DD - 20060102 → YYYYMMDD - 2006-01-02 15:04:05 → YYYY-MM-DD_HH:MM:SS Example: ${`filename`}_${`date:2006-01-02`}_${`ext`} → "report_2023-03-01.csv"

} templ ArchiveOptions() {

Files will be moved here after successful transfer

Files with the same hash that have been successfully processed before will be skipped

Number of files to transfer simultaneously (higher values may improve performance but increase resource usage)

} templ RcloneFlags(currentCommandID uint) {
@RcloneCommandOptions(currentCommandID) // Pass it down

Select the rclone command to use for this configuration.

Optional: Additional rclone flags for fine-tuning the transfer.

} // New placeholder templ for rclone command options templ RcloneCommandOptions(currentCommandID uint) { // Accept currentCommandID
} templ SourceSelection(providers []db.StorageProvider) {
} templ DestinationSelection(providers []db.StorageProvider) {
} // RcloneCommandOptionsContent renders the command options organized by category templ RcloneCommandOptionsContent(categoryMap map[string][]db.RcloneCommand, categories []string, currentCommandID uint, commandFlagsJSON string, commandFlagValuesJSON string) { // Add flag JSON strings } // RcloneCommandFlagsContent renders the command flags for a selected command templ RcloneCommandFlagsContent(command *db.RcloneCommand, selectedFlagsMap map[uint]bool, selectedFlagValues map[uint]string) { if command == nil {
Command not found
return }

{ command.Name }

{ command.Description }

if len(command.Flags) > 0 {
Command Flags:
for _, flag := range command.Flags { if flag.DataType == "bool" {
if flag.DefaultValue != "" {

Default: { flag.DefaultValue }

}
} else {
@renderFlagInput(flag, selectedFlagValues[flag.ID], selectedFlagsMap[flag.ID]) // Pass value and enabled status if flag.DefaultValue != "" {

Default: { flag.DefaultValue }

}
} }
Usage Examples
if command.Name == "ls" || command.Name == "lsd" || command.Name == "lsl" || command.Name == "lsjson" || command.Name == "lsf" || command.Name == "delete" || command.Name == "purge" || command.Name == "rmdirs" || command.Name == "mkdir" || command.Name == "touch" || command.Name == "md5sum" || command.Name == "sha1sum" || command.Name == "sha256sum" || command.Name == "size" || command.Name == "stat" || command.Name == "version" { rclone { command.Name } [flags] source:path } else { rclone { command.Name } [flags] source:path dest:path }
} else {
This command doesn't have any specific flags.
}
} // Helper function to render appropriate input based on flag data type templ renderFlagInput(flag db.RcloneCommandFlag, value string, enabled bool) { if flag.DataType == "int" { } else if flag.DataType == "float" { } else { } }