feat: Enhance Rclone command configuration with pre-rendered flags and region support

- Added fields for pre-rendering flags in the config form, allowing for better user experience during edits.
- Updated Rclone command options to accept current command ID for pre-selection.
- Introduced region input fields for MinIO source and destination forms, enhancing configuration flexibility.
- Modified backend logic to handle region parameters when generating Rclone configurations.
- Improved flag handling by parsing selected flags and values for better state management in the UI.
This commit is contained in:
StarFleetCPTN
2025-03-29 07:59:37 -07:00
parent d4c07fdc8e
commit f95720758e
7 changed files with 186 additions and 57 deletions
+8
View File
@@ -141,6 +141,10 @@ func (db *DB) GenerateRcloneConfig(config *TransferConfig) error {
"--config", configPath,
"--log-level", "ERROR",
}
// Add region if specified
if config.SourceRegion != "" {
args = append(args, "region", config.SourceRegion)
}
cmd := exec.Command(rclonePath, args...)
if output, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("failed to create source config (minio): %v\nOutput: %s", err, output)
@@ -212,6 +216,10 @@ func (db *DB) GenerateRcloneConfig(config *TransferConfig) error {
"--config", configPath,
"--log-level", "ERROR",
}
// Add region if specified
if config.DestRegion != "" {
args = append(args, "region", config.DestRegion)
}
cmd := exec.Command(rclonePath, args...)
if output, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("failed to create destination config (minio): %v\nOutput: %s", err, output)